0

GAIDictionaryBuilder set forKey:GAISessionControl 错误读取:值的键表示它不符合代码。

GAIDictionaryBuilder *dictionary = [GAIDictionaryBuilder createEventWithCategory:@"UX" action:@"App started" label:nil value:nil];
[dictionary setValue:@"start" forKey:kGAISessionControl];
[[GAI sharedInstance].defaultTracker send:dictionary.build];

我直接从他们的网站关注谷歌的文档,但仍然不知道错误来自哪里?https://developers.google.com/analytics/devguides/collection/ios/v3/migration#setting-data

4

1 回答 1

0

谷歌分析文档有一个错误(像往常一样)。我通过用“set:”替换“setValue:”来消除错误

来自:[字典 setValue:@"start" forKey:kGAISessionControl];

to:[字典集:@“start”forKey:kGAISessionControl];

现在完美运行。

GAIDictionaryBuilder *dictionary = [GAIDictionaryBuilder createEventWithCategory:@"UX" action:@"App started" label:nil value:nil];
[dictionary setValue:@"start" forKey:kGAISessionControl];
[[GAI sharedInstance].defaultTracker send:dictionary.build];
于 2013-08-29T17:51:42.323 回答