如何避免这个崩溃错误!主线程日志中的崩溃是
ProcessArray:()
ProcessArray == 0
-[NSNull length]: unrecognized selector sent to instance 0x3c4e1090
我的代码:
ProcessArray = [EventSheetDetailArray valueForKey:@"Process"];
NSLog(@"ProcessArray:%@",ProcessArray);
if (ProcessArray.count > 0 ) {
NSLog(@"ProcessArray != 0");
[self ProcessJSONDateFormat];
}else{
NSLog(@"ProcessArray == 0");
}
下面我换评委!
id value = [EventSheetDetailArray valueForKey:@"Process"];
if ( ![[NSNull null] isEqual:value] )
{
ProcessArray = value;
NSLog(@"1111111");
}else{
NSLog(@"2222222");
}
但始终运行 NSLog(@"1111111") 这一行!不管是否有任何价值!