In my iPhone app, I have two UIViewcontroler class firstView and secondView.
From the firstView, I am presenting secondView using presentModalViewController:animated: method.
Problem is that when I am dismissing secondView, I want to hide button in firstView.
Although It does execute the code in firstView [button setHidden:YES];, but still it does not hide the button.
What could be wrong?
Hope you have declared property and synthesized the IBOutlet
button.Make an object of FirstViewController in SecondViewController.h and property and synthesize it.
SecondViewController.h
SecondViewController.m
Now when you present a modal view from firstView
FirstViewController.m
Now in SecondViewController where you dismiss SecondViewController just add this code.
SecondViewController.m
EDIT:
Refer to this link:
@protocol implementation in @interface in Objective-C
EDIT-2: With Protocol implementation
SecondViewController.h
SecondViewController.m
Now when you present a modal view from firstView
FirstViewController.h
FirstViewController.m
Now in SecondViewController where you dismiss SecondViewController just add this code.
SecondViewController.m
Let me know if you need more help on this.
Hope this helps.