Jos*_*lla 2 iphone facebook ios
我正在按照ios教程将Facebook纳入我的应用程序.一切都很顺利,直到我得到关于添加注销按钮的部分.我一直收到一个错误,说明在类型的对象上找不到属性"ViewController".我究竟做错了什么?这是我的appdelegate.m文件中的代码.
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Add the requests dialog button
UIButton *requestDialogButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
requestDialogButton.frame = CGRectMake(40, 150, 200, 40);
[requestDialogButton setTitle:@"Send Request" forState:UIControlStateNormal];
[requestDialogButton addTarget:self
action:@selector(requestDialogButtonClicked)
forControlEvents:UIControlEventTouchUpInside];
[self.viewController.view addSubview:requestDialogButton];
// ...
}
Run Code Online (Sandbox Code Playgroud)
你在标题中声明viewController了类型UIViewController并合成了吗?它看起来你正在做你的工作AppDelegate,我建议反对.你应该在你实现这个viewcontrollers' viewDidLoad:或viewWillAppear:方法.
| 归档时间: |
|
| 查看次数: |
3399 次 |
| 最近记录: |