I’m writing an objective-c program that does some calculations based on time and will eventually updates UILabels each second.
To explain the concept here’s some simplified code, which I’ve placed into the viewDidLoad of the class that handles the view.
- (void)viewDidLoad {
[super viewDidLoad];
// how do i make this stuff happen AFTER the view has loaded??
int a = 1;
while (a < 10) {
NSLog(@"doing something");
a = a + 1;
sleep(1);
}
}
My problem is that the code halts the loading of the view until the loop is all complete (in this case 10 seconds).
Where should I put code that I want to fire AFTER the view has finished loading?
newbie question I know =/