|Apr 7, 2011, 09:13 PM||#1|
In Init, does self refer to the class or the instance?
Also is there any case where we call alloc and not init after that?
What confuses me is things like
self= [super init]
Basically, if self is a pointer to the class, we're tell self to point to the address described by [super init]
The problem with that is self should already point to whatever address returned by alloc right?
So why change it?
How to Learn Math
|Apr 8, 2011, 01:09 PM||#2|
In any instance method (-), self refers to the instance. In any class method (+), self refers to the class. Always call an init method after calling +alloc. The reason to set it is that some classes play tricks in -init and don't return the same object that +alloc did.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|How Do I get a reference to the openDocument method in first responder||tmeehan||Mac Programming||2||Feb 16, 2012 07:12 AM|
|Does Apple just not listen to the consumer? Or not care...or||hellodon||iPhone||27||Jul 7, 2008 09:18 PM|
|64 Bit, does it just have to be the OS or the machine too?||erandall38||OS X||3||Aug 9, 2007 12:52 AM|
|Apple DVI to Video adapter - does it use the digital or the analog signal?||snowlord||Mac Peripherals||5||Jan 25, 2007 02:15 PM|
All times are GMT -5. The time now is 05:40 AM.