Skip to content

Instantly share code, notes, and snippets.

@sugarmo
Last active December 28, 2015 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sugarmo/7541736 to your computer and use it in GitHub Desktop.
Save sugarmo/7541736 to your computer and use it in GitHub Desktop.
@interface Person : NSObject
@property (nonatomic, copy) NSMutableArray *friendNames;
@end
@implementation Person
- (id)init{
self = [super init];
if (self) {
_friendNames = [[NSMutableArray alloc] init];
}
return self;
}
- (NSMutableArray *)friendNames {
return [self mutableArrayValueForKey:@"friendNames"];
}
- (void)insertObject:(NSString *)object inFriendNamesAtIndex:(NSUInteger)index {
[_friendNames insertObject:object atIndex:index];
}
- (void)removeObjectFromFriendNamesAtIndex:(NSUInteger)index {
[_friendNames removeObjectAtIndex:index];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment