Skip to content

Instantly share code, notes, and snippets.

@0x8badf00d
Created February 21, 2012 12:15
Show Gist options
  • Save 0x8badf00d/1876181 to your computer and use it in GitHub Desktop.
Save 0x8badf00d/1876181 to your computer and use it in GitHub Desktop.
setter
- (void)setValue:(NSString *)aValue
{
if (value != aValue)
{
[value release];
value = [aValue retain];
}
}
@Abizern
Copy link

Abizern commented Feb 21, 2012

This won't work with ARC. It isn't needed if you use a synthesised property.

Also, it would be better to use a copy instead of a retain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment