• 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: initial value of an NSPopupButton shows with delay
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: initial value of an NSPopupButton shows with delay


  • Subject: Re: initial value of an NSPopupButton shows with delay
  • From: Koen van der Drift <email@hidden>
  • Date: Fri, 17 Aug 2012 06:07:34 -0400

On Aug 16, 2012, at 8:50 PM, Peter Ammon <email@hidden> wrote:

> Is your window set to be visible at launch (i.e. in IB)? Try making it not visible at launch, and then ordering it onscreen after the nib is loaded. That should allow all the awakeFromNib methods to run before the window appears.

Hi Peter,

Your answer made me realize that I am using some fading animation to swap the views in and out:

    if ( oldView )
    {
        fadeOut = [NSDictionary dictionaryWithObjectsAndKeys: oldView, NSViewAnimationTargetKey, NSViewAnimationFadeOutEffect, NSViewAnimationEffectKey, nil];
    }

    fadeIn = [NSDictionary dictionaryWithObjectsAndKeys:  newView, NSViewAnimationTargetKey, NSViewAnimationFadeInEffect, NSViewAnimationEffectKey, nil];

    NSAnimation *animation = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObjects: fadeOut, fadeIn, nil]];

    animation.duration = 0.25;
   [animation startAnimation];


Once I comment out the last line, the view is loaded immediately, and the popup default title as well. When I set the animation time to a long time sec, I am able to read what it says before "default" name, and it is something like <NSManagedObject: 0x10142c9b0> (entity: MyEntity; id 0x101441630 <x-coredata://AA7C17...

All the other UI elements are drawn immediately, just not the popup. Which makes sense, since I set the title in awakeFromNib. I'll see if I can move the code to the init: method of my viewController.

Thanks,

- Koen.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >initial value of an NSPopupButton shows with delay (From: Koen van der Drift <email@hidden>)
 >Re: initial value of an NSPopupButton shows with delay (From: Peter Ammon <email@hidden>)

  • Prev by Date: Re: Displaying a sheet immediately after a window is opened
  • Next by Date: Re: Displaying a sheet immediately after a window is opened
  • Previous by thread: Re: initial value of an NSPopupButton shows with delay
  • Next by thread: NSBrowser fills NSPasteboard but won't drop
  • Index(es):
    • Date
    • Thread