Re: Automatically select current system's timezone from popup button
Re: Automatically select current system's timezone from popup button
- Subject: Re: Automatically select current system's timezone from popup button
- From: Ron Fleckner <email@hidden>
- Date: Tue, 10 Mar 2009 16:12:17 +1100
On 10/03/2009, at 3:30 PM, Nick Zitzmann wrote:
On Mar 9, 2009, at 9:33 PM, Jushin wrote:
So, basically, the popup button has the list of NSString of
timezone name.
However, when I launch my application, I would like to make my
application automatically select current system's timezone from the
list.
Also, when a user select a timezone from the popup button, I want to
convert it into NSTimeZone.
How can I do this?
Use the represented object feature of NSMenuItem to implement both.
Nick Zitzmann
<http://www.chronosnet.com/>
Or just get the time zone from the name of the item:
- (IBAction)popupAction:(id)sender
{
NSString *place = [[sender selectedItem] title];
NSTimeZone *zone = [NSTimeZone timeZoneWithName:place];
// Do stuff with zone...
}
Ron
_______________________________________________
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