Why is object not dealloc’ed when using ARC + NSZombieEnabled

Turns out, I’ve written some serious nonsense If zombies worked like I originally wrote, turning on zombies would directly lead to innumerable false positives… There is some isa-swizzling going on, probably in _objc_rootRelease, so any override of dealloc should still be called with zombies enabled. The only thing that won’t happen with zombies is the … Read more

Weak and strong property setter attributes in Objective-C

Here is what I know about variable properties atomic //default nonatomic strong=retain //default weak retain assign //default unsafe_unretained copy readonly readwrite //default so below is the detailed article link where you can find above mentioned all attributes, that will definitely help you. Many thanks to all the people who have given the best answers here!! … Read more

Instance variables declared in ObjC implementation file

This is indeed a new language feature, and if you must declare your ivars (rather than simply declaring properties and letting the compiler generate ivars for you) it’s a good practice. Your header files in theory should only expose public interface for your classes; everything else belongs in the implementation. One caveat is that implementation-file … Read more

With ARC, what’s better: alloc or autorelease initializers?

The difference is subtle, but you should opt for the autorelease versions. Firstly, your code is much more readable. Secondly, on inspection of the optimized assembly output, the autorelease version is slightly more optimal. The autorelease version, – (NSString *)hello:(NSString *)name { return [NSString stringWithFormat:@”Hello, %@”, name]; } translates to “-[SGCAppDelegate hello:]”: push {r7, lr} … Read more