Last active
July 6, 2016 17:17
-
-
Save kenmhaggerty/fe92195b27bde93d5b0f123eaf22d0c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)setName:(NSString *)name { | |
NSString *primitiveName = [self primitiveValueForKey:NSStringFromSelector(@selector(name))]; | |
if ((!name && !primitiveName) || [name isEqualToString:primitiveName]) { | |
return; | |
} | |
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; | |
if (name) { | |
userInfo[@"object"] = name; | |
} | |
[self willChangeValueForKey:NSStringFromSelector(@selector(name))]; | |
[self setPrimitiveValue:name forKey:NSStringFromSelector(@selector(name))]; | |
[self didChangeValueForKey:NSStringFromSelector(@selector(name))]; | |
[[NSNotificationCenter defaultCenter] postNotificationName:@"kPQSurveyNameDidChangeNotification" object:self userInfo:userInfo]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment