Tracking events in a for loop

Bronze Contributor
Bronze Contributor
If I do something like this: for (int i = 0; i < 10; i++) { [Tealium trackCallType:TealiumEventCall customData&colon;@{@"someNumber" : @(i)} object:nil]; } Only the first event gets tracked.
1 REPLY 1

Tracking events in a for loop

Employee Emeritus
Recommended solution until next library version: for (int i = 0; i < 10; i++) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(i * NSEC_PER_SEC * 0.3)), dispatch_get_main_queue(), ^{ [Tealium trackCallType:TealiumEventCall customData&colon;@{@"someNumber" : @(i)} object:nil]; }); } Answer also available in library repo: issues section
Public