"Give the user some feedback that the something is happening (We will be called back asynchronously)"

Mon 11 May 2009

// Make sure we give the user some feedback that the resolve is happening.

// We will be called back asynchronously, so we don't want the user to think

// we're just stuck.

self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(showWaiting:) userInfo:self.currentResolve repeats:NO];

 
 

// If necessary, sets up state to show an activity indicator to let the user know that something is occuring.

- (void)showWaiting:(NSTimer*)timer {

if (timer == self.timer) {

//place spinner somwhere

CGRect frame = CGRectMake(0.0, 0.0, kProgressIndicatorSize, kProgressIndicatorSize);

UIActivityIndicatorView* spinner = [[UIActivityIndicatorView alloc] initWithFrame:frame];

[spinner startAnimating];

spinner.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;

[spinner sizeToFit];

spinner.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin |

UIViewAutoresizingFlexibleRightMargin |

UIViewAutoresizingFlexibleTopMargin |

UIViewAutoresizingFlexibleBottomMargin);

cell.accessoryView = spinner;

[self.view addSubview:spinner];

[spinner release];

}

 

}