Mac Objective C Constructor

robbieduncan

Moderator emeritus
Jul 24, 2002
24,782
141
Harrogate
You seem to have forgotten the + and - signs in front of the methods names:

+initialize initialises a Class (not an instance)

-init initialises and instance

-awakeFromNib initialises a de-serialised instance being created from a nib.

The last two are different as in the latter you can be sure any outlets connected in the nib are connects but this is not true in the former.
 
Comment

satyam90

macrumors regular
Original poster
Jul 30, 2007
242
0
Bangalore, India
I didn't understand what do u mean by "you can be sure any outlets connected in the nib are connects" in your response
 
Comment

robbieduncan

Moderator emeritus
Jul 24, 2002
24,782
141
Harrogate
I didn't understand what do u mean by "you can be sure any outlets connected in the nib are connects" in your response
Exactly what I said. If you create an instance of this object in nib file then any outlets will not be connected when init gets called but will be when awakeFromNib is called.
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.