• 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
GUI Time Field
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GUI Time Field


  • Subject: GUI Time Field
  • From: Justin Giboney <email@hidden>
  • Date: Tue, 22 Apr 2008 13:34:14 -0600

I am trying to put a automatic date and time field into my GUI.

I have a text field connected to a variable called "theDateTime" in my controller class. If I set the variable manually the text field works just fine. But I want it to update automatically. My code is attached.

Thank you

Justin Giboney

#import "Controller.h"


@implementation Controller

- (id) init {
[super init];
[NSThread detachNewThreadSelector:@selector(runClock) toTarget: self withObject: nil];
return self;
}


- (void) setDateTime {
	NSAutoreleasePool *tempPool = [[NSAutoreleasePool alloc] init];
	theDateTime = [NSDate date];
	[tempPool release];
}

- (void) runClock {
	bool keepRunning = true;
	do {
		// sleep the specified time
		usleep(5000000);
		[self setDateTime];

	} while (keepRunning == true);
}


@end






_______________________________________________

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


  • Follow-Ups:
    • Re: GUI Time Field
      • From: "Shawn Erickson" <email@hidden>
    • Re: GUI Time Field
      • From: "Shawn Erickson" <email@hidden>
  • Prev by Date: Re: [Ann] DMG Canvas
  • Next by Date: Re: AppleScript - occasional crashes on Leopard
  • Previous by thread: Re: AppleScript - occasional crashes on Leopard
  • Next by thread: Re: GUI Time Field
  • Index(es):
    • Date
    • Thread