I have three quick questions that I have encountered conflicting answers to which I hope someone can clarify.
- Do I need to execute [super init] before NSObject to the end? (for example, if Foo inherits from NSObject, should Foo call [super init]? If not, does this also apply to dealloc?
- Whether some form of initialization occurs by default for member variables in the object. For example, would the NSString * element be initialized to nil? float to 0.0?
- If my object has an initFoo method, can I call [self init] inside this function to perform general initialization?
Since I start with Objective-C, I quite often accept Yes for the first and No for the second two, but I hope to keep some typings :)
Thank,
source
share