当我的应用第一次启动时,它会显示一个登录Facebook的主页面。然后,它进入UITabBarController
。我有我的应用程序委托,代码如下:将Facebook上的信息传递给UITabBarController
//this is the .h
@interface NMeAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
MainViewController *controller;
UITabBarController *tabBar;
}
@property (nonatomic, retain) IBOutlet UITabBarController *tabBar;
@property (nonatomic, retain) MainViewController *controller;
@property (nonatomic, retain) IBOutlet UIWindow *window;
@end
//this is the .m of the app delegate
#import "NMeAppDelegate.h"
@implementation NMeAppDelegate
@synthesize window;
@synthesize tabBar;
@synthesize controller;
#pragma mark -
#pragma mark Application lifecycle
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
controller = [[MainViewController alloc] init];
[window addSubview:tabBar.view];
[window addSubview:controller.view];
[window makeKeyAndVisible];
return YES;
}
里面的MainViewController
,其实我有一个的UserInfo对象,它拥有所有我需要的的UITabBarController的信息。问题是,在UITabViewController
中获取此信息后,如何将此UserInfo传递给UITabBarController`或可能位于UITabBarController内部的ViewController,以便他们能够访问此UserInfo?这个怎么做?
我希望我的问题有道理。
恐怕你所希望的没有成为现实:你的问题没有道理:)请清楚地说明你正在努力达到的目标以及正在发生的事情。 – 2011-02-02 23:19:56