I am using following method two times for login and sign up. So some times I am getting crash. Here is my code:
- (void)signIn:(NSDictionary *)params {
[[PCUtilities sharedUtilities] showActivityControllerWithMessage:nil inController:self];
[[PCWebServiceManager sharedWebServiceManager] signInWithParameters:params completionHandler:^(id responseObject, NSError *error) {
self.signInBtn.enabled = YES;
// [[PCUtilities sharedUtilities] hideActivityIndicator];
if (error) {
[self forceLogout];
[PCUtilities showAlertWithTitle:nil message:error.localizedDescription cancelButtonTitle:@"OK"];
[[PCUtilities sharedUtilities] hideActivityIndicator];
}else {
PCLoginObject *loginObject = (PCLoginObject *)responseObject;
[self dismissViewControllerAnimated:NO completion:^{
[self performSelector:@selector(handleSignInResponse:) withObject:loginObject afterDelay:0.2];
}];
}
}];
}
In above code I am using this method as two time in two different classes, so if possible can any one help me to change the below line from dismissviewcontroller to presentViewcontroller
[self dismissViewControllerAnimated:NO
completion:^{
[self performSelector:@selector(handleSignInResponse:)
withObject:loginObject
afterDelay:0.2];
}];
I am using above method two times. So according to crash report I need to change any one method to present view controller. I have tried but no success.