2013-02-28 88 views
0

我试图添加libUAirship-1.4.0.a通过去建立阶段>链接二进制库和磁盘上定位库后,这样做后,我仍然得到一个错误说使用未声明标识符:UAirshipTakeOffOptionsLaunchOptionsKey,UAirship,UAPush。iOS上的城市飞艇实施

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    // Override point for customization after application launch. 

    //Create Airship options dictionary and add the required UIApplication launchOptions 
    NSMutableDictionary *takeOffOptions = [NSMutableDictionary dictionary]; 
    [takeOffOptions setValue:launchOptions forKey:UAirshipTakeOffOptionsLaunchOptionsKey]; 

    // Call takeOff (which creates the UAirship singleton), passing in the launch options so the 
    // library can properly record when the app is launched from a push notification. This call is 
    // required. 
    // 
    // Populate AirshipConfig.plist with your app's info from https://go.urbanairship.com 
    [UAirship takeOff:takeOffOptions]; 

    // Set the icon badge to zero on startup (optional) 
    [[UAPush shared] resetBadge]; 

    // Register for remote notfications with the UA Library. This call is required. 
    [[UAPush shared] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | 
                 UIRemoteNotificationTypeSound | 
                 UIRemoteNotificationTypeAlert)]; 

    // Handle any incoming incoming push notifications. 
    // This will invoke `handleBackgroundNotification` on your UAPushNotificationDelegate. 
    [[UAPush shared] handleNotification:[launchOptions valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey] 
         applicationState:application.applicationState]; 

    return YES; 
} 
+0

我已经张贴在github的解决方案,很快我将发布一个项目,以及 – 2013-03-12 09:26:22

回答

2

您需要#import与库相关联的头文件才能使符号可用。对于这个图书馆,我相信你想以下添加到您的源文件的顶部:

#import "UAirship.h" 
#import "UAPush.h" 
+0

我这样做对进口已经说,但仍然收到错误未找到 – 2013-02-28 12:40:16

+1

然后你避风港“UAirship.h”文件将包含头文件的目录添加到目标的头部搜索路径中。 – bdash 2013-02-28 20:44:30

+0

我确实添加了../飞艇(递归),我确实按照城市飞艇网站上的所有步骤进行了操作,但没有成功,如果您有应用程序的工作副本,我会非常感谢您,如果您可以将它发送给我。 – 2013-03-02 07:08:01

1

我已经看到了如何设置头搜索路径许多不同的变化。 对我来说,这工作。飞艇文件夹与项目处于同一水平。

$(PROJECT_DIR)/Airship