gpt4 book ai didi

iOS swift 和 Parse : localDataStore

转载 作者:可可西里 更新时间:2023-11-01 02:27:00 31 4
gpt4 key购买 nike

我正在尝试将 parse (iOS sdk v1.6.0 ) 与 is with switch 一起使用,并遵循我制作的文档:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.

Parse.enableLocalDatastore()
Parse.setApplicationId("appKey", clientKey:"clientKey")

但启动应用程序时出现此错误:

2014-12-11 20:29:41.627 ShareTales[62985:626799] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'You have to call setApplicationId:clientKey: on Parse to configure Parse.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000104873f35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000104163bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000104873e6d +[NSException raise:format:] + 205
3 ShareTales 0x00000001027ce7ba +[Parse getApplicationId] + 53
4 ShareTales 0x00000001027b3140 +[PFInternalUtils dataFilePath:] + 53
5 ShareTales 0x00000001027515ff -[PFSQLiteDatabase initWithName:] + 200
6 ShareTales 0x00000001027517b4 +[PFSQLiteDatabase databaseWithName:] + 69
7 ShareTales 0x0000000102766e79 +[PFOfflineStore _initializeTables] + 58
8 libdispatch.dylib 0x00000001064a07f4 _dispatch_client_callout + 8
9 libdispatch.dylib 0x000000010648d343 dispatch_once_f + 565
10 ShareTales 0x000000010275d6ef +[PFOfflineStore enableOfflineStore] + 252
11 ShareTales 0x00000001026f4c0d _TFC10ShareTales11AppDelegate11applicationfS0_FTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVSs10DictionaryCSo8NSObjectPSs9AnyObject____Sb + 157
12 ShareTales 0x00000001026f5d30 _TToFC10ShareTales11AppDelegate11applicationfS0_FTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVSs10DictionaryCSo8NSObjectPSs9AnyObject____Sb + 560
13 UIKit 0x0000000104c5b475 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 234
14 UIKit 0x0000000104c5bfbc -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2463
15 UIKit 0x0000000104c5ed2c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1350
16 UIKit 0x0000000104c5dbf2 -[UIApplication workspaceDidEndTransaction:] + 179
17 FrontBoardServices 0x000000010c5602a3 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
18 CoreFoundation 0x00000001047a953c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
19 CoreFoundation 0x000000010479f285 __CFRunLoopDoBlocks + 341
20 CoreFoundation 0x000000010479f045 __CFRunLoopRun + 2389
21 CoreFoundation 0x000000010479e486 CFRunLoopRunSpecific + 470
22 UIKit 0x0000000104c5d669 -[UIApplication _run] + 413
23 UIKit 0x0000000104c60420 UIApplicationMain + 1282
24 ShareTales 0x00000001026f8d8e top_level_code + 78
25 ShareTales 0x00000001026f8dca main + 42
26 libdyld.dylib 0x00000001064d5145 start + 1

有什么建议吗?

我也尝试将它移到 Parse.setApplicationId 之后

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.

Parse.enableLocalDatastore()
Parse.setApplicationId("appKey", clientKey:"clientKey")

我有:

2014-12-11 20:38:28.118 ShareTales[67520:637437] Warning: A long-running operation is being executed on the main thread.
Break on warnBlockingOperationOnMainThread() to debug.

最佳答案

我将 [Parse enableLocalDatastore]; 放在 [Parse setApplicationId:clientKey:]; 之后,我又遇到了另一个错误。但这另一个错误是因为您不能同时使用本地数据存储和缓存策略。当我删除缓存策略的方法时,一切正常。所以,我不知道这是否是文档错误,但您必须将此代码放在之后

关于iOS swift 和 Parse : localDataStore,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27430994/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com