Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Streamer

macrumors member
Original poster
Apr 18, 2008
70
0
Apols for a noobie question. I have a textfield and it is connected as an outlet to one class, however I sometimes want to write to it from another class. I ended up declaring an outlet in the new class and connecting that, so I have the same object as two outlets. Is that ok or am I heading to a bigger problem.

Thanks.
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
You can reference it from as many classes as you like. Another way would be to have a controller object that has sole direct access to it and then access it from other classes through the controller, like [[myController testTextField] setStringValue:mad:"TEST"];
 

Streamer

macrumors member
Original poster
Apr 18, 2008
70
0
Many thanks for the answer. I did originally try the latter way but I think I screwed up my bracket ordering :cool:

Much appreciated.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.