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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:39:37+00:00 2026-05-18T10:39:37+00:00

In objective C, what is a better way of doing this: if ([response class]

  • 0

In objective C, what is a better way of doing this:

if ([response class] == [nil class])

response is either a NSDictionary or NSMutableDictionary

The code is working but I’m getting a "Invalid receiver type 'void *' or "comparison of distinct Objective-C types 'Class' and 'struct NSMutableDictionary *' lacks a cast" warning messages

Thanks

  • 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-18T10:39:38+00:00Added an answer on May 18, 2026 at 10:39 am

    If you’re actually looking to test [response class], instead of the value of response itself, you’ll want to use

    if ([response isKindOfClass:[NSNull class])
    

    If you’re looking to check if response itself is nil, I describe a nice way of doing this in this answer to a similar question.

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

Sidebar

Related Questions

I have an Objective-C NSMutableDictionary declared inside a class's @interface section, with getter/setter methods,
Is this a bad idea? Is there a better way to achieve the same
I'm writing a bit of code doing string manipulation. In this particular situation, appending
Is there a better way in Objective-C to do: if ([elementName isEqual:@one]){ // do
Possible Duplicate: Objective-C: With ARC, what's better? alloc or autorelease initializers? Does ARC automatically
We're implementing solr with ecommerce application. The main objective is faster search and better
I'm not pretty sure if this question is for here, but I want to
I'm wondering if there's an easy way to set (or retrieve) an Objective-C property
This is a somewhat subjective question, but I'd like to hear the pros/cons for
What is the best way in objective-c to rename a file if a file

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.