Skip to content

Instantly share code, notes, and snippets.

@adamjspooner
Created November 16, 2011 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamjspooner/1370040 to your computer and use it in GitHub Desktop.
Save adamjspooner/1370040 to your computer and use it in GitHub Desktop.
Casting an NSString to an int
NSString *string = [[NSString alloc] initWithString:@"Ladies Love Cool James"];
NSLog(@"%@", string);
NSLog(@"%d", (int)string); // the string's value
NSLog(@"%d", (int)&string); // the string's pointer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment