0

I'm using PFLoginViewController and instead of presenting it modally, I am presenting it as a subview so I can have a nice translucent background:

enter image description here

The only issue is that when I select Sign Up, it presents my Sign Up view controller modally which according to my console log, isn't the smartest idea: Presenting view controllers on detached view controllers is discouraged

So what I would like to do is use a separate method for displaying my sign up view controller. I tried this:

[loginView.logInView.signUpButton  addTarget:self action:@selector(presentSignUpView:) forControlEvents:UIControlEventTouchUpInside];

But the original Parse method was being called with my custom method being called in addition. I looked at the docs and there is no delegate method for adding your own custom method so how should I go about doing this?

4

1 回答 1

1

您是否尝试在此处更改“presentSignUpView:”

[loginView.logInView.signUpButton  addTarget:self action:@selector(presentSignUpView:) forControlEvents:UIControlEventTouchUpInside];

对于自定义视图首先创建一个可以调用您以打开自定义视图的函数

-(void)customSignUpViewOpen{
  //Implement your custom view controller code here ..   
}

在添加 .. 之前更新了删除目标

[loginView.logInView.signUpButton  removeTarget:self action:@selector(presentSignUpView:)  forControlEvents:UIControlEventTouchUpInside];

并在你的按钮中调用它,像这样点击

[loginView.logInView.signUpButton  addTarget:self action:@selector(customSignUpViewOpen) forControlEvents:UIControlEventTouchUpInside];
于 2014-07-30T05:47:06.307 回答