I store some data in NSUserDefaults and keychain and I have a wrapper. For example
- (NSString *)userPassword
{
return [UICKeyChainStore stringForKey:KEY_USER_PASSWORD];
}
- (void)setUserPassword:(NSString *)userPassword
{
[UICKeyChainStore setString:userPassword forKey:KEY_USER_PASSWORD];
}
How should properties definition look like? Now I use as follows
@property (nonatomic, strong) NSString *userEmail;
But now I have a doubt if I should use strong statement there since I haven’t an ivar for it.
Thanks in advance.
strong or weak both will be fine.
Its your custom method, this implies that you are overriding the compiler’s method, or rather compiler will not create methods for those properties.
EDIT:
One more thing for you 🙂
Is there any advantage of having atomic property for saving in keychains/userdefaults?