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

  • Home
  • SEARCH
  • 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 6235505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:40:45+00:00 2026-05-24T10:40:45+00:00

In our code we do the following: – (void) createComment:(NSString *)comment ForId:(NSString *)objectId {

  • 0

In our code we do the following:

- (void) createComment:(NSString *)comment ForId:(NSString *)objectId
{    
  [facebookArguments setObject:objectId forKey:FACEBOOK_COMMENTS_FOR_ID_KEY ];
  [facebookArguments setObject:comment forKey:FACEBOOK_COMMENTS_FOR_ID_COMMENT]; 
  [facebookPrefs writeToFile:facebookPrefsFilePath atomically: NO];
  [facebookArguments writeToFile:facebookArgumentsFilePath atomically:NO];
}

but upon calling this code:

NSMutableDictionary* fbArgsDic = [[NSMutableDictionary alloc] initWithContentsOfFile: facebookArgumentsFilePath];
NSLog(@"Dictionary: %@", fbArgsDic);

Here’s the Log output before:

2011-08-04 16:11:53.938 My_App[30909:207] Dictionary: {
    facebookGetCommentsForIdComment = Legend;
    facebookGetCommentsForIdKey = 10150249987646875;
    facebookLikeForIdKey = 10150249445616875;
}

And After:

2011-08-04 16:06:39.685 My_App[30693:207] Dictionary: {
    facebookGetCommentsForIdComment = Legend;
    facebookGetCommentsForIdKey = "1.015024998764688e+16";
    facebookLikeForIdKey = 10150249445616875;
}

It’s converted the FACEBOOK_COMMENTS_FOR_ID_KEY entry, which was a NSString as seen above, into a NSNumber and lost some digits. These are LONG numbers as they are facebook id’s.

Any idea what’s going on and how we can fix it?

  • 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-24T10:40:46+00:00Added an answer on May 24, 2026 at 10:40 am

    The dictionary should be getting serialized as a properly list, which should preserve types. Are you sure id is really an NSString to start with? (Also, I agree with other commenters that you should use a different variable name to avoid confusing with the type id.)

    One possibility is that it’s actually an NSDecimalNumber, which gets written out as a numeric type and parsed back in as an NSNumber, losing precision.

    Try this:

    NSLog(@"Class of id: %@", NSStringFromClass([id class]));
    

    And if it is a numeric type after all, you can do:

    [facebookArguments setObject:[id stringValue] forKey:FACEBOOK_COMMENTS_FOR_ID_KEY]; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I noticed for a while now the following syntax in some of our code:
I'm trying to track down an issue in our system and the following code
We have similar code to the following in one of our projects. Can anyone
We are frequently using the following code pattern in our JavaScript code if (typeof(some_variable)
The following (simplified version of our) code passes our JUnit tests under Hibernate, but
Today I found the following disturbingly ambiguous situation in our code base: class Base
The following exception is returned to our code during the following: m_cnn = new
I noticed the following code from our foreign programmers: private Client[] clients = new
Found the following code in our code base: public static final int DEFAULT_LENGTH =
In our code we usually use the following pattern: Connection conn; try{ conn =

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.