【发布时间】:2014-09-10 18:36:49
【问题描述】:
我正在创建一个需要登录或注册的 an。目前,登录和注册都是在主注销屏幕上的弹出视图中执行的。
因此,我需要触发一个 segue,以便在与我的弹出视图控制器不同的视图控制器中执行。这如何和/或这可能?
这是我在“registerViewController”(弹出视图)中的注册码,我想执行从“loggedOutViewController”到“mainViewController”(登录视图)的转换。
registerViewController.m:
- (void) registerNewUser {
PFUser *newUser = [PFUser user];
newUser.email = _emailField.text;
newUser.username = _usernameField.text;
newUser.password= _passwordField.text;
newUser[@"name"] = _nameField.text;
[newUser signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if (!error) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Success" message:@"Registration Successful" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
//Where I need to call the segue
} else {
NSString *errorString = [error userInfo][@"error"];
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Oops" message:errorString delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
}
}];
抱歉,如果有人问过这个问题,我无法在任何地方找到解决问题的方法,如果您想/需要更多信息或代码,请告诉我。
【问题讨论】:
-
请显示有问题的代码。没有代码,没有讨论。 ;)
-
代码本身并没有真正的问题,因为我不知道如何去做。我会看看我可以发布什么。
标签: objective-c xcode ipad segue popover