0

Please help. I'm very new about ios app development. I'm trying to use MagicalRecord to save data in objective-C. However, I already install the MagicalRecord, but MR_inContext still not working.

Person *person = 'what should goes here?';
[MagicalRecord saveWithBlock:^(NSManagedObjectContext *localContext){
Person *localPerson = [person MR_inContext:localContext];
localPerson.firstName = @"John";
} completion:^(BOOL success, NSError *error) {}

I am trying to do something like MagicalRecord document.

Shunli
  • 23
  • 1
  • 4
  • Please add more context about that: What is the error, what is language you use etc. – Eugen Konkov Oct 12 '16 at 20:07
  • Hi Eugen, thanks. I'm very new about ios development, Im using objective-c . I'm trying to learn MagicalRecord for saving data. I got that code from MagicalRecord documentation, and try them in xcode. however, they dont work at all. I always got error 'No known class method for selector 'MR_inContext:''. – Shunli Oct 13 '16 at 13:31
  • Did you import the correct .h ("NSManagedObject+MagicalRecord.h")? Also, did you set `enableShorthandMethods:` to YES? – Larme Oct 13 '16 at 13:33
  • @Shunli Try this: http://stackoverflow.com/questions/6361704/error-no-known-class-method-for-selector-hello-in-custom-made-framework – Eugen Konkov Oct 13 '16 at 18:17

0 Answers0