Search code examples
iosobjective-ccore-datamagicalrecord

I'm unable to findFirstByAttribute in MagicalRecord


In the documentation of MagicalRecords it is given that

If you have a unique way of retrieving a single object from your data store you should do this

Person *person = [Person MR_findFirstByAttribute:@"FirstName" withValue:@"Forrest"];

I'm doing this

DX *foundDX = [DX MR_findFirstByAttribute:@"code" withValue:cell.DXCodeName];
NSLog(@"Found DX: %@, Cell Code Name is: %@",foundDX,cell.DXCodeName.text);

If I know the value is in the entity it still give me

Found DX: (null), Cell Code Name is: F45

But I have this value already in the DX entity

enter image description here

So What am I missing?


Solution

  • Sorry for putting this here but I don't have the reputation to comment yet. Have you tried passing in the value cell.DXCodeName.text?