0
if (_metaContextModel == nil) {
    if (s_metadataModelRoot == nil)
    {
        NSString            *modelPath = [[NSBundle mainBundle] pathForResource: @"MetaModel" ofType: @"momd"];
        BOOL                isDirectory;

        if ([[NSFileManager defaultManager] fileExistsAtPath: modelPath isDirectory: &isDirectory]) {
            if (isDirectory)
                _metaContextModel = [NSManagedObjectModel modelWithContentsOfFile: [modelPath stringByAppendingPathComponent: @"MetaModel.mom"]]; ///My code is crashing in this line. 
            else
                _metaContextModel = [NSManagedObjectModel modelWithContentsOfFile: modelPath];
        }

NSManagedObjectModel could not read the MetaModel.mom from the path. The MetaModel.mom is present in the path but could not read it from the path. It is also present in my project folder. If I debug the code it is somewhat coming back from that line & not going forward, screen becoming black & no crash. I am using 64 bit architecture for my app & earlier in 32 bit architecture it was working good. Any help of finding out the reason will be valuable. Thank you.

SAYAN NANDY
  • 373
  • 1
  • 3
  • 9
  • Should it be "MetaModel.momd" not "MetaModel.mom"? – Magnas Jun 30 '17 at 18:45
  • @Magnas... No if I change it to "MetaModel.momd" it does not work & same exception coming with a message "2017-07-03 10:28:51.705 BCDE[16469:3641345] +[NSManagedObjectModel modelWithContentsOfFile:]: unrecognized selector sent to class 0x10dec0d48 " – SAYAN NANDY Jul 03 '17 at 05:01

0 Answers0