我正在一个已经在worklight 6.1服务器上构建和部署适配器的项目中,我必须开发一个应用程序以使用最新版本的Swift使用这些适配器。

我试图将本机API添加到项目中,然后从本机应用程序与服务器连接,但是当我调用WLCliend.WLConnectWithDelegate(self)时,总是收到此错误:

> 2015-07-14 17:35:58.782 iOSNativeAPI[46479:353823] [ERROR]
> [WORKLIGHT]: Cannot find Cookies.mom file 2015-07-14 17:35:58.789
> iOSNativeAPI[46479:353823] *** Terminating app due to uncaught
> exception 'NSInvalidArgumentException', reason: 'Cannot create an
> NSPersistentStoreCoordinator with a nil model'
> *** First throw call stack:

我的问题是,项目是否在快速运行中,服务器在6.1中运行,这有什么用吗?因为6.1服务器没有生成桥接头文件,所以我不得不自己将其写入。

那么worklight服务器6.1是否可以与swift 1.2一起使用?
如果是,可能是什么导致此错误?

编辑:

这是桥接头文件:(我从使用7.0版本生成的文件中提取了该文件,并提示未找到的文件)
/*
* Licensed Materials - Property of IBM
* 5725-I43 (C) Copyright IBM Corp. 2006, 2014. All Rights Reserved.
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
#import "AbstractAcquisitionError.h"
#import "AbstractGeoAreaTrigger.h"
#import "AbstractGeoDwellTrigger.h"
#import "AbstractPosition.h"
#import "AbstractTrigger.h"
#import "AbstractWifiAreaTrigger.h"
#import "AbstractWifiDwellTrigger.h"
#import "AbstractWifiFilterTrigger.h"
#import "AcquisitionCallback.h"
#import "AcquisitionFailureCallback.h"
#import "BaseChallengeHandler.h"
#import "BaseDeviceAuthChallengeHandler.h"
//#import "BaseProvisioningChallengeHandler.h"
#import "ChallengeHandler.h"
//#import "JSONStore.h"
//#import "JSONStoreAddOptions.h"
//#import "JSONStoreCollection.h"
//#import "JSONStoreOpenOptions.h"
//#import "JSONStoreQueryOptions.h"
//#import "JSONStoreQueryPart.h"
#import "OCLogger.h"
#import "WLAcquisitionFailureCallbacksConfiguration.h"
#import "WLAcquisitionPolicy.h"
//#import "WLAnalytics.h"
#import "WLArea.h"
//#import "WLAuthorizationManager.h"
#import "WLCallbackFactory.h"
#import "WLChallengeHandler.h"
#import "WLCircle.h"
#import "WLClient.h"
#import "WLConfidenceLevel.h"
#import "WLCookieExtractor.h"
#import "WLCoordinate.h"
#import "WLDelegate.h"
#import "WLDevice.h"
#import "WLDeviceAuthManager.h"
#import "WLDeviceContext.h"
#import "WLEventSourceListener.h"
#import "WLEventTransmissionPolicy.h"
#import "WLFailResponse.h"
#import "WLGeoAcquisitionPolicy.h"
#import "WLGeoCallback.h"
#import "WLGeoDwellInsideTrigger.h"
#import "WLGeoDwellOutsideTrigger.h"
#import "WLGeoEnterTrigger.h"
#import "WLGeoError.h"
#import "WLGeoExitTrigger.h"
#import "WLGeoFailureCallback.h"
#import "WLGeoPosition.h"
#import "WLGeoPositionChangeTrigger.h"
#import "WLGeoTrigger.h"
#import "WLGeoUtils.h"
#import "WLLocationServicesConfiguration.h"
#import "WLOnReadyToSubscribeListener.h"
#import "WLPolygon.h"
#import "WLProcedureInvocationData.h"
#import "WLProcedureInvocationResult.h"
#import "WLPush.h"
#import "WLPushOptions.h"
//#import "WLResourceRequest.h"
#import "WLResponse.h"
#import "WLResponseListener.h"
//#import "WLSecurityUtils.h"
//#import "WLSimpleDataSharing.h"
#import "WLTriggerCallback.h"
#import "WLTriggersConfiguration.h"
//#import "WLTrusteer.h"
//#import "WLUserCertAuth.h"
#import "WLWifiAccessPoint.h"
#import "WLWifiAccessPointFilter.h"
#import "WLWifiAcquisitionCallback.h"
#import "WLWifiAcquisitionPolicy.h"
#import "WLWifiConnectTrigger.h"
#import "WLWifiConnectedCallback.h"
#import "WLWifiDisconnectTrigger.h"
#import "WLWifiDwellInsideTrigger.h"
#import "WLWifiDwellOutsideTrigger.h"
#import "WLWifiEnterTrigger.h"
#import "WLWifiError.h"
#import "WLWifiExitTrigger.h"
#import "WLWifiFailureCallback.h"
#import "WLWifiLocation.h"
#import "WLWifiTrigger.h"
#import "WLWifiVisibleAccessPointsChangeTrigger.h"

最佳答案

在Swift 1.2中实现应用程序这一事实(这非常适合您!)与服务器之间没有任何联系。服务器不关心应用程序编写时所使用的编程语言。

是的,您确实应该在Worklight 6.1中实现自己的桥接头文件。在以后的版本中,为您提供了此桥接文件。更高版本= MobileFirst Platform 7.0。

强烈建议您从Worklight 6.1升级到MobileFirst 7.0。

另请注意,cookies.mom已被弃用,不再使用,但我相信在6.1中它仍在使用中,所以现在我的猜测是,它可能是您的桥接头,可能是您的错误或您的实现。您可以提供其中之一吗?

关于ios - Worklight 6.1 Swift 1.2支持,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31409850/

10-13 03:49