Noob question regarding Cocoa objects.
Noob question regarding Cocoa objects.
- Subject: Noob question regarding Cocoa objects.
- From: dan <email@hidden>
- Date: Mon, 27 Nov 2006 22:07:08 -0500
I'm learning objective-c with Cocoa coming from a Java background. Have
some questions to make sure I'm on the right track.
-------------------------------
1-I'm thinking an objective-c object's init method is basically
equivalent to a Java's class constructor?
-------------------------------
2-By calling init (To initialize an object) it reaches the top most
object (NSObject) while executing all the init in the object tree?
Let's say there's objects A through Z, and Z inherits from NSObject.
So [a init] will call init inside B through NSObject?
-------------------------------
3-Guessing my own objects (That I created) does not have to have an
"init" - but it could be labeled as "initWithParam", etc. But I would
have to create a logic that calls the super class init?
-------------------------------
4-Working with objects I think of alloc and init. But some objects offer
methods that does it for you? (Basically my last question with an example)
Using NSString...
NSString *string1 = [NSString stringWithString:@"this is a test"];
Here stringWithString: actually fires off NSString init?
-------------------------------
Thanks
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden