小编Jos*_*lla的帖子

在appdelegate.m文件中找不到viewcontroller

我正在按照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)

iphone facebook ios

2
推荐指数
1
解决办法
3399
查看次数

标签 统计

facebook ×1

ios ×1

iphone ×1