I am develop a iPhone application, in which i need to use JSON
to receive data from server.
In the iPhone side, I convert the data into NSMutableDictionary
.
However, there is a date type data are null.
I use the following sentence to read the date.
NSString *arriveTime = [taskDic objectForKey:@"arriveTime"];
NSLog(@"%@", arriveTime);
if (arriveTime) {
job.arriveDone = [NSDate dateWithTimeIntervalSince1970:[arriveTime intValue]/1000];
}
When the arriveTime is null, how can i make the if statement. I have tried [arriveTime length] != 0, but i doesn't work, because the arriveTime is a NSNull and doesn't have this method.