I want to get the unsigned long value of a NSNumber. I don´t know why, but it doesn't work. Here is what I did:
NSString * stern = [idd objectAtIndex:indexPath.row]; // get a String with Number from a NSArray
NSNumberFormatter * lols = [[NSNumberFormatter alloc] init];
NSNumber * iddd = [lols numberFromString:stern];
NSLog(@"%@", iddd); // I get the right number: 8084143463
unsigned long fooo = [iddd unsignedLongValue];
NSLog(@"%lu", fooo); // I get the wrong number: 3789176167
[twitterEngine deleteUpdate:fooo];
8084143463 == 0x1e1da3d67
3789176167 == 0x0e1da3d67
The size of a long on a 64bit system is 8 bytes. The size of a long on a 32bit system (like the iPhone) is 4 bytes. You need to use a long long
on an iPhone to store that value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With