Hacker News new | past | comments | ask | show | jobs | submit login

The cleanest version IMO is

  - (void) setFoo:(NSString*)bar {
    [bar retain];
    [foo release]; 
    foo = bar;
  }
which harmlessly increments and decrements for self-assignment.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: