我有一个实现 refreshData 方法的 ViewController
在这个 ViewController 中,我添加了一个子视图,如下所示:
/* MainPageViewController.m
//===============================================================================
*/
#import "MainPageViewController.h"
#import "SubViewController1.h"
@implementation Drink4UMainPageViewController
SubViewController1 *subViewController1;
......
-(void)currentChatButtonMethod;
{
subViewController1 = [[SubViewController1 alloc]
initWithNibName:@"SubViewController1"
bundle:nil];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:subViewController1];
[self.view addSubview:navController.view];
// viewController.
CGRect rect = navController.view.frame;
CGPoint origin = CGPointMake(320, -10);
rect.origin = origin;
navController.view.frame = rect;
//----------------------------------------------------------------------
// Use a transform to slide it on.
//----------------------------------------------------------------------
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
navController.view.transform = CGAffineTransformMakeTranslation(-320, -10);
[UIView commitAnimations];
}
-(void) refreshData
{
// CODE
}
从这里我如何在“MainPageViewController”中调用“refreshData”方法?
/*
// SubViewController1.m
=========================================================================================
*/
#import "SubViewController1.h"
#import <UIKit/UIKit.h>
#import "MainPageViewController.h"
@interface SubViewController1 : UIViewController <UITableViewDelegate, UITableViewDataSource, UINavigationControllerDelegate, UIAlertViewDelegate>
{
From here how can i call "refreshData" method in "MainPageViewController " ?
}
@end;
我正在将 Mainviewcontroller 中的子视图添加到 UINavigationController 现在我想从 Subviewcontroller1 调用 Mainviewcontroller 中的方法(refreshData)
请帮助我该怎么做