當使用提示境界自定義數據庫插入數據警報權限被拒絕
終止應用程序由於未捕獲的異常「RLMException」境界自定義數據庫插入數據,原因是:「XX:權限被拒絕」
但數據已被插入。
我的代碼:
RLMRealm *realm = [RLMRealm realmWithURL:[self dataBasePath:kRealmCustomDBName]];
realm.configuration.readOnly = NO;
NSLog(@"path = %@",realm.configuration.fileURL);
WEAKSELF
[realm transactionWithBlock:^{
NSDictionary *dic = @{
kRealmPrimaryKey:[weakSelf ret64bitString],
kRealmAvatarData:hiSchool.avatar,
kRealmTitle:hiSchool.title,
kRealmSubtitle:hiSchool.subTitle,
kRealmAge:hiSchool.age,
kRealmDate:hiSchool.date,
kRealmMale:hiSchool.isMale,
kRealmWeight:hiSchool.weight,
kRealmHeight:hiSchool.height
};
[HiSchool createInRealm:realm withValue:dic];
}];