Search code examples
iosiphoneios6storyboard

I want to add waitview in same view using storyboard


I have created a view in same view controller. And just need to set hidden true or false.

Here is my code.

- (void)addWaitView
{
    [self.view bringSubviewToFront:loadView];
    [loadView setHidden:NO];

}

- (void)removeWaitView
{
    [loadView setHidden:YES];
}

- (IBAction)actionUpdate:(id)sender {

    NSLog(@"actionUpdate");

    [self addWaitView];
    [self performSelector:@selector(callAllMethods) withObject:nil afterDelay:0.0];

}

The method is called, addWaitView, but can not see the waitview in view. the view is attached from IBOutlet

IBOutlet UIView *loadView;

to call remove waitview, I use the code below in my method

[self performSelectorOnMainThread:@selector(removeWaitView) withObject:Nil waitUntilDone:NO];

Need help


Solution

  • I got the solution, after so much confusion,

    All need to set "Restoration ID" in storyboard same as named in IBOutlet

    Set

    [self performSelector:@selector(callAllMethods) withObject:nil afterDelay:0.2];
    

    Now its working fine.