Vijayender Vaddepally Vijayender Vaddepally - 4 years ago 125
iOS Question

Login Error libc++abi.dylib: terminating with uncaught exception of type NSException

Whats happening is that every time I go to click my "Login button" button, the app crashes, its suppose to redirect me to a different view where the user can login with there email and password. I tried many things other users have posted but none of them seem to be working.

Here am using sinch SDK in login after getting succesfully response. my app crashes. if wont i use below code in login section then sinch will not work. so please help me on this

AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate.push registerUserNotificationSettings];
[appDelegate initSinchClient:[saveDefault objectForKey:@"emailId"]];[appDelegate RegisterPushNotification];

thank you in adv

Answer Source

You can use protocol delegate method for this

In Viewcontroller

@protocol LoginVCDelegate <NSObject>

@required -(void) didFinishLogin;

@property (nonatomic,unsafe_unretained) id<LoginVCDelegate>delegate;

 if([self.delegate respondsToSelector:@selector(didFinishLogin)])


     [self.delegate didFinishLogin];                   


In App Delegate

-(void) didFinishLogin
    [self.push registerUserNotificationSettings]; 

    [self initSinchClient:[saveDefault objectForKey:@"emailId"]];

   [self RegisterPushNotification];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download