views:

118

answers:

2

if i have:

NSString* number = @"2000";

Will NSInteger integerNumber = [number integerValue];

be equal to the integer representation of 2000?

+3  A: 

Yes, it will be.

jtbandes
+7  A: 

Why not consult the documentation?

integerValue

Returns the NSInteger value of the receiver’s text.

- (NSInteger)integerValue

Return Value

The NSInteger value of the receiver’s text, assuming a decimal representation and skipping whitespace at the beginning of the string. Returns 0 if the receiver doesn’t begin with a valid decimal text representation of a number.

Santa
Stack Overflow IS the documentation. Dynamically updated with sample code and human-readable explanations. Pretty cool, actually.
willc2