Can you guys help me understand a concept real quick, I'm having trouble understanding the conversion from C to objective-C:
If I had a particular instance method that look like this:
-(void)addOwnerNamesObject:(NSString *)n;
{
// ownerNames defined as NSMutableSet
[ownerNames addObject:n];
}
I understand a few things...
- It is an instance method that can be called by the program.
- In C this would not return anything (just execute the code in the curlies)
- In C, the syntax is slightly less confusing -
(void)InstanceMethod(Char *nameOfArgument)
Here's where I need help:
- When you call this method are you still sending it an argument?
- If so, is that argument an
NSString
instance that the method namesn
?
And finally... off topic
If you have a method...
-(id)someMethod:(NSString *)pn
{
}
- What is the (id) for? does that tell the compiler that it can return any type of object?
Thanks for helping the Newbie... Much appreciated.