난 건반이 performSegueWithIdentifier:
에 의해 천천히 호출되지만 트리거하지 않습니다. 그러나, 버튼 누름으로 segue를 만들면 segue가 문제없이 작동합니다. 또한 코드에서 내 segue의 이름을 변경하려고 시도했으며 오류가 no segue with identifier
입니다. 여기 건방진 수행하지 않음
#import "SignUpViewController.h"
#import "ProgressHUD.h"
@interface SignUpViewController()
@end
@implementation SignUpViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self performSegueWithIdentifier:@"profilePic" sender:self];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
- (IBAction)createAnAccount:(id)sender {
[ProgressHUD show:@"Please Wait"];
if ([self.passwrod.text isEqualToString:self.confirmPassword.text]){
// Register User
PFUser *user = [PFUser user];
user.username = self.username.text;
user.password = self.passwrod.text;
user.email = self.eMail.text;
// other fields can be set if you want to save more information
NSString *name = [self.firstName.text stringByAppendingString:@" "];
NSString *fullName = [name stringByAppendingString:self.lastName.text];
user[@"name"] = fullName;
user[@"posts"] = @0;
user[@"score"] = @5;
user[@"followers"] = @0;
user[@"following"] = @0;
[user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if (!error) {
// Hooray! Let them use the app now.
[self performSegueWithIdentifier:@"profilePic" sender:self];
[ProgressHUD showSuccess:nil];
NSLog(@"Perform Segue");
} else {
NSString *errorString = [error userInfo][@"error"];
// Show the errorString somewhere and let the user try again.
[ProgressHUD showError:errorString];
}
}];
} else {
// Alert User
[ProgressHUD showError:@"Please check your passwords as they do not match."];
}
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSLog(@"Preparing for segue");
NSLog(@"Segue: %@", segue.identifier);
}
@end
업데이트 : prepareForSegue
메서드가 호출되고 있으며, 벌채 반출.
도움 주셔서 감사합니다.
IB에서 segue 식별자의 이름을 지정하지 않았기 때문에 오류가 발생합니다. 여기를 참조하십시오 (http://stackoverflow.com/questions/25020866/receiver-has-no-segue-with-identifier-when-identifier-exists) 그리고 만약 당신이 식별자를 가지고 있다면 VC – soulshined