Skip to content

Instantly share code, notes, and snippets.

@justincbeck
Created January 16, 2012 03:16
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 justincbeck/1618855 to your computer and use it in GitHub Desktop.
Save justincbeck/1618855 to your computer and use it in GitHub Desktop.
Pointers and address space
// Assume array is an NSArray of NSString objects
NSString *lastFoo = nil;
for (NSString *foo in array)
{
lastFoo = foo; // Why doesn't foo take on the address of bar?
lastFoo = &foo; // Is this better?
*lastFoo = &foo; // Or perhaps this?
// Other suggestions?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment