简体   繁体   中英

SUP 2.1.3 - iOS native application - exception is in createCore

I am developing an iOS app using Sybase Unwired Platform 2.1 ESD 3. I am getting this error before save the Synchronization Parameters:

Terminating app due to uncaught exception 'SUPPersistenceException', reason: 'exception is in createCore: Illegal key generator status: the key generator must be populated first.'

This is the source code:

SUPConnectionProfile *sp = [SyncMBOFlowInboxSyncMBOFlowInboxDB getSynchronizationProfile];

[sp setAsyncReplay:NO];
[sp setUser:user];
[sp setPassword:pass];
[sp setServerName:server];


NSUserDefaults *usr = [NSUserDefaults standardUserDefaults];

SyncMBOFlowInboxFlowInboxSynchronizationParameters *pp = [SyncMBOFlowInboxFlowInbox getSynchronizationParameters];
[pp setS_USER_ID:[usr stringForKey:@"netUser"]];
[pp save]; <--The error appear after run this

[SyncMBOFlowInboxSyncMBOFlowInboxDB synchronize];

Thanks!!

每次启动应用程序时(即使您处于脱机状态且不是第一次同步),也需要在尝试同步之前初始化SUP应用程序和相关的数据库,否则会收到该错误。

I found the solution.

If I use SynchronizationParameters, I need to use [SyncMBOFlowInboxSyncMBOFlowInboxDB subscribe] before. And unsubscribe when I finish to use the database.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM