Terminating app due to uncaught exception 'RLMException', reason: ''NSMutableArray' is not supported as an RLMObject property. All properties must be primitives, NSString, NSDate, NSData, RLMArray, or subclasses of RLMObject.
請任何幫助。我不知道如何將它作爲RLMArray我只是想創建一個默認的RMRealm,但仍然崩潰
NSDictionary *res = [NSJSONSerialization JSONObjectWithData:self.responseData options:NSJSONReadingMutableLeaves error:&myError];
// NSLog(@"%@",res);
for (NSDictionary *collectionDict in [res objectForKey:@"pois"])
{
RLMRealm *defaultREALM=[RLMRealm defaultRealm];
[defaultREALM beginWriteTransaction];
NSMutableDictionary *mCollectionDict = [collectionDict mutableCopy];
mCollectionDict[@"Firstname"] = collectionDict[@"name"];
[mCollectionDict removeObjectForKey:@"name"];
NSLog(@"%@===>%@",collectionDict,collectionDict[@"name"]);
[defaultREALM commitWriteTransaction];
}
你在某處使用NSMutableArray嗎?它似乎是錯誤的根據日誌 – Niko