Skip to content

Instantly share code, notes, and snippets.

@mogeta
Created May 2, 2012 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mogeta/2573805 to your computer and use it in GitHub Desktop.
Save mogeta/2573805 to your computer and use it in GitHub Desktop.
performSelector:withObject:afterDelay recursive call
- (void)advTimeKeeper:(NSNumber * )param{
[NSThread sleepForTimeInterval:0.1];
[self performSelectorInBackground:@selector(progress:)
withObject:[NSNumber numberWithFloat:[param floatValue]]];
if([param floatValue]<1.0){
[self performSelector:@selector(advTimeKeeper:)
withObject:[NSNumber numberWithFloat:([param floatValue]+0.03125)]];
           //not work afterDelay
}
}
@mogeta
Copy link
Author

mogeta commented May 2, 2012

UIProgressViewを3秒かけて1にしたい。っていう処理を再起呼び出しするときにちょい手こずり。
afterDelayがうまく動かず。NSThreadで対処。autorelease的なことされてる?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment