iphone - Xcode consistency error: Setting the No Action Delete Rule... is an advanced setting -


after creating data model in xcode, it's throwing following error each of object relationships:

consistency error: setting no action delete rule on [object relationship] advanced setting 

what xcode trying tell me, , how should respond?

core data uses inverse relationships , delete rules keep object graph consistent

let's have a.foo <1—1> b.bar , a.foo = b. automatically (effectively) performs b.bar = a.

now let's [b delete]. "nullify" rule, b.bar.foo = nil. "cascade", [b.bar delete]. "no action", nothing; a.foo "dangling core data object reference".

it's not dangling pointer; standard memory management rules mean b still exist in memory while a points (until a turns fault), a.foo forever refer deleted object, raises exception when try access properties. i'm not sure happens when save , re-fetch a either.

with many-to-many relationship, gets more complicated. implementation details: relationship appears "owned" one of entities, , saved when entity saved (i hit bug when trying set relationship across different mocs: moc saved didn't own updated entity, relationship never saved). when delete both a , b, relationships should removed, 1 assumes relationship disappears 1 of them removed (but don't know one!).


you want nullify or cascade. never use cascade because can never remember direction cascading happens in.


Comments

Popular posts from this blog

how to build hyperlink for query string in php -

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

queue - mq_receive: message too long -