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 8881735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:24:16+00:00 2026-06-14T20:24:16+00:00

I have a class which contains a dictionary used for making web calls. Basically

  • 0

I have a class which contains a dictionary used for making web calls. Basically the key value pairs are used to create the data that will be posted to the URL if the web call requires any values. This object class is set up using JSON.

I have a method which takes this class object and uses it to set up the web call. My problem is, if no parameters are required, then the dictionary is set to null which is fine, this is what I want, but for some reason when I do an if statement to check if the dictionary is null, it is hitting the else statement indicating that it is not null. Method looks like this

-(void)webCall :(WebServiceCall *)webCall_p
{

    //Creates a dictionary from the one stored in the WebResponse Class
    NSMutableDictionary *dict = [[webCall_p getWebServiceResponse] getVariablesByRegexMap];

    NSLog(@"%@", dict);
}

When I print it out I get this

<null>

Yet if I put in an if statement to check if it is null like so

 if(dict == NULL)
    {
        NSLog(@"NULL");
    }
    else
    {
        NSLog(@"Not NULL");
    }

It says not null. If I try to use the dict count command, like so

NSLog(@"%i", [dict count]);

The application crashes and brings up this error

-[NSNull count]: unrecognized selector sent to instance 0xaf8678 2012-11-23 11:48:44.005 Testing[3403:14003] *
Terminating app due to uncaught exception
‘NSInvalidArgumentException’, reason: ‘-[NSNull count]: unrecognized
selector sent to instance 0xaf8678’

I can’t for the life of me figure this out. Any help would be much appreciated

  • 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-06-14T20:24:17+00:00Added an answer on June 14, 2026 at 8:24 pm

    Aparently the value ist NSNull, which is an object, not nil. NSNull is a singleton if (dict == NSNull) should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class which contains a generic dictionary: protected Dictionary<K,T> Data { get;
I have a class which contains a static collection that can be used across
I have a class which contains 5 properties. If any value is assingned to
I have the following City class. Each city object contains a dictionary which keys
in my Class I have a static dictionary of strings object which contains a
I need simple linq Query which will create Dictionary I have Xml which contains
Hi i have a class which contains different methods for checking database values. Each
I have a parent class which contains a child object. I am using set
I have an abstract class which contains method for setting header text. It looks
Alright so here is the question. I have a user class which contains a

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.