The correct syntax for setting a property is simply
self.isEditMode = NO;
If you want to use -setValue:forKey: you need to write it as
[self setValue:[NSNumber numberWithBOOL:NO] forKey:@"isEditMode"];
However, in your situation there is no reason to do this.
However, since you are using the init method, I strongly recommend that you avoid any access to properties and use ivar directly instead, as in
isEditMode = NO;
This avoids calling the overridden setter (either in this class or in a subclass), which makes the assumption that the object has already completed initialization. For the same reason, you also want to avoid accessing properties inside -dealloc .
Kevin ballard
source share