Hi, I am trying to load a new view form an alertView button, I am catching the button click fine as I see my NSLog coming from the method the button instantiates.
However I'm just abit lost as to how to get the new view to load... Mainly because I'm doing a few things I haven't done before like creating my own classes I call from others in an attempt to keep my code clean and transportable...
basically I have one NSObject (pingConnection) that is being called from my appDelegate as soon as the app starts, that sends a request to the server gets a reply and depending on the reply code I get back I do one of several different alertViews I have set in my (alerts) class.
Then when my alert is on screen and in this instance the button titled OK is pressed by the user which will then be used to load a new view, heres the part where I try and load my new view
I'm not getting any errors but the view is not loading.. I just have no idea why not as I have limited experience with objective C, if someone has any ideas on this I would be greatfull if you could share with me.
However I'm just abit lost as to how to get the new view to load... Mainly because I'm doing a few things I haven't done before like creating my own classes I call from others in an attempt to keep my code clean and transportable...
basically I have one NSObject (pingConnection) that is being called from my appDelegate as soon as the app starts, that sends a request to the server gets a reply and depending on the reply code I get back I do one of several different alertViews I have set in my (alerts) class.
Then when my alert is on screen and in this instance the button titled OK is pressed by the user which will then be used to load a new view, heres the part where I try and load my new view
Code:
- (void)pleaseRegisterDevice {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Please Register Device"
message:@"click OK to register"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert autorelease];
[alert show];
}
//Catch pleaseRegisterDevice method
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
NSString *buttonTitle=[alertView buttonTitleAtIndex:buttonIndex];
if ([buttonTitle isEqualToString:@"OK"]) {
NSLog(@"msg from alertView method");
//open new window
registerDeviceViewController *_regDevice = [[registerDeviceViewController alloc] initWithNibName:@"registerDeviceViewController" bundle:nil];
[_regDevice.navigationController pushViewController:_regDevice animated:YES];
[_regDevice release];
_regDevice = nil;
}
else {
NSLog(@"didnt work");
}
}
I'm not getting any errors but the view is not loading.. I just have no idea why not as I have limited experience with objective C, if someone has any ideas on this I would be greatfull if you could share with me.
Last edited: