0

[Build Phases] > [Link Binary With Libraries] に移動し、ライブラリをディスク上に配置して、libUAirship-1.4.0.a を追加しようとしています。その後、宣言されていない識別子の使用を示すエラーが引き続き表示されます: UAirshipTakeOffOptionsLaunchOptionsKey、UAirship、UAPush。

- (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;
}
4

2 に答える 2

2

シンボルを使用できるようにするには、ライブラリに関連付けられたヘッダー ファイルを #import する必要があります。このライブラリでは、ソース ファイルの先頭に次を追加する必要があると思います。

#import "UAirship.h"
#import "UAPush.h"
于 2013-02-28T11:18:59.143 に答える
1

ヘッダー検索パスを設定する方法のさまざまなバリエーションを見てきました。私にとっては、これでうまくいきました。Airship フォルダーはプロジェクトと同じレベルにあります。

$(PROJECT_DIR)/Airship
于 2014-08-05T11:22:12.370 に答える