Mobile Line Of Business

Richard Jones (MVP)

  Home  |   Contact  |   Syndication    |   Login
  202 Posts | 0 Stories | 36 Comments | 0 Trackbacks


Welcome to the Mobile Line Of Business Blog

Tag Cloud

Article Categories


Post Categories

Image Galleries


A bit of a revelation this evening. I discovered something obvious, but missing from my understanding of the brilliant iOS example that ships with the Sync. Framework 4.0CTP It seems that on the server side if a record is edited, correctly only the fields that are modified gets sent down to your device (in my case an iPad). I was previously just blindly assuming that I'd get all fields down. I modified my Xcode population code (based on iOS sample) as follows:
+ (void)populateQCItems:  (id)dict withMetadata:(id)metadata withContext:(NSManagedObjectContext*) context
	QCItems *item = (QCItems *)[Utils populateOfflineEntity:dict withMetadata:metadata withContext:context];

	if (item != nil)  // modify new or existing live item
		if ([dict valueForKey:@"Identifier"])  // new bit
			item.Identifier = [dict valueForKey:@"Identifier"];

		if ([dict valueForKey:@"InspectionTypeID"]) // new bit
			item.InspectionTypeID = [dict valueForKey:@"InspectionTypeID"];
		[item logEntity];
I hope this helps someone else; as I learnt this the hard way.

Technorati Tags: , , , ,

posted on Tuesday, June 19, 2012 6:18 PM