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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Crash when trying to load a Custom NIB John Baughman iPhone/iPad Programming 5 Mar 30, 2011 09:43 PM
Getting Texts/ Notifications when on a Phone Call??? paulie6978 iPhone 3 Jun 27, 2010 08:40 PM
Get a notification from Facebook when someone joins my group? Mal Community Discussion 2 Mar 30, 2010 04:05 PM
Not getting push notifications When locked ajnicho iPhone Tips, Help and Troubleshooting 2 Dec 20, 2009 04:41 PM
Can my app get a notification when a recieving a call? StafJesp iPhone 1 Aug 15, 2008 04:15 AM


All times are GMT -5. The time now is 09:18 AM.

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

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