NSPersistentStore

298 views
Skip to first unread message

Matt Hudson

unread,
Aug 4, 2013, 9:22:04 PM8/4/13
to apportabl...@googlegroups.com
I'm getting the error:

error: cannot define category for undefined class 'NSPersistentStore'

I'm using the trial so CoreData should be supported.  This Category is coming from MagicalRecord.

Matt

Philippe Hausler

unread,
Aug 4, 2013, 9:30:14 PM8/4/13
to Matt Hudson, apportabl...@googlegroups.com
NSPersistentStore should link. Make sure that in your application's configuration.json file that CoreData is listed as a dep in the add_params section
--
You received this message because you are subscribed to the Google Groups "Apportable discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Matt Hudson

unread,
Aug 4, 2013, 9:58:07 PM8/4/13
to apportabl...@googlegroups.com, Matt Hudson
Ah.. that's what I was missing!


On Sunday, August 4, 2013 9:30:14 PM UTC-4, Philippe Hausler wrote:
NSPersistentStore should link. Make sure that in your application's configuration.json file that CoreData is listed as a dep in the add_params section

On Sunday, August 4, 2013 at 6:22 PM, Matt Hudson wrote:

I'm getting the error:

error: cannot define category for undefined class 'NSPersistentStore'

I'm using the trial so CoreData should be supported.  This Category is coming from MagicalRecord.

Matt

--
You received this message because you are subscribed to the Google Groups "Apportable discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apportable-discuss+unsub...@googlegroups.com.

Matt Hudson

unread,
Aug 4, 2013, 10:23:59 PM8/4/13
to apportabl...@googlegroups.com, Matt Hudson
Actually I included it.

    // A list of dependencies.  Typically these correspond to
    // frameworks in the xcode project.
    "deps": ["CoreData",
        "FacebookSDK",
        ],
    

Here's the error:

In file included from /Users/matthudson/Development/MobRockIt/VoteRockIt/Pods/Headers/MagicalRecord/NSPersistentStoreCoordinator+MagicalRecord.h:9:
/Users/matthudson/Development/MobRockIt/VoteRockIt/Pods/Headers/MagicalRecord/NSPersistentStore+MagicalRecord.h:15:12: error: cannot define category for undefined class 'NSPersistentStore'
@interface NSPersistentStore (MagicalRecord)
           ^
/Users/matthudson/.apportable/SDK/System/CoreData/NSManagedObjectContext.h:19:60: note: forward declaration of class here
@class NSManagedObject, NSManagedObjectID, NSFetchRequest, NSPersistentStore, NSPersistentStoreCoordinator;
                                                           ^
1 error generated.


Thoughts?

Zac Bowling

unread,
Aug 4, 2013, 10:47:55 PM8/4/13
to Matt Hudson, apportabl...@googlegroups.com, Matt Hudson
It's a header difference and not a link problem. Our headers do not have NSPersistentStore.h included via NSManagedObjectContext.h (just a forward @class decl). Trying including <CoreData/CoreData.h> instead of one of the individual headers in CoreData. 

Sent from my iPhone
To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.

Matt Hudson

unread,
Aug 4, 2013, 11:08:01 PM8/4/13
to Zac Bowling, apportabl...@googlegroups.com
Well dang it.  I've included <CoreData/CoreData.h> on all of the MagicalRecord classes I can find.

The MagicalRecord project has pretty complex imports. 


The error is coming from that project rather than my own.

Any ideas?



–––––––––––––––––––––––––––––––––––––
Matt Hudson - Owner
–––––––––––––––––––––––––––––––––––––

Twitter: @MattFWD

Matt Hudson

unread,
Aug 5, 2013, 8:04:10 PM8/5/13
to apportabl...@googlegroups.com
Any ideas from anyone would be great.  

It looks like there is a forward declaration for NSPersistentStore.h but for some reason MagicalRecord needs an entire import.

Matt

Ian Fischer

unread,
Aug 5, 2013, 8:10:17 PM8/5/13
to Matt Hudson, apportable-discuss
Hey Matt,

Have you tried adding the following to CoreData+MagicalRecord.h, just to see if it fixes the issue?

#import <CoreData/NSPersistentStore.h>

Thanks,

Ian


--

Matt Hudson

unread,
Aug 5, 2013, 8:24:56 PM8/5/13
to apportabl...@googlegroups.com, Matt Hudson
Yeah I sure did.  Here's the error:

