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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:43:56+00:00 2026-05-23T10:43:56+00:00

I read around S.O and did Google this a fair bit but I wasn’t

  • 0

I read around S.O and did Google this a fair bit but I wasn’t able to find an answer to my problem…

I have an NSDictionary which is returning NSCFString's and what I need is an NSString so that I can use its doubleValue function. I can’t for the life of me figure out how to turn my NSCFString‘s into NSStrings. I’ve tried the following with no success:

NSString* lng_coord = (NSString*)[dict objectForKey:key];
            if ([lng_coord class] == [NSString class])
                NSLog(@"lng coord is an exact match with NSString class");
            else {
                NSLog(@"lng coord doesn't match NSString class");
                NSLog(@"The class of lng_coord is %@", [[dict objectForKey:key] class]);
            }
            NSLog(@"%@", lng_coord);
            [CelebsAnnotation setLongitude:[lng_coord doubleValue]];

And this is the output from console:

lng coord doesn't match NSString class
The class of lng_coord is NSCFString
49.2796758
  • 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-23T10:43:57+00:00Added an answer on May 23, 2026 at 10:43 am

    NSCFString is a private subclass of NSString, you can just use it as one.

    Because of such patterns like class clusters, you shouldn’t directly compare the classes here – use -isKindOfClass: instead:

    if ([lng_coord isKindOfClass:[NSString class]]) {
        // ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've read around quite a bit but haven't found a definitive answer. I have
I had read about this thread around the Internet but unlucky to find a
bit of a n00b question this one but I haven't been able to find
Having read around it appears this should be possible. I have the following content
I am very new to Android development and Java. Have read around but I'm
I've searched around on a lot of forums but have yet to find an
I have a quite big problem, where I can't find any help around in
I have read a couple of articles but im still having trouble understanding this.
Which NOSQL DB can I use to have concurrent writes and read for around
I am trying to find the easiest way to read from multiple (around 100)

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.