Core Data Issue

Discussion in 'iOS Programming' started by Josh Kahane, Nov 20, 2010.

  1. Josh Kahane macrumors 6502

    Joined:
    Aug 29, 2006
    Location:
    Suffolk, UK
    #1
    Hi

    I am new to CoreData and I am having issues getting it working. As you can see I have a couple of errors:

    http://b.imagehost.org/0891/Screen_shot_2010-11-20_at_14_36_10.png

    Basically Im trying to do the following:
    1. User selected UITextView (notesView) and types in their note.
    2. Upon leaving the UITextView save the note and the date it was made on.
    3. When the user changes the date in the UIDatePicker (datePicker) load any note if there is one related to that date.

    So similar to notes in a calendar, notes saved to a specific date.

    Hope you can help, thanks.
     
  2. ianray macrumors 6502

    Joined:
    Jun 22, 2010
    Location:
    @
    #2
    The first and second error messages are caused by assigning the result of NSDate method timeIntervalSinceNow to a pointer -- check the documentation to see what is expected. The easiest way to check the docs, in XCode, is to right click on 'timeIntervalSinceNow' and select "Find in Documentation".

    The third and fourth error messages are self-explanatory -- but unusual, and without more information we would just be stabbing in the dark.

    Regarding the first warning, then, as written, that line of code requires the following method in your class:

    Code:
    + (NSManagedObjectContext*)managedObjectContext {
        // ...
        return ...;
    }
    The plus sign in the method signature is Objective-C syntax for a class method. Judging by your use of self.managedObjectContext elsewhere then this is probably not what you want.
     

Share This Page