Archive | objective-c RSS feed for this section

How to define private methods … sort of

There is no private or protected methods concept in Objective-C. I think it is related to the architecture of invoking method in Objective-C. Each method is invoked like [self method] style or [self performSelector:@selector(method)]. Internally, Objective-C runtime resolves method implementation by searching method name. This architecture gives flexibility to call method and also allows to have “category” but it is hard to support private method.

Leave a comment Continue Reading →

Calling selectors with multiple arguments – Stack Overflow

In Objective-C, a selector’s signature consists of:

  1. The name of the method (in this case it would be ‘myTest’) (required)
  2. A ‘;’ (colon) following the method name if the method has an input.
  3. A name and ‘:’ for every additional input.
Leave a comment Continue Reading →