Cool, I'm quite a beginner myself, so this may be not quite correct... When you set up your user interface using interface builder and when the application launches the window it automatically allocates and initializes all the objects you placed on the window. *I never tried to replace those objects, nor did I find it necessary.* You simply connect that object in IB to your IBOutlet so you have a *reference* in your code to access that UI object. Also I assume, since you did NOT alloc init the original NSTextField, you can't just ask it to be released. Other objects are still referencing it. I just assume that the objects I place using IB are readonly for me. I can change their properties but not the objects themselves... I'm sure someone will correct me if I'm wrong.
If, however you wanted to do all UI manually, you would have to worry about initializing UI objects yourself, you wouldn't drag then onto window in IB. You would have to manually include them in the window, put them at certain coordinates, etc. I think your exercise obscured your goal too much. Instance variables are simply any data that your object may need. Properties simply add accessor methods to those ivars automatically and make your class KVC/KVO compliant for those variables. Try playing with simpler ivars, integers, floats, strings. Try setting and accessing them from other classes, etc. You'll get a hang of it. Regards, Karolis On Sun, Oct 11, 2009 at 4:50 PM, Michael de Haan <[email protected]> wrote: > > On Oct 11, 2009, at 2:35 PM, Karolis Ramanauskas wrote: > > OK, perhaps I am misunderstanding you, but if you are simply trying to set >> the label of the NSTextField you may wanna do this. >> > > > Well...what I was **really** trying to do was get my head around using > properties/ivars correctly :-) But, of course, your solution worked > immediately! So, just for completeness, the reason my approach did not work > was ? > > 1)one cannot simply assign a new object to a control...it's much more > involved than this > > 2) something else? > > Thanks again. > > > >> > _______________________________________________ > > Cocoa-dev mailing list ([email protected]) > > Please 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: > http://lists.apple.com/mailman/options/cocoa-dev/karolisr%40gmail.com > > This email sent to [email protected] > _______________________________________________ Cocoa-dev mailing list ([email protected]) Please 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
