[migration enumerateObjects:Person.className block:^(RLMObject *oldObject, RLMObject *newObject) {
newObject[@"fullName"] = [NSString stringWithFormat:@"%@ %@",
oldObject[@"firstName"],
oldObject[@"lastName"]];
}];
@interface Person : RLMObject
@property BOOL isStuff;
Person *newPerson = (Person *)newObject;
newPerson = YES;
newPerson.isStuff = YES;
2015-03-24 15:27:17.278 RealmMigration[29256:5779790] -[RLMObject setIsStuff:]: unrecognized selector sent to instance 0x7fcaee07c1b0
2015-03-24 15:27:17.289 RealmMigration[29256:5779790] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RLMObject setIsStuff:]: unrecognized selector sent to instance 0x7fcaee07c1b0'
So the question is simple:--
You received this message because you are subscribed to the Google Groups "Realm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-cocoa unsub...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-cocoa/c397ec09-58f8-4e8d-9699-89aa42048ea5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Tue, Mar 24, 2015 at 1:26 PM UTC, Oleg Anghelov <oleg.a...@gmail.com> wrote:
*there should be
newPerson.isStuff = YES;
--
You received this message because you are subscribed to the Google Groups "Realm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-cocoa unsub...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-cocoa/37dc594e-6eaa-43a6-9317-d5d671750ab0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Realm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-cocoa...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-cocoa/7629e7a3-45d4-4356-8abe-20147c23c6ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
2015-03-25 10:56:23.576 RealmMigration[34299:6811640] *** Terminating app due to uncaught exception 'RLMException', reason: 'Invalid property name'
Oleg,
I'm unable to reproduce the exception you were seeing with the test project you shared.
--
Samuel Giddins
On Wed, Mar 25, 2015 at 9:01 AM UTC, Oleg Anghelov <oleg.a...@gmail.com> wrote:
On Thu, Apr 2, 2015 at 10:01 PM UTC, Help <he...@realm.io> wrote:Oleg,
I just wanted to follow up with you to see if you've got everything working now?
--
Samuel Giddins
On Wed, Mar 25, 2015 at 6:33 PM UTC, Help <he...@realm.io> wrote:Oleg,
I'm unable to reproduce the exception you were seeing with the test project you shared.
--
Samuel Giddins
On Wed, Mar 25, 2015 at 9:01 AM UTC, Oleg Anghelov <oleg.a...@gmail.com> wrote:Hi.
Did you try it?
I get
2015-03-25 10:56:23.576 RealmMigration[34299:6811640] *** Terminating app due to uncaught exception 'RLMException', reason: 'Invalid property name'
Please take a look on this simple project:
https://www.dropbox.com/s/o5p1ns0ppitjafy/TestProject.zip?dl=0
On Tue, Mar 24, 2015 at 4:09 PM UTC, Help <he...@realm.io> wrote:Oleg,
Doing `newObject[@"isStuff"] = @YES` should do the trick!
--
Samuel Giddins
@interface DiseaseEntity : RLMObject
@property NSString *name;
@property NSString *desc;
@property DiseaseEntityType type;
@property BOOL favorite; // new property
@end
[migration enumerateObjects:DiseaseEntity.className block:^(RLMObject *oldObject, RLMObject *newObject) {
DiseaseEntity *newDe = (DiseaseEntity *)newObject;
newDe.favorite = NO;
}];
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RLMDynamicObject setFavorite:]: unrecognized selector sent to instance 0x7fe963d246a0'
I'm getting the same error on an existing Realm db where I've added a Bool property:
@interface DiseaseEntity : RLMObject
@property NSString *name;
@property NSString *desc;
@property DiseaseEntityType type;
@property BOOL favorite; // new property@end
When running the migration I'm setting the new bool value to false:
[migration enumerateObjects:DiseaseEntity.className block:^(RLMObject *oldObject, RLMObject *newObject) {
DiseaseEntity *newDe = (DiseaseEntity *)newObject;
newDe.favorite = NO;
}];
I get the following exception:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RLMDynamicObject setFavorite:]: unrecognized selector sent to instance 0x7fe963d246a0'
When opening the Realm in the Realm Browser, I also do not see the additional property on the class.
I am using Realm 0.93.1. I haven't had any issues adding other properties previously.
Thanks!
Andrew
[RLMRealm setSchemaVersion:13 forRealmAtPath:[RLMRealm defaultRealmPath] withMigrationBlock:^(RLMMigration *migration, uint64_t oldSchemaVersion) {
[migration enumerateObjects:DiseaseEntity.className block:^(RLMObject *oldObject, RLMObject *newObject) {
newObject[@"favorite"] = NO;
NSLog(@"newObject: %@", newObject);
}];
}];
Terminating app due to uncaught exception 'RLMException', reason: 'Invalid property name'