2014-11-05 58 views
1

XCODE 6.0.1
IBM推送通知SDK用于苹果iOS 2.7.3没有融合的iOS SDK

我创建新的项目(所以我的应用程序只是世界您好应用程序),我跟着下面的步骤。

我添加下列属性的Info.plist。

  • NSLocationWhenInUseUsageDescription
  • NSLocationAlwaysUsageDescription

我补充说: “-fno-objc弧” 编译器标志下面的文件,因为ARC是的myproject有效。

  • CompanyInboxViewCell.m
  • CompanyCustomInbox.m
  • CompanyInboxVC.m
  • CompanyDetailsVC.m
  • AppDelegate.m

我建造它。然后,我在“XLXtifyOptions.m”文件中的“registerForPush方法”中遇到以下错误。
capture is here

/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]; 

任何想法?
在此先感谢!

+0

我成功构建和部署示例应用程序。所以我必须错过一些东西,但我无法弄清楚。 – satohiro 2014-11-05 09:13:46

+0

我向XLXtifyOptions.m添加了“#import ”,然后错误消失了,这是正确的解决方案吗? – satohiro 2014-11-06 01:33:55

回答

1

看起来“#import”<'UIKit/UIKit.h'>'“是正确的解决方案。
Apple iOS 2.7.3的IBM Push Notification SDK已更新至2.7.4。 2.7.4版本导入UIKit/UIKit.h的“XLXtifyOptions.m”。

之后,我成功地建立了。但是当我执行它时,我遇到了以下错误。

[XLappMgr INIT]
二〇一四年十一月一十二日13:40:38.811 XtifyApp [479:95045] *终止应用程序由于未捕获的异常 'NSInvalidArgumentException',原因:“* - [NSPlaceholderString initWithString:]:零参数” ***第一掷调用堆栈: (0x181d9e084 0x1923d40e4 0x181d9dfc4 0x182b9d8b4 0x10004ef0c 0x10004e738 0x10003f784 0x1865864a4 0x100042608 0x192a42a08) 的libC++ abi.dylib:与类型的未捕获的异常终止NSException

我添加“包显示名称“属性到info.plist。然后上面的错误消失了。

谢谢。