iphone Programming Glossary: relationshipname
JSON and Core Data on the iPhone http://stackoverflow.com/questions/2362323/json-and-core-data-on-the-iphone valuesDictionary setObject managedObject entity name forKey @ ManagedObjectName for NSString relationshipName in relationshipsByName allKeys NSRelationshipDescription description managedObject entity relationshipsByName.. NSRelationshipDescription description managedObject entity relationshipsByName objectForKey relationshipName if description isToMany NSManagedObject relationshipObject managedObject valueForKey relationshipName.. if description isToMany NSManagedObject relationshipObject managedObject valueForKey relationshipName valuesDictionary setObject self dataStructureForManagedObject relationshipObject forKey relationshipName..
JSON and Core Data on the iPhone http://stackoverflow.com/questions/2362323/json-and-core-data-on-the-iphone dictionaryWithValuesForKeys attributesByName allKeys mutableCopy valuesDictionary setObject managedObject entity name forKey @ ManagedObjectName for NSString relationshipName in relationshipsByName allKeys NSRelationshipDescription description managedObject entity relationshipsByName objectForKey relationshipName if description isToMany.. for NSString relationshipName in relationshipsByName allKeys NSRelationshipDescription description managedObject entity relationshipsByName objectForKey relationshipName if description isToMany NSManagedObject relationshipObject managedObject valueForKey relationshipName valuesDictionary setObject self dataStructureForManagedObject.. managedObject entity relationshipsByName objectForKey relationshipName if description isToMany NSManagedObject relationshipObject managedObject valueForKey relationshipName valuesDictionary setObject self dataStructureForManagedObject relationshipObject forKey relationshipName continue NSSet relationshipObjects managedObject objectForKey..
Core Data “Upsert” from SQLite Database http://stackoverflow.com/questions/1997212/core-data-upsert-from-sqlite-database Create objects to test for existence of relationship NSPredicate predicate NSPredicate predicateWithFormat @ relationshipName RELATIONSHIP_NAME NSEntityDescription entityDescription NSEntityDescription entityForName @ EntityRelationship inManagedObjectContext.. init autorelease fetchRequest setEntity entityDescription while sqlite3_step compiledStatement SQLITE_ROW NSString relationshipName NSString stringWithCharsIfNotNull char sqlite3_column_text compiledStatement 0 NSPredicate localPredicate predicate predicateWithSubstitutionVariables.. 0 NSPredicate localPredicate predicate predicateWithSubstitutionVariables NSDictionary dictionaryWithObject relationshipName forKey @ RELATIONSHIP_NAME fetchRequest setPredicate localPredicate NSError fetchError NSArray array managedObjectContext..
JSON and Core Data on the iPhone http://stackoverflow.com/questions/2362323/json-and-core-data-on-the-iphone allKeys mutableCopy valuesDictionary setObject managedObject entity name forKey @ ManagedObjectName for NSString relationshipName in relationshipsByName allKeys NSRelationshipDescription description managedObject entity relationshipsByName objectForKey.. allKeys NSRelationshipDescription description managedObject entity relationshipsByName objectForKey relationshipName if description isToMany NSManagedObject relationshipObject managedObject valueForKey relationshipName valuesDictionary setObject.. objectForKey relationshipName if description isToMany NSManagedObject relationshipObject managedObject valueForKey relationshipName valuesDictionary setObject self dataStructureForManagedObject relationshipObject forKey relationshipName continue NSSet..
|