Pugalmuni
Pugalmuni

Reputation: 9390

How to delay to load the button on image view in iphone

I am new to iphone development. I have created a view controller and sets the button on the view. On clicking the button, it navigates to the next view and loaded the image in the view. Now i want to display the button on after loaded the image. The button will be shown after 3 seconds on the image view.

Please help me out,

Thanks.

Upvotes: 1

Views: 407

Answers (2)

Warrior
Warrior

Reputation: 39384

Use NSTimer

In viewDidLoad

[NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(updateCounter:) userInfo:nil repeats:NO];

create a "updateCounter" custom method to display the button

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

display the button here...
}

All the Best.

Upvotes: 2

TechZen
TechZen

Reputation: 64428

You need to use a NSTimer.

When the view loads, set the timer for 3 seconds and configure it to evoke a custom method of the view controller. That method should add the button to the view.

Upvotes: 1

Related Questions