Separate names with a comma.
Discussion in 'iOS Programming' started by Jules2010, Apr 9, 2010.
I just can't get the syntax right..
Thanks in advance.
1) It's not a function: it's a class method
2) Pretty simple:
Replace NameOfClassThatThisIsDeclaredInButYouChoseNotToTellUs with whatever the name of the class (not an instance of the class) is. I would note this is very basic Objective-C. Perhaps some time spent with the documentation would be a good idea?
Thanks, I'm using it in the same class so I was just using self.
Now I've tried the name of the function, which worked.
I thought self would have worked thanks.
I have been looking at the documentation and some books I bought, the objective c book isn't quite the same though.
Using self would make it an instance method call, since self is an instance. Make sure you understand the difference between class methods and instance methods.
Depends on the context of calling self...if called from within another class method, self refers to the class, not an instance of that class (classes are like instances too).
Oops. Yeah, you're right. Forgot about that.