Core Data Issue

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

  1. Josh Kahane macrumors 6502

    Aug 29, 2006
    Suffolk, UK

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

    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

    Jun 22, 2010
    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:

    + (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