• 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
NSPopUpButton updated after the fact
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSPopUpButton updated after the fact


  • Subject: NSPopUpButton updated after the fact
  • From: Ryan Homer <email@hidden>
  • Date: Tue, 27 Feb 2007 08:06:20 -0500

I have an NSPopUpButton that shows connection status such as online, away, offline. While I'm establishing the connection, I want to show "Connecting...". I do this by sending the following message (IBOutlet NSPopUpButton *onlineStatus):

[onlineStatus setTitle:NSLocalizedStringFromTable (@"Connecting...", ...];

Then, to connect I send the appropriate message:
[client connect ...];

But the NSPopUpButton never shows "Connecting..." during the connection. If I don't connect, it will show "Connecting..." though so I am thinking that this has something to do with the run loop. The odd thing is that it used to work and I didn't notice at what point it stopped working.

Now, during the connect phase, I do call the run loop (not sure if this has anything to do with it, so thought I would mention it).

NSDate *limitDate = [NSDate dateWithTimeIntervalSinceNow:RHMSNConnectionTimeout];
NSTimeInterval limitTimeInterval = [limitDate timeIntervalSinceReferenceDate];

while(connectionStatus != RHMSNConnectionOnline
&& [NSDate timeIntervalSinceReferenceDate] < limitTimeInterval)
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:limitDate];

// if we were not successful, inform the delegate and reset status
if(connectionStatus != RHMSNConnectionOnline) {
[delegate ...];
...
}



What can I do to have the NSPopUpButton updated before the connection starts?


Thanks in advance!

R
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: NSPopUpButton updated after the fact
      • From: Brian Smith <email@hidden>
  • Prev by Date: postscript files printing with cocoa
  • Next by Date: Re: document window appears very briefly
  • Previous by thread: NSPopUpButton updated after the fact
  • Next by thread: Re: NSPopUpButton updated after the fact
  • Index(es):
    • Date
    • Thread