Я обычно использую шаблон делегата. Как:
@class FilterViewController;
@protocol FilterViewControllerDelegate
@required
- (void)filterViewController:(FilterViewController *)controller didSelectFilters:(NSInteger)filters;
@end
@interface FilterViewController : UIViewController {
id<FilterViewControllerDelegate> _delegate;
}
@property (nonatomic, assign) id<FilterViewControllerDelegate> delegate;
@end
и в вашем FirstViewController
:
-(void) onFilter
{
FilterViewController* controller =[[[FilterViewController alloc] initWithNibName:@"Filter" bundle:[NSBundle mainBundle]] autorelease];
controller.delegate = self;
[self.navigationController presentModalViewController:controller animated:YES];
}
- (void)filterViewController:(FilterViewController *)controller didSelectFilters:(NSInteger)filters {
// Do something
}
В вашем FilterViewController
вызовите - (void)filterViewController:(FilterViewController *)controller didSelectFilters:(NSInteger)filters
делегата, прежде чем отклонить его.