Help with ADC Tutorial

Discussion in 'Mac Programming' started by ghall, Feb 8, 2007.

  1. macrumors 68040

    ghall

    Joined:
    Jun 27, 2006
    Location:
    Rhode Island
    #1
    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.
     
  2. Guest

    caveman_uk

    Joined:
    Feb 17, 2003
    Location:
    Hitchin, Herts, UK
    #2
    You need an @ in front of the key ie @"creationDate"
     
  3. thread starter macrumors 68040

    ghall

    Joined:
    Jun 27, 2006
    Location:
    Rhode Island
    #3
    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
     
  4. macrumors 68000

    GeeYouEye

    Joined:
    Dec 9, 2001
    Location:
    State of Denial
    #4
    I could be wrong (this is without a look at the docs) but I think you want NSCalendarDate rather than NSDate.
     
  5. thread starter macrumors 68040

    ghall

    Joined:
    Jun 27, 2006
    Location:
    Rhode Island
    #5
    Hmm, seems to build without any errors now, but still doesn't work. Weird.
     

Share This Page