So I know of course about the basic property getters and setters.
- (void)setAnObject:(NSObject *)anObject
{
}
- (NSObject *)anObject
{
return _anObject;
}
But I noticed in code completion today that for every property these add methods are created as well. I did some searching and couldn’t find reference of them. What are these and what do they do?
- (void)addAnObject:(NSSet *)objects
{
}
- (void)addAnObjectObject:(<#object-type#> *)object
{
}
Those are KVC-compliant accessors for the
anObjectproperty, which Xcode probably thinks is a collection type (e.g. NSSet). (Edit: Xcode may not think that, but is suggesting the completions anyway.)