Solved

Segue not being performed iOS

Posted on 2012-03-21
1
1,046 Views
Last Modified: 2012-06-21
I've got an iOS app that allows a user to connect to our server and perform a couple tasks. It works great until I decided to throw an error in and make it go back to the previous view controller. I created a segue with the Identifier of "segShowError" that is supposed to be executed and send the user back to the parent screen. Currently the segue is a Modal, as is the one that goes from the first controller to the second one. The odd part is I was experiencing this same difficulty earlier when I was using a push segue and I fixed it by using a Modal instead. Here is the code that "should" be performing the segue.

NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
if(error != nil)
{
    NSLog(@"Error was %@",error);
    return;
}
else if([data length] <= 0)
{
    NSLog(@"No data received, going back");
    [self performSegueWithIdentifier:@"segShowError" sender:self];
}

Open in new window


And then I have a prepareForSegue method, it will determine what error message to send back to the parent, but right now just logs a message.

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    NSLog(@"Preparing for segue");
}

Open in new window


My output

2012-03-21 13:14:39.148 SSPColorImprov[17401:f803] No data received, going back

2012-03-21 13:14:39.149 SSPColorImprov[17401:f803] Preparing for segue

Open in new window


I would think that those two messages would indicate that the segue is being performed, but I could be wrong.

There are no errors logged, no warnings in the project, and no exceptions thrown. Any ideas what might be causing the problem?
0
Comment
Question by:HDM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
HDM earned 0 total points
ID: 37753528
I used dismissViewControllerAnimated rather than using a segue to get back to the parent view, which works great.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface   In the first 100 days of the Macintosh release in January 1984, Apple sold 72,000 of the computers. Relatively cheap, easy-to-use personal computer with a graphical operating system. I've never seen this model. I did see this one:   …
Ever wanted to watch videos in your computer from the bed without the need of standing up and shutting down the computer?  Is your computers operating system Windows XP, Windows Vista or Windows 7?  Do you own a iOS device? If all the answers were y…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question