我正在将图像从我的Coredata
赋值给NSData
对象,赋值后我会检查NSData
是否有图像。
如果数据不为空,我需要显示它。否则,我会在NSLog中记录“未找到图像”。
只有在对象中没有图像时,应用程序才会崩溃。
我尝试了:
NSData * dataImage;
if (dataImage == nil)
{
NSLog(@"Image is Assigned .... " );
}
else
{
NSLog(@"Image is Not Assigned ITS NIL.... " );
}
我的设备控制台看起来像这样:
Wed Nov 16 12:31:09 unknown ReportCrash[783] <Notice>: Formulating crash report for process Dial Up App[782]
Wed Nov 16 12:31:09 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.hiteshi.Dial-Up-App[0x1b63]) Job appears to have crashed: Segmentation fault
Wed Nov 16 12:31:09 unknown SpringBoard[24] <Warning>: Application 'Dial Up App' exited abnormally with signal 11: Segmentation fault
Wed Nov 16 12:31:10 unknown ReportCrash[783] <Error>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/Dial Up App_2011-11-16-123107_Priya-Chaturvedis-iPhone.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
我不知道我做错了什么。应用程序在模拟器上运行顺畅,但在设备上崩溃。我做错了什么?