Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 6, 2006, 08:32 AM   #1
ATG
macrumors regular
 
Join Date: Aug 2005
Getting a notification when a nib loads

I'm loading a nib with:
Code:
[NSBundle loadNibNamed:@"MyNib" owner:self];
How can I get an awakeFromNib style message when it finishes loading?

BTW awakeFromNib doesn't work
ATG is offline   0 Reply With Quote
Old Aug 6, 2006, 08:35 AM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
awakeFromNib gets called from classes within the nib. You generally call loadNibNamed:owner: from within the class that's in the nib, not outside it.
kainjow is offline   0 Reply With Quote
Old Aug 6, 2006, 12:08 PM   #3
ATG
Thread Starter
macrumors regular
 
Join Date: Aug 2005
Doesn't matter. I've figured out that it's not the secondary nib that's the problem but the document nib.

It seems that the
Code:
- - (void)windowControllerDidLoadNib:(NSWindowController *) aController
doesn't do what I says and not everything in the nib has completely loaded when it gets called.

I was trying to display a sheet to appear when a new document was created or opened (something like that anyway. I can't be bothered to explain fully ).

I thought that if I put the [NSApp beginSheet: etc:] message in the windowControllerDidLoadNib method then the sheet would appear after the nib had loaded and it would 'stick' to the window. Why doesn't that work.

Anyway, I fixed it by putting it in a menu so the nib would of loaded by then anyway.
ATG is offline   0 Reply With Quote
Old Aug 6, 2006, 12:12 PM   #4
kpua
macrumors 6502
 
Join Date: Jul 2006
It appears from the documentation that the method blocks until the nib is loaded successfully (as opposed from delaying it somewhere in the run loop or a secondary thread) because it returns a BOOL that indicates whether the load was a success or not.
kpua is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Chrome: notification not via Notification Centre anymore arnoz Mac Applications and Mac App Store 0 May 29, 2014 10:38 AM
iPhone: I cannot receive any twitter push notification or update the setting of notification. tkwlee iOS 7 7 Nov 22, 2013 07:03 AM
Getting notification AND email for Shared Calendar, I only wait notification sflomenb iCloud and Apple Services 0 Nov 27, 2012 10:00 PM
Notification center: dismiss notification instead of app NoSmokingBandit OS X 10.8 Mountain Lion 0 Nov 6, 2012 09:21 PM

Forum Jump

All times are GMT -5. The time now is 10:41 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC