當我的應用第一次啓動時,它會顯示一個登錄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