[問題] Delegate 問題

作者: mew3133 (SeanCheng)   2014-02-13 12:17:37
請問一下..
我有一個Viewcontroller &Delegate
APPDelegate.h 宣告
#import <UIKit/UIKit.h>
#import "View1Controller.h"
@interface TDAppDelegate : UIResponder <UIApplicationDelegate,
UISplitViewControllerDelegate>
@property(strong,nonatomic)View1Controller *TDController;
我該怎麼指定TDController 為當下的View1Controller呢?
在View1Controller.m
-(void)viewDidLoad{
TDAppDelegate *TDAppdelegateView;
TDAppdelegateView.TDController=self;
}
我這樣寫好像指不過去QQ.....
作者: atst2 (atst2)   2014-02-13 12:22:00
[UIApplication sharedApplication].delegate =.view=self;打太快,delegate.view = 你的view如果是你自己定義的viewcontroller變數也是一樣.
作者: mew3133 (SeanCheng)   2014-02-13 15:39:00
謝謝~成功了多學到一招了

Links booklink

Contact Us: admin [ a t ] ucptt.com