tags:

views:

17

answers:

1

hi i am new to iphone application. i am doing an application that consist of image picker and image view. i am displaying the image in imageview by selecting the image in image picker .. what i need is afetr 3 seconds i have to go back imagepicker how can i done this please give code for that

A: 

You want to create an NSTimer object.

NSTimer *theTimer = [NSTimer scheduledTimerWithTimeInterval:3.0
                                                  target:self 
                                                selector:@selector(pictureTimerFired:) 
                                                userInfo:nil
                                                 repeats:NO];

Where the target selector has a signature like:

- (void) pictureTimerFired:(NSTimer*)theTimer {

NSLog(@"Timer fired, closing picture");

}

You would remove the imageView in the opposite way you added it. i.e. it depends if it was added as a modal view or subview etc.

joelm