0

我正在尝试在 iOS 中实现 Parse 平台登录向导

更多信息在这里

这是我们需要添加到ViewDidAppearParse Login Modal 的代码。(在为界面设置正确的代表之后:) PFLogInViewControllerDelegate, PFSignUpViewControllerDelegate

PFLogInViewController *login = [[PFLogInViewController alloc] init];

login.fields = PFLogInFieldsUsernameAndPassword | PFLogInFieldsLogInButton | PFLogInFieldsFacebook | PFLogInFieldsSignUpButton | PFLogInFieldsPasswordForgotten;

login.signUpController = [[SignUpViewController alloc] init];
login.signUpController.delegate =self;
login.delegate = self;

[self presentModalViewController:login animated:YES];
[login release];

我们可以通过这种方式访问​​按钮:

login.logInView.facebookButton

我可以使用选择器来做到这一点:

 [facebookBtn addTarget:self action:@selector(buttonInfo:) forControlEvents:UIControlEventTouchUpInside];

并添加我自己的操作,但默认操作仍然有效。我不想有这个默认操作。

我想要的是,完全覆盖这个按钮。你能帮助我吗?

4

1 回答 1

0

调用 removeTarget:action:forControlEvents:为目标传递 nil,为操作传递 NULL,并使用设置所有位的控制掩码 (UIControlEventAllEvents)。像这样的东西:

[facebookBtn removeTarget:nil 
                   action:NULL 
         forControlEvents:UIControlEventAllEvents]; 
于 2012-10-20T12:04:25.530 回答