n file included from <built-in>:169:
In file included from <command line>:28:
In file included from /Users/matthudson/Development/MobRockIt/VoteRockIt/VoteRockIt/VoteRockIt-Prefix.pch:20:
In file included from /Users/matthudson/Development/MobRockIt/VoteRockIt/../../FTASync/Source/FTASync.h:15:
In file included from /Users/matthudson/Development/MobRockIt/VoteRockIt/Pods/Headers/MagicalRecord/CoreData+MagicalRecord.h:34:
In file included from /Users/matthudson/Development/MobRockIt/VoteRockIt/Pods/Headers/MagicalRecord/NSPersistentStoreCoordinator+MagicalRecord.h:9:
/Users/matthudson/Development/MobRockIt/VoteRockIt/Pods/Headers/MagicalRecord/NSPersistentStore+MagicalRecord.h:15:12: error: cannot define category for undefined class 'NSPersistentStore'
@interface NSPersistentStore (MagicalRecord)
           ^
/Users/matthudson/.apportable/SDK/System/CoreData/NSManagedObjectContext.h:19:60: note: forward declaration of class here
@class NSManagedObject, NSManagedObjectID, NSFetchRequest, NSPersistentStore, NSPersistentStoreCoordinator;

I've tried putting imports all over the place.

Matt
To unsubscribe from this group and stop receiving emails from it, send an email to apportable-discuss+unsub...@googlegroups.com.

Ian Fischer

unread,
Aug 6, 2013, 5:18:24 PM8/6/13
to Matt Hudson, apportable-discuss
Hey Matt,

Are you able to send us an Xcode project that demonstrates the issue?  I would be happy to take a look and try to get to the bottom of it.  If you can put a reduced test case together showing the failure in MagicalRecord, you can send it to s...@apportable.com.

Thanks,

Ian


To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.

Matt Hudson

unread,
Aug 6, 2013, 5:51:20 PM8/6/13
to Ian Fischer, apportable-discuss
I'll put one together. 

Sent from Mailbox for iPhone

Matt Hudson

unread,
Aug 6, 2013, 8:36:42 PM8/6/13
to apportabl...@googlegroups.com, Matt Hudson
I put together a sample project:


I get a different error but it's similar.  I'm using Cocoapods, so maybe that's an issue, or maybe it's just trouble with MagicalRecord.  Maybe my setup is just too complex, but I would do a lot to make this work.

Matt
To unsubscribe from this group and stop receiving emails from it, send an email to apportable-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ian Fischer

unread,
Aug 6, 2013, 9:14:29 PM8/6/13
to Matt Hudson, apportable-discuss
Thanks, Matt!

I took a look at this, and it appears that the issue you were facing in this particular project was that you put some things into the "remove_params" section of your configuration.json file that you probably meant to put in the "add_params" section.  In particular, to get it to be happy, I had to move "FacebookSDK" and "CoreData" from the "deps" array in "remove_params" to the "deps" array in "add_params", and then add "Parse" to the "deps" array of "remove_params".  Once I made those changes, the entire project built and ran for me without crashing (although in iOS it was a white screen, and in Android it was a black screen, but that is probably an issue with our xib handling).

I hope that helps!

Thanks,

Ian


To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.

Matt Hudson

unread,
Aug 6, 2013, 9:59:16 PM8/6/13
to Ian Fischer, apportable-discuss
Yeah I didn't add anything to the test project. Let me check the real project and see if that works. If so dumb mistake my part. 

Sent from Mailbox for iPhone


Ian Fischer

unread,
Aug 6, 2013, 10:03:20 PM8/6/13
to Matt Hudson, apportable-discuss
I hope that's all it is!  It's an easy mistake that we will make less easy in the future.

Matt Hudson

unread,
Aug 6, 2013, 11:12:06 PM8/6/13
to apportabl...@googlegroups.com, Matt Hudson
Sadly that was not it.  But here is a link to a project that gets the original error.  Apparently I didn't have enough of my project's code in the main app.  Now I'm getting the original error.


Thank you guys for your help!  I can't wait to get this thing going so I can fork over some money and make some too! haha

Matt

Ian Fischer

unread,
Aug 6, 2013, 11:25:35 PM8/6/13
to Matt Hudson, apportable-discuss
Hey Matt,

When I build that project with apportable, I get the following error:

Error: Module Parse not found

I fix that by adding "Parse" to the "deps" array of "remove_params".  I then get the following compile error:

/Users/ian/Downloads/ApportableMagicalRecord 2/ApportableMagicalRecord/FTASyncParent.h:17:13: fatal error: 'ParseHeaders.h' file not found
    #import "ParseHeaders.h"
            ^

