Thanks for the answer. Do you know why the file's owner gets awakFromNib call as well? Is it creating a new file's owner object?
I tried to NSLog(@"%@", self); in maincontroller's awakefromnib, but the second call to that raised an exception. In the code I was trying to pass the second controller as a pointer to the maincontroller so its methods could be called. Is there a better way in Cocoa to do this? Regards, DairyKnight On Sun, Oct 25, 2009 at 5:21 PM, Volker in Lists <volker_li...@ecoobs.de>wrote: > Hi, > > you load the second nib from the main controller i guess. Thereby you set > the instance of your main ontroller as owner, thus it gets the awakeFromNib > call. Set your second controller as owner or nil (if you have an instance of > your second class in your NIB as file owner (!)). > > Cheers, > Volker > > Am 25.10.2009 um 09:55 schrieb DairyKnight: > > > Hi all, >> >> I'm trying to use two nib files in my program. In my main controller >> class, >> I load the second nib with: >> >> [NSBundle loadNibNamed:"second" owner:self]; >> >> >> But then, not only does the second controller in the second nib file >> recevie >> the awakeFromNib message, but also does the main controller >> class. Anyone knows why? Or Cocoa just broadcasts this message to every >> class? >> > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com