Hello
i just first tried out core data right now.
I created an App which loads Locations from a Server and creates by using a JSON-Parser dynamically Model-Instances of Class "Location". Works fine and no problems.
Now i need to store some locations as favorizedLocations localy on the client. Therefore i want to use CoreData. I had set up a LocationsDetailView with a Button "Add To favorites". And the next things which are supposed to happen are the "Unkown Things" now.
- (void)addFavorite{
LogForGUI(@"TODO Add Favorit with name %@ to Core Data", **objTheLocation**.strAdr);
// Create a new instance of the entity managed by the fetched results controller.
NSManagedObjectContext *context = [fetchedResultsController managedObjectContext];
NSEntityDescription *entity = [[fetchedResultsController fetchRequest] entity];
NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context];
// If appropriate, configure the new managed object.
[newManagedObject setValue:[NSDate date] forKey:@"timeStamp"];...
I have created a Location.xcdatamodel the Location.h Modelclass. I had to remove the Arrays and Dictionaries within the xcdatamodel because they required a Type and Array was not available (obviously).
So what i want: I want to bring my already created Model Instance in the CoreData World without setting all properties.
And second question: how can i handle arrays and dictionaries with core data.