Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6634371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:55:18+00:00 2026-05-25T22:55:18+00:00

I am develop a iPhone application, in which i need to use JSON to

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:55:19+00:00Added an answer on May 25, 2026 at 10:55 pm

    the NSNull instance is a singleton. you can use a simple pointer comparison to accomplish this:

    if (arriveTime == nil) { NSLog(@"it's nil"); }
    else if (arriveTime == (id)[NSNull null]) { // << the magic bit!
      NSLog(@"it's NSNull");
    }
    else { NSLog(@"it's %@", arriveTime); }
    

    alternatively, you could use isKindOfClass: if you find that clearer:

    if (arriveTime == nil) { NSLog(@"it's nil"); }
    else if ([arriveTime isKindOfClass:[NSNull class]]) {
      ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to develop an iPhone/iPod application which runs in the background and can
I need to develop an application on both iphone and android which have to
I am about to develop a new iPhone application in which I need to
I am new to the iPhone development, I need to develop application in which
I need to develop one application for iPhone which is named as Theme Apps
I want to develop an iPhone application which has to record the phone conversation.
I am the beginner in iphone development. I develop an application in which i
i need to develop an iPhone application that is a Client of serverside application.
I'm planning to develop a web application that targets the iPhone. I will use
I want to develop ebook reader application, from which user can buy ebooks available

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.