Getter:

Assigned property:

Setter:

- (void)setObject:(anObject *)theObject{
if (object != theObject) { //make you are not attempting to set the same object as is already set
object = theObject;
}
}

Getter:

- (anObject *)object{
return objectToBeReturned
}

Atomic, retained property:

Setter:

- (void)setObject:(anObject *)theObject{
@synchronized(self) {//don't allow any other updates to occur until finished
if (object != theObject) { //make you are not attempting to set the same object as is already set
[object release];
object = [theObject retain];
}
}
}