I've got a simple project using magical record to store values.

I was curious if I had some code that was in this order would it execute sequentially or if there was a chance it would not due to any asyn function going on in the background with magical record and core data.

[MeetingTypes MR_truncateAllInContext:localContext];

MeetingTypes *oMeetingTypes = [MeetingTypes MR_createInContext:localContext]; 
[localContext MR_saveToPersistentStoreAndWait];
有帮助吗?

解决方案

There is no async code you need to worry about in any of those calls -- assuming that there isn't any missing code in your example that dispatches another work queue or other context.

You can inspect the source quite readily to assure yourself that it isn't dispatching MR_truncateAllInContext: or MR_createInContext: asynchronously.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top