NSDate Question
NSDate Question
- Subject: NSDate Question
- From: Matt <email@hidden>
- Date: Thu, 7 Dec 2006 22:22:16 -0500
I'm trying to use NSDate as a simple way to keep up a Last Viewed
status item for a simple app I'm playing with. Here's the bit of
code roughly put:
The only thing I am doing here is to create a date when I init this
controller (in this case it's in the actual controller, I was trying
this way because I was having issues in my app). There is a single
button just to print out the date stored when clicked. I get garbage.
The date prints fine in the init method but I get stuff like
"21397505" when you click the button. This is driving me crazy
because I don't see why in the world this code wouldn't work.
- (id) init {
self = [super init];
if (self != nil) {
myDate = [NSDate date];
NSLog(@"%@", myDate);
}
return self;
}
-(IBAction)buttonSetsDate:(id)sender {
NSLog(@"%@", myDate);
}
_______________________________________________
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