i 奥贝吉斯·塞特是新的,因此,如果这是一个简单的问题,请原谅我。 i 试图从Facebook IOS整合辅导处获得以下代码,但一线有误。
- (void) logoutButtonClicked:(id)sender {
[facebook logout];
我发现错误。
“使用未申报的识别标志”标志 ButtonClicked. 我知道,这就是说,我正在执行一种没有界定的方法。 因此,我的问题是,下面的法典中正在界定哪些方法?
i have seen a solution here posted but it does not work for me, this error persists. I have tried alternatives to try and fix, but could some one please confirm what this block of code is doing.
My understanding is that, we start of creating a pointer (logoutButton) to UIButton, and we then set the parameters of it. We then use a selector to define an action message (LogoutButtonClicked), for the method UIControlEventTouchInside.
我并不完全理解如何宣布这一方法,因为我认为这里的行文是界定理由方法的:
-(void) logoutButtonClicked:(id)sender {
[facebook logout];
或者,正在宣布的方法
[logoutButton addTarget:self action:@selector(logoutButtonClicked)
forControlEvents:UIControlEventTouchUpInside];
// Add the logout button
UIButton *logoutButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
logoutButton.frame = CGRectMake(40, 40, 200, 40);
[logoutButton setTitle:@"Log Out" forState:UIControlStateNormal];
[logoutButton addTarget:self action:@selector(logoutButtonClicked)
forControlEvents:UIControlEventTouchUpInside];
[self.viewController.view addSubview:logoutButton];
// Method that gets called when the logout button is pressed
- (void) logoutButtonClicked:(id)sender {
[facebook logout];
}
我真的会赞赏有人在这样做时提供帮助,他们一直在努力理解这一点。
Melvin