In your view controller make sure you implement the UIAlertViewDelegate
protocol
@interface MyCarsViewController () <UIAlertViewDelegate>
and then add this method:
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
to the view controller. This is where you can get a reference to the text fields in the alert and do your db check etc. To get a reference to the text fields use
textFieldAtIndex:
After you check for the correct login you can present other view controllers or display another alert depending on the login results.
Hoep this helps