Linked Questions

1 vote
2 answers
254 views

Calculation of sum incorrect when digits over 10 million [duplicate]

I have a textfield (numbers only) and a UILabel which I am adding together with the use of a button. The UILabel displays the answer and the Textfield goes blank on calculation. The calculations and ...
Mustafa's user avatar
  • 755
35 votes
4 answers
36k views

What is the maximum value of NSInteger?

I need to store the maximum value of an NSInteger into an NSInteger? What is the correct syntax to do it? Thanks.
David's user avatar
  • 14.3k
80 votes
2 answers
43k views

What NSNumber (Integer 16, 32, 64) in Core Data should I use to keep NSUInteger

I want to keep NSUInteger into my core data and I don't know which type should I use (integer 16, 32, 64) to suit the space needed. From my understanding: Integer 16 can have minimum value of -32,...
sarunw's user avatar
  • 8,106
39 votes
2 answers
975 views

How to check that two format strings are compatible?

Examples: "Something %d" and "Something else %d" // Compatible "Something %d" and "Something else %f" // Not Compatible "Something %d" and "Something %d else %d" //...
Erik B's user avatar
  • 41.7k
3 votes
3 answers
2k views

Objective-C NSNumber numberWithLongLong creates integer

When I attempt to create an NSNumber using the numberWithLongLong with a number greater than -2 and less than 13 it returns a number that is casted as an (int). I see this if I look at the Xcode ...
user1556446's user avatar
2 votes
2 answers
7k views

What is the max value of Int in different iOS versions?

I was building this app and it needs to convert a string to an Int. So I did this: Int(someString) However, sometimes someString is a very large number. Its value exceeds the max value of Int32. I ...
Sweeper's user avatar
  • 238k
6 votes
3 answers
4k views

List of Scalar Data Types

Im looking for a list of all the scalar data types in Objective C, complete with their ranges (max/min values etc). Sorry for the simple question, Im just really struggling to find anything like this....
Jimmery's user avatar
  • 9,963
5 votes
2 answers
4k views

Convert NSData into Hex NSString

With reference to the following question: Convert NSData into HEX NSString I have solved the problem using the solution provided by Erik Aigner which is: NSData *data = ...; NSUInteger capacity = [...
Dawson's user avatar
  • 117
3 votes
2 answers
6k views

How do you determine the maximum long value in Objective-C?

How would you find the maximum long value supported on your system within an application in Objective-C? That is, how do we determine what the largest value is that long can represent?
Justin Galzic's user avatar
5 votes
1 answer
2k views

Storing and retrieving an int64_t from an NSDictionary: NSNumber vs NSString

I am developing a game with Game Center functionality. Internally, my game holds all scores in variables of type int64_t, since that is the required type for reporting scores through the GameKit API (...
Nicolas Miari's user avatar
1 vote
3 answers
4k views

Setting the text on a UILabel is crashing my app

So I have setup my UILabel, but when I set the text in my game loop to a string that is the score (so the Text is reset every loop) my app crashes. This is the error I get: 0x15560b0: cmpl (%...
Xcoder's user avatar
  • 45
6 votes
2 answers
701 views

Current time milliseconds returns minus value for 32 bit in iOS

I need to get the current time from system in milliseconds. I'm using XCode 5.1.1 and I tried with the following, long timePassed_ms = ([[NSDate date] timeIntervalSince1970] * 1000); This is working ...
codebot's user avatar
  • 2,588
0 votes
1 answer
2k views

Unsigned Long Long Range values

I'm making a binary converter for iPhone, and for convert a number from base X to other base I use this method: +(NSString*)FromXToOtherBase:(unsigned long long)base number:(unsigned long long)number ...
Alessio's user avatar
  • 13
-1 votes
3 answers
404 views

Which dataType will return the value (37.961498) as it is ? Double didn't work

Which dataType will return the value (37.961498) as it is? I am working in MapView. Where, at present I am setting annotation and hence I have to set CLLocationCoordinate2DMake with some lat and lng ...
Siddarth Hailstorm's user avatar
1 vote
1 answer
407 views

Issue Converting NSString to Int

For some reason when I convert this NSString to an integer, I get a completely random (yet consistent) number. - (void)connectionDidFinishLoading:(NSURLConnection *)connection { // do something ...
Peter Kazazes's user avatar

15 30 50 per page