在iOS中实现谷歌分析错误。

时间:2022-07-07 15:17:59

I am trying to add Google Analytics to my iOS app. I have added all the right frameworks to Xcode. I followed through the SDK v3 startup guide. But when I added:

我正在尝试将谷歌分析添加到我的iOS应用中。我已经在Xcode中添加了所有合适的框架。我遵循了SDK v3启动指南。但是当我说:

self.trackedViewName = @"About Screen";

to my viewcontroller, I got an error saying

对我的视图控制器,我有一个错误的说法

Property trackedViewName not found on object of type ViewController

属性trackedViewName类型为ViewController的对象上没有找到

On my .h file, I imported GAITrackedViewController.h and added GAITrackedViewController to the interface.

在我的。h文件中,我导入了GAITrackedViewController。将GAITrackedViewController添加到接口中。

What do you think the problem could be?

你认为问题可能是什么?

3 个解决方案

#1


8  

You can try screenName instead of trackedViewName

您可以尝试使用screenName而不是trackedViewName

self.screenName = @"About Screen";

This solved my issue.

这解决了我的问题。

#2


1  

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@protocol GAITracker;
@interface GAITrackedViewController : UIViewController {
@private
    id<GAITracker> tracker_;
    NSString *trackedViewName_;
}
@property(nonatomic, assign)id<GAITracker> tracker;
@property(nonatomic, copy)NSString *trackedViewName;
@end

Paste this code on GAITrackedViewController.h file.
Then you can use self.trackedName = @"Some Name"; easly.

在GAITrackedViewController上粘贴此代码。h文件。然后你可以用self。trackedName = @“名称”;易。

#3


1  

Check the answer from here: https://developers.google.com/analytics/devguides/collection/ios/v3/migration

从这里查看答案:https://developers.google.com/analytics/devguides/collection/ios/v3/migration。

Users of Automatic Screen Tracking should replace references to GAITrackedViewController.trackedViewName with GAITrackedViewController.screenName.

自动屏幕跟踪用户应该替换对GAITrackedViewController的引用。trackedViewName GAITrackedViewController.screenName。

#1


8  

You can try screenName instead of trackedViewName

您可以尝试使用screenName而不是trackedViewName

self.screenName = @"About Screen";

This solved my issue.

这解决了我的问题。

#2


1  

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@protocol GAITracker;
@interface GAITrackedViewController : UIViewController {
@private
    id<GAITracker> tracker_;
    NSString *trackedViewName_;
}
@property(nonatomic, assign)id<GAITracker> tracker;
@property(nonatomic, copy)NSString *trackedViewName;
@end

Paste this code on GAITrackedViewController.h file.
Then you can use self.trackedName = @"Some Name"; easly.

在GAITrackedViewController上粘贴此代码。h文件。然后你可以用self。trackedName = @“名称”;易。

#3


1  

Check the answer from here: https://developers.google.com/analytics/devguides/collection/ios/v3/migration

从这里查看答案:https://developers.google.com/analytics/devguides/collection/ios/v3/migration。

Users of Automatic Screen Tracking should replace references to GAITrackedViewController.trackedViewName with GAITrackedViewController.screenName.

自动屏幕跟踪用户应该替换对GAITrackedViewController的引用。trackedViewName GAITrackedViewController.screenName。