2013-02-28 86 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