2011-02-02 10 views
0

私のアプリが最初に起動すると、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の内部では、私は実際に私はUITabBarControllerのために必要なすべての情報を持っているのUserInfoオブジェクトを、持っています。問題は、UITabViewControllerでこの情報を取得した後、このUserInfoをUITabBarControllerに渡すか、UITabBarController内にあるViewControllerを使用して、このUserInfoにアクセスできるようにすることです。これを行う方法?

私の質問が意味をなさないことを願っています。

+0

私はあなたが望んでいたものが合格しなかったことを恐れています:あなたの質問は意味をなさない:)あなたが達成しようとしていることと起こっていることを明確に述べてください。 –

+0

少し質問を改訂しました。私の指が交差するのを助けてくれることを願っています。 – aherlambang

答えて

0

タブバーコントローラで使用できるUserInfoオブジェクトのインスタンスを持つ必要があります。おそらく指定されたコントローラに移行するたびに、UItabBarController /各ビューコントローラのUserInfoタイプのインスタンス変数に渡します。

編集:実際には、これはビューコントローラに渡す必要があります(カスタムUITabBarControllerサブクラスがないため表示されません)。または、アプリケーション代理人の共有変数を使用して情報と一緒に。

コメント者が言ったように、質問はあまり明確ではなく、私はあなたがしたいことを完全に誤解している可能性があります。

希望に役立ちます。

関連する問題