Когда я определяю методы target-c?

Я изучаю Objective-C и имею опыт работы с C / C ++.

In object-oriented C++, you always need to declare your method before you define (implement) it, even if it is declared in the parent class.

In procedural-style C, IIRC, you can get away with just defining a function so long as it is only called from something else in the same compilational unit (ie. the same file) that came later on in the file (well, provided you don't declare it elsewhere with "extern").

Now, in Objective-C, it appears that you only need to declare selectors in the header file if they are going to be used by something external, and that you can make up selectors in your .m file just fine, and call them within the .m file. Also, it appears that delegate methods or inherited methods are never (re)defined.

Я на правильном пути? Когда вам нужно определить селектор в Objective-C?

Ответы на вопрос(3)

Ваш ответ на вопрос