在里面
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.row==[self.peopleDataController countOfList]){
static NSString *CellIdentifier = @"LastMoreCell";
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ;
moreButton = [[UIButton alloc] initWithFrame:CGRectMake(140, 2, 42, 42)];
[moreButton setImage:[UIImage imageNamed:@"more.png"] forState:UIControlStateNormal];
[moreButton addTarget:self action:@selector(showMoreRows:) forControlEvents:UIControlEventTouchUpInside];
[cell addSubview:moreButton];
return cell;
}
}
-(void) showMoreRows:(id)sender {
MyAuraAppDelegate *delegate = (MyAuraAppDelegate *) [[UIApplication sharedApplication] delegate];
refreshlast = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
refreshSpinner.hidesWhenStopped = YES;
refreshlast.center = CGPointMake([[sender superview] superview].bounds.size.width / 2.0f, [[sender superview] superview].bounds.size.height / 2.0f);
[sender setHidden:YES];
[[sender superview].superview addSubview: refreshSpinner];
[refreshlast startAnimating];
dispatch_queue_t dloadQueue = dispatch_queue_create("People refresh", NULL);
dispatch_async(dloadQueue, ^{
if ([[[GlobalVariable sharedInstance] peopleList] count] >0) {
_peopleDataController = [_peopleDataController initPeopleListWithCoordinate:delegate.locationCoordinate2D auraId:delegate.myToken offset:0];
NSLog(@"eerrrr %d",_peopleDataController.peopleList.count);
// _peopleDataController.peopleList=[[GlobalVariable sharedInstance] peopleList];
for (int i=0; i< [_peopleDataController.peopleList count]; i++) {
[[[GlobalVariable sharedInstance] peopleList ] addObject:[_peopleDataController.peopleList objectAtIndex:i]];
}
_peopleDataController.peopleList =[[GlobalVariable sharedInstance] peopleList] ;
NSLog(@"eerrr33r %d",_peopleDataController.peopleList.count);
}
dispatch_async(dispatch_get_main_queue(), ^{
[self performSelector:@selector(addItem) withObject:nil afterDelay:2.0];
});
});
dispatch_release(dloadQueue);
}
但我的 UIActivityIndicatorView
刷新最后没有显示,你能给我一些线索吗?