Is this the error you're hitting?

Thanks,

Ian


To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.

Matt Hudson

unread,
Aug 7, 2013, 8:16:37 AM8/7/13
to apportabl...@googlegroups.com, Matt Hudson
No that's not the error I get.  Is it possible that I'm still on the Starter license?  I ran apportable update a couple times, but I don't know how to tell what license I'm on.

I attached the file with all of the output of the apportable build command for ApportableMagicalRecord project that I sent.

Matt
build_errors.txt

Zander Macquitty

unread,
Aug 7, 2013, 6:25:14 PM8/7/13
to Matt Hudson, apportabl...@googlegroups.com
Hi Matt,

Our database shows that you are set up for the Indie version. If you run apportable --version and it says "full" after the SDK then you know you are on the Indie version.

Thanks,

Zander


To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.

Matt Hudson

unread,
Aug 7, 2013, 8:46:09 PM8/7/13
to apportabl...@googlegroups.com, Matt Hudson
Apportable SDK version 5a38b1cfdf344cf1a833d1e2abc59f74e83aa839 full
clang version 7fc8b05e4f57f61dbbbe5c8e62581b0e0c42941e
gdb version ff0611b8b721b3bf393c655c7d147de52cc850ac
android sdk version r21.0.1.1
android ndk version r8d.1
unknown ninja

Looks like I have full.  I don't know why I'm getting the error.

In file included from /Users/matthudson/Development/ApportableMagicalRecord/ApportableMagicalRecord/MRAppDelegate.m:11:
In file included from /Users/matthudson/Development/ApportableMagicalRecord/ApportableMagicalRecord/FTASync.h:15:
In file included from /Users/matthudson/Development/ApportableMagicalRecord/Pods/Headers/MagicalRecord/CoreData+MagicalRecord.h:34:
In file included from /Users/matthudson/Development/ApportableMagicalRecord/Pods/Headers/MagicalRecord/NSPersistentStoreCoordinator+MagicalRecord.h:9:
/Users/matthudson/Development/ApportableMagicalRecord/Pods/Headers/MagicalRecord/NSPersistentStore+MagicalRecord.h:15:12: error: cannot define category for undefined class 'NSPersistentStore'
@interface NSPersistentStore (MagicalRecord)
           ^
/Users/matthudson/.apportable/SDK/System/CoreData/NSManagedObjectContext.h:19:60: note: forward declaration of class here
@class NSManagedObject, NSManagedObjectID, NSFetchRequest, NSPersistentStore, NSPersistentStoreCoordinator;

Ian Fischer

unread,
Aug 7, 2013, 10:52:29 PM8/7/13
to Matt Hudson, apportable-discuss
Hey Matt,

Are you sure you sent me everything that I would need in order to get to that error?  Given that I had to modify the configuration.json to get it to get all the way to compilation, I'm worried that I'm not looking at exactly the same thing as you.

Thanks,

Ian


To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.

Matt Hudson

unread,
Aug 8, 2013, 9:09:04 PM8/8/13
to apportabl...@googlegroups.com, Matt Hudson
Alright, instead of trying to duplicate the real project I distilled it down to just MagicalRecord which seems to be causing my problem.  I've attached the project and the errors I'm getting.

Matt
ApportableTest.zip
build_errors.txt

Ian Fischer

unread,
Aug 9, 2013, 1:50:18 AM8/9/13
to Matt Hudson, apportable-discuss
Hi Matt,

Thanks for all of your efforts to distill this!  I am able to get the same errors as you now.

As it turns out, we don't support some of the CoreData features that MagicalRecord is using, such as NSExpressionDescription.  CoreData is the largest of the frameworks available on iOS (larger than UIKit, even), as well as being very complex.  Our implementation works well for reasonably basic direct usage of an SQL persistent store in a single context, with basic fetch requests, etc., but it looks like MagicalRecord goes well beyond that, so Apportable may not be the right solution for apps based on that at the moment.  Simplifying your app's CoreData needs and using CoreData directly may be a better route if you would like to continue using Apportable.  Let us know if we can help further!

Thanks,

Ian


To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.

Matt Hudson

unread,
Aug 9, 2013, 8:09:05 AM8/9/13
to Ian Fischer, apportable-discuss
Yeah that's what I'm going to do. I had a suspicion that Magical Record was too big of a beast. ;)

Sent from Mailbox for iPhone


Reply all
Reply to author
Forward
0 new messages