self = [super init] [super init] calls the superclass implementation of init with the (hidden) self argument. It can do one of these things + set some properties on self, and return self + return a different object (factory, singleton) + return nil
@selector SEL selector1 = @selector(initWithName:) SEL selector2 = @selector(initWithFriends1Name::) typedef struct objc_selector *SEL Read more at Objective C Runtime Reference -> Data Structure -> Class definition Data structure -> SEL
Objective C Runtime The Objective-C Runtime is a Runtime Library, it's a library written mainly in C & Assembler that adds the Object Oriented capabilities to C to create Objective-C.
Objective C Runtime Source code http://www.opensource.apple. com/source/objc4/objc4-532/runtime/objc-class.mm There are two versions of the Objective-C runtime— “modern” and “legacy”. The modern version was introduced with Objective-C 2.0 and includes a number of new features.
Objective C Runtime Dynamic typing Dynamic typing enables the runtime to determine the type of an object at runtime id cat = [[ETPCat alloc] init] - (void)acceptAnything:(id)anything;
How to use the Runtime API Objective-C programs interact with the runtime system to implement the dynamic features of the language. ● Objective-C source code ● Foundation Framework NSObject methods ● Runtime library API
Use cases Method swizzle (IIViewDeckController) - (void)vdc_presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL) animated completion:(void (^)(void))completion { UIViewController* controller = self.viewDeckController ?: self; [controller vdc_presentViewController:viewControllerToPresent animated:animated completion: completion]; // when we get here, the vdc_ method is actually the old, real method }