Daily Update Attention :http://weibo.com/hanjunqiang Sina Weibo!
I. Error message: Attempting to modify object outside of a write Transaction-call beginwritetransaction in an RLMRealm instance Fir St. Attempts to modify an object outside of a write transaction should first be called before the Rlmrealm instance object beginwritetransaction
Code section:
Managementcamviewcontroller *manager = [[Managementcamviewcontroller alloc] init];? Manager.ipcammodel = Curnode.nodedata;? Curnode.nodedata; [Curnode.nodedata copy];? [Self.navigationcontroller Pushviewcontroller:manager animated:yes];</span>
when I push from one page to another, I find that the data is not changed to a direct assignment when I copy it. (This strange problem has not been solved) The original copy is not a problem? However, instead of directly assigning the value, the above error is reported.
Two. Error message: Realm accessed from incorrect thread realm access from wrong threads
Solve:
[[RLMRealm Defaultrealm] beginwritetransaction];? _ipcammodel.cacheimgpath = spath;? [[RLMRealm Defaultrealm] Commitwritetransaction];</span>
It's useless to write a single case directly so save it suddenly found this thing really good
You might want to do this without blocking threads. OK, you can do the following.
RLMRealm *realm = [RLMRealm Defaultrealm];? [Realm Transactionwithblock:^{?_ipcammodel.cacheimgpath = spath;?}]; </span>
And one more time, it's because we've got a gcd on the outside .
Dispatch_barrier_async (_concurrentqueue, ^{});</span>
The realm database can not be opened with Realmbrowser when the emulator is running, as if it were open and could not run the program in the Run emulator? This stupid mistake is not the only one I've ever made.
iOS developer Chat QQ Group: 446310206
Daily Update Attention :http://weibo.com/hanjunqiang Sina Weibo!
Realm Error Summary in iOS Han Junqiang blog