I’m stuck wringing to change the view by a segue after the user presses a button in a uiallertview.
This is what i have so far:
- (void)viewDidLoad
{
[bericht setEditable:NO];
[bericht setUserInteractionEnabled:NO];
[super viewDidLoad];
Reachability *r = [Reachability reachabilityWithHostName:@"www.google.com"];
NetworkStatus internetStatus = [r currentReachabilityStatus];
if ((internetStatus == ReachableViaWiFi) || (internetStatus == ReachableViaWWAN)){
dispatch_async(kBgQueue, ^{
NSData* data = [NSData dataWithContentsOfURL:kJsonURL];
[self performSelectorOnMainThread:@selector(fetchedData:) withObject:data waitUntilDone:YES];
});
} else {
UIAlertView *geenInternet = [[UIAlertView alloc] initWithTitle:@"Geen Internet" message:@"Voor het gebruik van deze app is een internet verbinding nodig. Momenteel bent u niet verbonden met het internet. Probeer het later nog eens." delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[geenInternet show];
}
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 0) {
[self preformSegueWithIdentifier:@"geenInternetSegue" sender:self];
} else {
NSLog(@"Dafaqu?");
}
}
The [self preformSegueWithIdentifier:@"geenInternetSegue" sender:self]; part doesn’t work. anny toughts on how i can fix this?
Tnx
I believe the correct method call is:
You flipped the e and the r in perform.