• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: PreferencePane plugin: awakeFromNib gets called twice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PreferencePane plugin: awakeFromNib gets called twice


  • Subject: Re: PreferencePane plugin: awakeFromNib gets called twice
  • From: Stephan Ruggiero <email@hidden>
  • Date: Wed, 6 Apr 2005 09:41:09 +0200

Hi,

thank you very much for the suggestions - but I still run into trouble.
This is what I did:

-(void)willSelect {
  NSLog(@"willSelect");
  // have some variables initiated, set up some NSDictionary...
  // no changes to TextViews or other interface content
}

-(void)didSelect {
NSLog(@"didSelect");
// set the state of some interface content according to the variables' contents
}


-(void)didUnselect {
  // release the variables
}

Now this is what happens:
- Start the SystemPreferences app
- Select the plugin
- willSelect is called, everything is fine till now
- didSelect is called, but the changes to the view are not made
- didUnselect works as expected

I tried to replace <didSelect> with <mainViewDidLoad> or <awakeFromNib>, but these are always called first and only if the plugin is selected for the first time after starting the SysPref app (not after deselecting and reselecting).

Maybe there is still something I am missing?

Thank you!

Best regards,

Stephan

Am 05.04.2005 um 19:24 schrieb Douglas Norton:


On 5 Apr 2005, at 16:53, Dave Camp wrote:

On Apr 5, 2005, at 2:09 AM, Stephan Ruggiero wrote:

I am writing a preferences pane plugin that has a main window for the System Preferences app. and 2 separate panels the user can open.

The principal cocoa class (a subclass to NSPreferencesPane) is instantiated in the IB and has a -(void)awakeFromNib call to initiate some stuff when the plugin is selected.
Now my problem is that the awakeFromNib is called twice! I read about this problem here, but no solution given seem to apply to my situation, as I am not writing a standalone app, just a plugin.

That may not be a good place to put that code for a preference pane. I would suggest looking at mainViewDidLoad, didSelect, and didUnselect.



or willSelect as this is called before your pane is displayed.

Douglas


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >PreferencePane plugin: awakeFromNib gets called twice (From: Stephan Ruggiero <email@hidden>)
 >Re: PreferencePane plugin: awakeFromNib gets called twice (From: Dave Camp <email@hidden>)
 >Re: PreferencePane plugin: awakeFromNib gets called twice (From: Douglas Norton <email@hidden>)

  • Prev by Date: Odd problem using NSCoding
  • Next by Date: Re: ADC Core Data article
  • Previous by thread: Re: PreferencePane plugin: awakeFromNib gets called twice
  • Next by thread: Re: PreferencePane plugin: awakeFromNib gets called twice
  • Index(es):
    • Date
    • Thread