Created
November 15, 2023 02:58
-
-
Save DargonLee/ccc07b3c315e74b0552fc311968afb32 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
static const char kNameKey; | |
@implementation Person (Test) | |
- (void)setName:(NSString *)name | |
{ | |
objc_setAssociatedObject(self, &kNameKey, name, OBJC_ASSOCIATION_COPY_NONATOMIC); | |
} | |
- (void)getName | |
{ | |
return objc_getAssociatedObject(self, &kNameKey); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment