未能合并iOS SDK

  • 本文关键字:SDK iOS 合并 xtify
  • 更新时间 :
  • 英文 :


XCODE 6.0.1
适用于Apple iOS 2.7.3 的IBM推送通知SDK

我创建了一个新项目(所以我的应用程序只是helloworld应用程序),并遵循了以下步骤。

  • 在您的应用程序中实现适用于Apple iOS的IBM推送通知SDK
    http://developer.xtify.com/display/sdk/Getting+Started+with+Apple+Push+Notification+Service#GettingStarted with ApplePushNotificationService在您的应用程序中实现%C2%A0IBMPushNotificationSDKforAppleiOSwi

我在info.plist.中添加了以下属性

  • NSLocationWhenUseUsageDescription
  • NSLocationAlwaysUsageDescription

我在下面的文件中添加了"-fno objc-arc"编译器标志,因为arc在myproject中是有效的。

  • CompanyInboxViewCell.m
  • 公司自定义收件箱.m
  • CompanyInboxVC.m
  • 公司详细信息VC.m
  • AppDelegate.m

我构建了它。然后在"XLXtifyOptions.m"文件中的"registerForPush方法"中出现了以下错误
捕获在这里

/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:107:5: error: use of undeclared identifier 'UIApplication'
UIApplication * app = [UIApplication sharedApplication];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:107:21: error: use of undeclared identifier 'app'
UIApplication * app = [UIApplication sharedApplication];
                ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:107:28: error: use of undeclared identifier 'UIApplication'
UIApplication * app = [UIApplication sharedApplication];
                       ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:110:9: error: use of undeclared identifier 'app'
if([app respondsToSelector:@selector(registerForRemoteNotifications)])
    ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:112:9: error: use of undeclared identifier 'UIUserNotificationType'
    UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
        ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:113:9: error: use of undeclared identifier 'UIUserNotificationSettings'
    UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
    ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:113:38: error: use of undeclared identifier 'settings'
    UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
                                 ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:113:50: error: use of undeclared identifier 'UIUserNotificationSettings'
    UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
                                             ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:114:10: error: use of undeclared identifier 'app'
    [app registerUserNotificationSettings: settings];
     ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:115:10: error: use of undeclared identifier 'app'
    [app registerForRemoteNotifications];
     ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:120:9: error: use of undeclared identifier 'UIRemoteNotificationType'
    UIRemoteNotificationType types = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
    ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:13: error: use of undeclared identifier 'types'
        types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
        ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:21: error: use of undeclared identifier 'UIRemoteNotificationTypeNewsstandContentAvailability'
        types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
                ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:76: error: use of undeclared identifier 'UIRemoteNotificationTypeBadge'
        types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
                                                                       ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:108: error: use of undeclared identifier 'UIRemoteNotificationTypeSound'
        types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
                                                                                                       ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:139: error: use of undeclared identifier 'UIRemoteNotificationTypeAlert'
        types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
                                                                                                                                      ^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:123:10: error: use of undeclared identifier 'app'
    [app registerForRemoteNotificationTypes:types];

有什么想法吗
提前感谢!

看来"#import'<'UIKit/UIKit.h'>'"是正确的解决方案
Apple iOS 2.7.3的IBM推送通知SDK已更新到2.7.4。2.7.4版本的"XLXtifyOptions.m"导入UIKit/UIKit.h

在那之后,我成功地建造了。但我在执行时出现了以下错误。

[XLappMgr初始化]
2014-11-12 13:40:38.811 XtifyApp[479:95045]*由于未捕获异常"NSInvalidArgumentException"而终止应用,原因:"*-[NSPlaceholderString initWithString:]:nil argument'***首次抛出调用堆栈:(0x181d9e084 0x1923d40e4 0x181d9 dfc4 0x182b9d8b4 0x10004ef0c 0x10004e738 0x10003f784 0x1865864a4 0x100042608 0x192a42a08)libc++abi.dylib:以NSException 类型的未捕获异常终止

我在info.plist中添加了"Bundle display name"属性。然后上面的错误就消失了。

谢谢。

最新更新