Handling 64-bit integers on a 32-bit iPhone

I would like to process unsigned 64-bit unsigned integers on an iPhone through 4s (which of course has a 32-bit ARM processor 6).

When trying to work with 64-bit unsigned integers, for example. Twitter ids, I have the following problem:

// Array holding the 64 bit integer IDs of the Tweets in a timeline:
NSArray *Ids =[timelineData valueForKeyPath:@"id"];

// I would like to get the minimum of these IDs:
NSUInteger minId = (NSUInteger) Ids.lastObject;

The array Idscontains the following numbers (= Net identifiers):

491621469123018752,
491621468917477377,
491621465544851456,
491621445655867393

However minIdreturns an invalid value 399999248(instead 491621445655867393)

How can I find the minimum or last object in an array of 64-bit integers on iPhone 4s?

+4
source share
1 answer

, 64 NSUInteger. uint64_t unsigned long long. NSNumber ( C).

uint64_t minID = [Ids.lastObject longLongValue];

uint64_t , , .

+4

All Articles