我在RubyMotion应用程序中设置解析时遇到了一些麻烦。有没有人知道一个样本项目,它与最新版本的RubyMotion和Parse一起使用?
我正在使用Parsistence
宝石。这是我的rakefile中不可用的相关部分:
app.libs << ['/usr/lib/libz.1.1.3.dylib', '/usr/lib/libsqlite3.dylib']
app.vendor_project('vendor/Parse.framework', :static, :products => ['Parse'],
:headers_dir => 'Headers')
app.frameworks += [
"Accounts",
"Social",
"AdSupport",
"AudioToolbox",
"CFNetwork",
"SystemConfiguration",
"MobileCoreServices",
"Security",
"QuartzCore",
"StoreKit"]
我已将Parse.framework
文件复制到我的vendor
项目文件夹中。
这会导致以下错误:
(main)> 2015-05-30 08:21:27.681 myapp[54034:19457576] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '"User" is not a subclass of NSManagedObject.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010417fc65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000100e13bb7 objc_exception_throw + 45
2 CoreData 0x0000000101b9dae5 _PFFastEntityClass + 757
3 CoreData 0x0000000101b9d5f7 -[NSManagedObjectContext(_NSInternalAdditions) _retainedObjectWithID:optionalHandler:withInlineStorage:] + 119
4 CoreData 0x0000000101ba46b5 _prepareResultsFromResultSet + 3861
5 CoreData 0x0000000101ba1a00 newFetchedRowsForFetchPlan_MT + 3216
6 CoreData 0x0000000101b8e33c -[NSSQLCore objectsForFetchRequest:inContext:] + 524
7 CoreData 0x0000000101b8ddbb -[NSSQLCore executeRequest:withContext:error:] + 299
8 CoreData 0x0000000101c68a6c __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke + 3356
9 CoreData 0x0000000101c71c30 gutsOfBlockToNSPersistentStoreCoordinatorPerform + 192
10 libdispatch.dylib 0x0000000105d0d964 _dispatch_client_callout + 8
11 libdispatch.dylib 0x0000000105cf6fca _dispatch_barrier_sync_f_invoke + 76
12 CoreData 0x0000000101c63245 _perform + 197
13 CoreData 0x0000000101b8da58 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 504
14 CoreData 0x0000000101b8c2ca -[NSManagedObjectContext executeFetchRequest:error:] + 586
15 lactase2 0x000000010022d75b __unnamed_156 + 139
16 lactase2 0x000000010050346e rb_vm_dispatch + 6270
17 lactase2 0x000000010013ec1c vm_dispatch + 1436
18 lactase2 0x0000000100237447 rb_scope__array__block__ + 231
19 lactase2 0x0000000100504b8f _ZL13vm_block_evalP7RoxorVMP11rb_vm_blockP13objc_selectormiPKm + 1119
20 lactase2 0x0000000100503315 rb_vm_dispatch + 5925
21 lactase2 0x000000010013ec1c vm_dispatch + 1436
22 lactase2 0x000000010022c01e rb_scope__with_error_object:__ + 318
23 lactase2 0x00000001005038d9 rb_vm_dispatch + 7401
24 lactase2 0x000000010013ec1c vm_dispatch + 1436
25 lactase2 0x0000000100237314 rb_scope__array__ + 356
26 lactase2 0x00000001005038d9 rb_vm_dispatch + 7401
27 lactase2 0x000000010013ec1c vm_dispatch + 1436
28 lactase2 0x00000001003e4015 rb_scope__create_standard_user__ + 213
29 lactase2 0x00000001005038d9 rb_vm_dispatch + 7401
30 lactase2 0x000000010013ec1c vm_dispatch + 1436
31 lactase2 0x00000001003e38c9 rb_scope__on_load:__ + 217
32 lactase2 0x00000001005038d9 rb_vm_dispatch + 7401
33 lactase2 0x000000010013ec1c vm_dispatch + 1436
34 lactase2 0x000000010033703a rb_scope__application:didFinishLaunchingWithOptions:__ + 202
35 lactase2 0x000000010033723d __unnamed_34 + 61
36 UIKit 0x0000000102ca8788 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 240
37 UIKit 0x0000000102ca9397 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2540
38 UIKit 0x0000000102cac1de -[UIApplication _runWithMainScene:transitionContext:completion:] + 1349
39 UIKit 0x0000000102cab0d5 -[UIApplication workspaceDidEndTransaction:] + 179
40 FrontBoardServices 0x000000010724d5e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
41 CoreFoundation 0x00000001040b341c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
42 CoreFoundation 0x00000001040a9165 __CFRunLoopDoBlocks + 341
43 CoreFoundation 0x00000001040a8f25 __CFRunLoopRun + 2389
44 CoreFoundation 0x00000001040a8366 CFRunLoopRunSpecific + 470
45 UIKit 0x0000000102caab42 -[UIApplication _run] + 413
46 UIKit 0x0000000102cad900 UIApplicationMain + 1282
47 lactase2 0x000000010014707f main + 111
48 libdyld.dylib 0x0000000105d3d145 start + 1
49 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
我有一个User
模型用于CoreData的东西:
class User < CDQManagedObject
end
我不确定导致错误的原因,并感谢任何帮助。谢谢!
答案 0 :(得分:1)
重命名User
类是解决方案。当然这不是真正的解决方案,但它解决了这个问题。