ios - 在Xcode5 SDK 3.03中进行编译时添加Google Analytics(分析)链接器错误

标签 ios objective-c google-analytics analytics google-analytics-api

我想在我的应用中获取GA。我试图做到这一点:

我使用了适用于iOS v3(​​测试版)的Google Analytics(分析)SDK-https://developers.google.com/analytics/devguides/collection/ios/v3/

我遵循了文档的所有步骤。
也已经尝试过Linker errors when trying to install new Google Analytics 3.0 Beta



在我的AppDelegate.h中

#import <UIKit/UIKit.h>
#import "GAI.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property(nonatomic, strong) id<GAITracker> tracker;
@property (strong, nonatomic) UIWindow *window;

@end


在我的AppDelegate.m中

#import "AppDelegate.h"
#import "GAI.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [GAI sharedInstance].trackUncaughtExceptions = YES;

    // Optional: set Google Analytics dispatch interval to e.g. 20 seconds.
    [GAI sharedInstance].dispatchInterval = 20;

    // Optional: set Logger to VERBOSE for debug information.
    [[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose];

    // Initialize tracker.
    id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-47246605-1"];

    [GAI sharedInstance].optOut = YES;
    [GAI sharedInstance].trackUncaughtExceptions = YES;
    [GAI sharedInstance].dispatchInterval = 0;

    return YES;
}


ViewController.h

#import <UIKit/UIKit.h>
#import "GAI.h"
#import "GAITrackedViewController.h"

@interface ViewController : GAITrackedViewController
@end


ViewController.m

#import "ViewController.h"
#import "GAI.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.screenName = @"Home Screen";

}


我的项目测试的链接:https://www.dropbox.com/s/j3ufrv55xym82nc/TesteAnalytics.zip

最佳答案

Google Analytics(分析)使用CoreData.framework,链接器找不到它。 (NSManagedEntity,NSManagedContext等是CoreData类)

您是否将框架添加到项目中?

关于ios - 在Xcode5 SDK 3.03中进行编译时添加Google Analytics(分析)链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21190706/

相关文章:

ios - 如何在 iOS 8 中使用 inputAccessoryViewController

ios - uniqueIdentifier 与 indentifierForVendor 和 Apple 拒绝

android - 如何使用 Android View Pager + ActionBar 选项卡将 View 发送到 Google Analytics?

iOS UIWebView 加载完成后不会更新其大小

ios - swift 2.0 : How do I specify which Annotation is pressed when having more then one Annotation? 市场

objective-c - NSMutableDictionary 中的编辑条目失败,错误为 : "unrecognized selector sent to instance"

javascript - Handlebars 模板中的谷歌跟踪代码

google-analytics - DAU/MAU Google 数据工作室

ios - 推送通知中的应用程序名称错误 | ios SWIFT

ios - 在高分辨率图像上绘制形状?