- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- (void)jumpToClass:(int)cIndex pageIndex:(int)pIndex {
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
//trick to store pIndex and cIndex
int calc = cIndex*100;
calc = calc + pIndex;
indicator.tag = calc; //trick to store pIndex
[self.view addSubview:indicator];
[indicator bringSubviewToFront:self.view];
[indicator startAnimating];
[NSTimer scheduledTimerWithTimeInterval:0.01
target:self
selector:@selector(asyncJumpToClass:)
userInfo:indicator
repeats:NO];
}
- (void)asyncJumpToClass:(NSTimer*)theTimer {
UIActivityIndicatorView *ind = (UIActivityIndicatorView *)[theTimer userInfo];
int pIndex = ind.tag%100;
int cIndex = ind.tag/100;
// еще 30 строк кода
}