PDA

View Full Version : Help with ADC Tutorial




ghall
Feb 8, 2007, 03:32 PM
Hey, I'm doing this tutorial ( http://developer.apple.com/cocoa/coredatatutorial/index.html ) and I'm stuck on Adding Custom Logic. I followed it exactly, and when I run my program, and add a "Release", my program locks up, and I have to quit out of Xcode to get out of it.

Here's what my CommitMessageMO.m looks like.

//
// CommitMessageMO.m
// Checkin
//
// Created by Graham Hall on 2/8/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "CommitMessageMO.h"


@implementation CommitMessageMO
- (void)awakeFromInsert {
[self setValue:[NSDate date] forKey:"creationDate"];
}

@end

The bolded line had an error that prevented Xcode to build the program, which I fixed. Now the build succeeds, but, as I said before, the app locks up.



caveman_uk
Feb 8, 2007, 03:41 PM
You need an @ in front of the key ie @"creationDate"

ghall
Feb 8, 2007, 03:42 PM
You need an @ in front of the key ie @"creationDate"

Thanks. I didn't see that.

EDIT: Okay, bear with me here, I'm new to this, but this is supposed to make today's date appear as the creation date, but it's not working. The app is no longer freezing, but it's not working either

GeeYouEye
Feb 8, 2007, 04:04 PM
I could be wrong (this is without a look at the docs) but I think you want NSCalendarDate rather than NSDate.

ghall
Feb 8, 2007, 04:30 PM
I could be wrong (this is without a look at the docs) but I think you want NSCalendarDate rather than NSDate.

Hmm, seems to build without any errors now, but still doesn't work. Weird.