0

It is very long method and it got a bit messed up trying to cut it out so StackOverflow allows me to post so much.

StatsViewController prepareForSegue method:

`-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { //stat1 data... COMPLETE if ([segue.identifier isEqualToString:@"stat1Seg"]) {

    CiteViewController *citeScreen = [segue destinationViewController];

    citeScreen.citeWhichStat = @"1";

    if ([statWhichTopic isEqualToString:@"abortion"]) {
        citeScreen.strMLA = @"Mantel, Barbara. \"Abortion.\" CQ Researcher 19 May 2015. Web. 4 Mar. 2016.";
        citeScreen.strAPA = @"Mantel, B. (2015, May 19). Abortion. CQ Researcher. Retrieved from http://library.cqpress.com.ezaccess.libraries.psu.edu/";

        citeScreen.citeWhichTopic = @"abortion";
    }
    else if ([statWhichTopic isEqualToString:@"agriculture"]) {
        citeScreen.strMLA = @"\"Nitrogen.\" CropNutrition.com. The Mosaic Company, 2013. Web. 30 Apr. 2016.";
        citeScreen.strAPA = @"CropNutrition.com. (2013). Nitrogen. Retrieved April 30, 2016, from http://www.cropnutrition.com/efu-nitrogen#overview";

        citeScreen.citeWhichTopic = @"agriculture";
    }
    else if ([statWhichTopic isEqualToString:@"climateChange"]) {
        citeScreen.strMLA = @"\"Causes of Climate Change.\" EPA: United States Environmental Protection Agency, 23 Feb. 2016. Web. 12 Apr. 2016.";
        citeScreen.strAPA = @"EPA. (2016, February 23). Causes of Climate Change. Retrieved April 12, 2016, from https://www3.epa.gov/climatechange/science/causes.html";

        citeScreen.citeWhichTopic = @"climateChange";
    }
    else if ([statWhichTopic isEqualToString:@"cybersecurity"]) {
        citeScreen.strMLA = @"\"Top Cybersecurity Statistics for 2016 - Cyber Security Marketing Blog.\" Cyber Security Marketing Blog. Penguin Strategies, 17 Jan. 2016. Web. 16 Apr. 2016.";
        citeScreen.strAPA = @"Penguin Strategies. (2016, January 17). Top Cybersecurity Statistics for 2016 - Cyber Security Marketing Blog. Retrieved April 16, 2016, from http://www.marketingcybersecurity.com/2016-cybersecurity-statistics/";

        citeScreen.citeWhichTopic = @"cybersecurity";
    }
    else if ([statWhichTopic isEqualToString:@"discrimination"]) {
        citeScreen.strMLA = @"Logan, John R. \"Separate and Unequal: The Neighborhood Gap for Blacks, Hispanics and Asians in Metropolitan America.\" (n.d.): n. pag. Report0727. US2010: Discover America in a New Century, July 2011. Web. 22 Apr. 2016.";
        citeScreen.strAPA = @"Logan, J. R. (2011, July). Separate and Unequal: The Neighborhood Gap for Blacks, Hispanics and Asians in Metropolitan America. Retrieved April 22, 2016, from http://www.s4.brown.edu/us2010/Data/Report/report0727.pdf";

        citeScreen.citeWhichTopic = @"discrimination";
    }
    else if ([statWhichTopic isEqualToString:@"education"]) {
        citeScreen.strMLA = @"\"Fast Facts- Career and Technical Education.\" National Center for Education Statistics. U.S. Department of Education, Institute of Education Sciences, n.d. Web. 27 Apr. 2016.";
        citeScreen.strAPA = @"National Center for Education Statistics. (n.d.). Fast Facts- Career and technical education. Retrieved April 27, 2016, from https://nces.ed.gov/fastfacts/display.asp?id=43";

        citeScreen.citeWhichTopic = @"education";
    }
    else if ([statWhichTopic isEqualToString:@"energy"]) {
        citeScreen.strMLA = @"\"India's Crude Oil Imports Rose 7% in 2015-16 as Consumption Grew by 11%.\"Enerdata. Enerdata, 22 Apr. 2016. Web. 29 Apr. 2016.";
        citeScreen.strAPA = @"Enerdata. (2016, April 22). India's crude oil imports rose 7% in 2015-16 as consumption grew by 11%. Retrieved April 29, 2016, from http://www.enerdata.net/enerdatauk/press-and-publication/energy-news-001/indias-crude-oil-imports-rose-7-2015-16-consumption-grew-11_36906.html";

        citeScreen.citeWhichTopic = @"energy";
    }
    else if ([statWhichTopic isEqualToString:@"gunControl"]) {
        citeScreen.strMLA = @"Fingerhut, Hannah. \"5 Facts about Guns in the United States.\" Pew Research Center- Fact Tank: News in the Numbers. Pew Research Center, 05 Jan. 2016. Web. 28 Apr. 2016.";
        citeScreen.strAPA = @"Fingerhut, H. (2016, January 05). 5 facts about guns in the United States. Retrieved April 28, 2016, from http://www.pewresearch.org/fact-tank/2016/01/05/5-facts-about-guns-in-the-united-states/";

        citeScreen.citeWhichTopic = @"gunControl";
    }
    else if ([statWhichTopic isEqualToString:@"internet"]) {
        citeScreen.strMLA = @"\"Internet Live Stats - Internet Usage & Social Media Statistics.\" Internet Live Stats - Internet Usage & Social Media Statistics. InternetLiveStats.com, n.d. Web. 21 Apr. 2016.";
        citeScreen.strAPA = @"InternetLiveStats.com. (n.d.). Internet Live Stats - Internet Usage & Social Media Statistics. Retrieved April 21, 2016, from http://www.internetlivestats.com/";

        citeScreen.citeWhichTopic = @"internet";
    }
    else if ([statWhichTopic isEqualToString:@"marijuana"]) {
        citeScreen.strMLA = @"\"Marijuana Stats.\" Caron. Caron Treatment Centers, 2016. Web. 30 Apr. 2016.";
        citeScreen.strAPA = @"Caron Treatment Centers. (2016). Marijuana Stats. Retrieved April 30, 2016, from http://www.caron.org/understanding-addiction/statistics-outcomes/marijuana-stats";

        citeScreen.citeWhichTopic = @"marijuana";
    }
    else if ([statWhichTopic isEqualToString:@"overpopulation"]) {
        citeScreen.strMLA = @"Hetzel, Lisa, and Annetta Smith. \"65 Years and Over Population: 2001.\" Google Books. Diane Publish Co., 2008. Web. 10 Apr. 2016.";
        citeScreen.strAPA = @"Hetzel, L., & Smith, A. (2008). 65 Years and Over Population: 2001. Retrieved April 10, 2016, from https://books.google.com/books?id=Gndl_pIhnZkC";

        citeScreen.citeWhichTopic = @"overpopulation";
    }
    else if ([statWhichTopic isEqualToString:@"police"]) {
        citeScreen.strMLA = @"USA.gov. \"Uniform Crime Reports- Detailed Assault Data.\" FBI- The Federal Bureau of Investigation. U.S. Government, U.S. Department of Justice, 2014. Web. 29 Apr. 2016.";
        citeScreen.strAPA = @"FBI. (2014). Uniform Crime Reports- Detailed Assault Data. Retrieved April 29, 2016, from https://www.fbi.gov/about-us/cjis/ucr/leoka/2014/detailed-assault-topic-page-summaries";

        citeScreen.citeWhichTopic = @"police";
    }
    else if ([statWhichTopic isEqualToString:@"pornography"]) {
        citeScreen.strMLA = @"\"Pornhub’s 2015 Year in Review.\" Pornhub Insights. Pornhub, 2016. Web. 19 Apr. 2016.";
        citeScreen.strAPA = @"\"Pornhub’s 2015 Year in Review.\" Pornhub Insights. Pornhub, 2016. Web. 19 Apr. 2016.";

        citeScreen.citeWhichTopic = @"pornography";
    }
    else if ([statWhichTopic isEqualToString:@"prison"]) {
        citeScreen.strMLA = @"Savage, Charlie. \"Justice Dept. Seeks to Curtail Stiff Drug Sentences.\" The New York Times. The New York Times, 11 Aug. 2013. Web. 20 Apr. 2016.";
        citeScreen.strAPA = @"Savage, C. (2013). Justice Dept. Seeks to Curtail Stiff Drug Sentences. Retrieved April 20, 2016, from http://www.nytimes.com/2013/08/12/us/justice-dept-seeks-to-curtail-stiff-drug-sentences.html?pagewanted=all";

        citeScreen.citeWhichTopic = @"prison";
    }
    else if ([statWhichTopic isEqualToString:@"rape"]) {
        citeScreen.strMLA = @"\"Facts & Quotes: Statistics.\" Rape Treatment Center | Santa Monica | UCLA Medical Center. Rape Treatment Center, n.d. Web. 18 Apr. 2016.";
        citeScreen.strAPA = @"Rape Treatment Center. (n.d.). Facts & Quotes: Statistics. Retrieved April 18, 2016, from http://www.911rape.org/facts-quotes/statistics";

        citeScreen.citeWhichTopic = @"rape";
    }
    else if ([statWhichTopic isEqualToString:@"religion"]) {
        citeScreen.strMLA = @"\"The Global Religious Landscape.\" Pew Research Center- Religion Public Life. Pew Research Center, 18 Dec. 2012. Web. 29 Apr. 2016.";
        citeScreen.strAPA = @"Pew Research Center. (2012, December 18). The Global Religious Landscape. Retrieved April 29, 2016, from http://www.pewforum.org/2012/12/18/global-religious-landscape-exec/";

        citeScreen.citeWhichTopic = @"religion";
    }
    else if ([statWhichTopic isEqualToString:@"robotics"]) {
        citeScreen.strMLA = @"\"Industrial Robot Statistics.\" Statistics- IFR International Federation of Robotics. IFR, 2015. Web. 26 Apr. 2016.";
        citeScreen.strAPA = @"IFR- International Federation of Robotics. (2015). Industrial Robot Statistics. Retrieved April 26, 2016, from http://www.ifr.org/industrial-robots/statistics/";

        citeScreen.citeWhichTopic = @"robotics";
    }
    else if ([statWhichTopic isEqualToString:@"socialMedia"]) {
        citeScreen.strMLA = @"Baer, Jay. \"11 Shocking New Social Media Statistics in America.\" Convince & Convert. Convince & Convert, LLC, 2008-2016. Web. 27 Apr. 2016.";
        citeScreen.strAPA = @"Baer, J. (2008-2016). 11 Shocking New Social Media Statistics in America. Retrieved April 27, 2016, from http://www.convinceandconvert.com/social-media-research/11-shocking-new-social-media-statistics-in-america/";

        citeScreen.citeWhichTopic = @"socialMedia";
    }
    else if ([statWhichTopic isEqualToString:@"sexuality"]) {
        citeScreen.strMLA = @"\"FAQ: Facts and Statistics.\" The Kinsey Institute - Sexuality Information Links - FAQ [Related Resources]. The Kinsey Institute/ Indiana University, 1996-2016. Web. 21 Apr. 2016.";
        citeScreen.strAPA = @"The Kinsey Institute/ Indiana University. (1996-2016). The Kinsey Institute - Sexuality Information Links - FAQ [Related Resources]. Retrieved April 21, 2016, from http://www.kinseyinstitute.org/resources/FAQ.html#resources";

        citeScreen.citeWhichTopic = @"sexuality";
    }
    else {
        citeScreen.strMLA = @"\"Falcon Heavy.\" SpaceX. Space Exploration Technologies Corp., 2016. Web. 26 Apr. 2016.";
        citeScreen.strAPA = @"Space Exploration Technologies Corp. (2016). Falcon Heavy. Retrieved April 26, 2016, from http://www.spacex.com/falcon-heavy";

        citeScreen.citeWhichTopic = @"spaceExploration";
    }
}

    else if ([statWhichTopic isEqualToString:@"religion"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"religion";
    }
    else if ([statWhichTopic isEqualToString:@"robotics"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"robotics";
    }
    else if ([statWhichTopic isEqualToString:@"socialMedia"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"socialMedia";
    }
    else if ([statWhichTopic isEqualToString:@"sexuality"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"sexuality";
    }
    else {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"spaceExploration";
    }
}
//stat8 data... COMPLETE
else {

    CiteViewController *citeScreen = [segue destinationViewController];

    citeScreen.citeWhichStat = @"8";

    if ([statWhichTopic isEqualToString:@"abortion"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"abortion";
    }
    else if ([statWhichTopic isEqualToString:@"agriculture"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"agriculture";
    }
    else if ([statWhichTopic isEqualToString:@"climateChange"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"climateChange";
    }
    else if ([statWhichTopic isEqualToString:@"cybersecurity"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"cybersecurity";
    }
    else if ([statWhichTopic isEqualToString:@"discrimination"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"discrimination";
    }
    else if ([statWhichTopic isEqualToString:@"education"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"education";
    }
    else if ([statWhichTopic isEqualToString:@"energy"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"energy";
    }
    else if ([statWhichTopic isEqualToString:@"gunControl"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"gunControl";
    }
    else if ([statWhichTopic isEqualToString:@"internet"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"internet";
    }
    else if ([statWhichTopic isEqualToString:@"marijuana"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"marijuana";
    }
    else if ([statWhichTopic isEqualToString:@"overpopulation"]) {
        citeScreen.strMLA = @"Stancheva, Tina. \"Human Nature, Technology & the Environment.\" Human Nature, Technology & the Environment. 2003. Web. 10 Apr. 2016.";
        citeScreen.strAPA = @"Stancheva, T. (2003). Human Nature, Technology & the Environment. Retrieved April 10, 2016, from http://fubini.swarthmore.edu/~ENVS2/S2003/Tina/overpopulation";

        citeScreen.citeWhichTopic = @"overpopulation";
    }
    else if ([statWhichTopic isEqualToString:@"police"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"police";
    }
    else if ([statWhichTopic isEqualToString:@"pornography"]) {
        citeScreen.strMLA = @"\"Pornhub’s 2015 Year in Review.\" Pornhub Insights. Pornhub, 2016. Web. 19 Apr. 2016.";
        citeScreen.strAPA = @"\"Pornhub’s 2015 Year in Review.\" Pornhub Insights. Pornhub, 2016. Web. 19 Apr. 2016.";

        citeScreen.citeWhichTopic = @"pornography";
    }
    else if ([statWhichTopic isEqualToString:@"prison"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"prison";
    }
    else if ([statWhichTopic isEqualToString:@"rape"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"rape";
    }
    else if ([statWhichTopic isEqualToString:@"religion"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"religion";
    }
    else if ([statWhichTopic isEqualToString:@"robotics"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"robotics";
    }
    else if ([statWhichTopic isEqualToString:@"socialMedia"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"socialMedia";
    }
    else if ([statWhichTopic isEqualToString:@"sexuality"]) {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"sexuality";
    }
    else {
        citeScreen.strMLA = @"";
        citeScreen.strAPA = @"";

        citeScreen.citeWhichTopic = @"spaceExploration";
    }
}

} `

  • 1
    Since cybersecurity is your "fall through" case, anytime you don't get a matching segue name you will get cyber security. Double check your segue names carefully, set a breakpoint in prepareForSegue and step through to see what values you actually have – Paulw11 Jul 02 '16 at 01:23
  • I checked my segue identifiers three times and caught nothing. My breakpoint places an error immediately after the -(void) prepareForSegue... line where I call the method. This confuses me, what should I presume from this? – user3884788 Jul 02 '16 at 22:51
  • A breakpoint shouldn't cause an error. It should stop your app so that you can examine variables in the debugger and step line by line. Even printing your segue identifier may help if you can't figure out the debugger – Paulw11 Jul 02 '16 at 22:53
  • Ah, true, I mixed up my terminology; no errors, just has the `Thread 1: breakpoint 1.1` label as it should. My debugger reads **self**, **sender**, and **segue** with different objects listed under each downarrow. The breakpoint always appears on the line under `-(void) prepareForSegue...` Regarding printing my identifier: `NSLog`s do not even appear, as if the prepareForSegue method is not even being called. – user3884788 Jul 02 '16 at 23:15
  • That means you are no in the debugger. You can use the buttons to step line by line and examine your variables in the left hand view. The debugger is a very powerful tool. You should learn how to use it – Paulw11 Jul 02 '16 at 23:20
  • I am setting breakpoints in my code and running through them with the controls in the lower left of the screen. Issues occur where prepareForSegue is called. I don't understand what you mean by left-hand view. As in the left navigator menu? – user3884788 Jul 02 '16 at 23:50
  • The window with `sender` `self` Etc. these are your variables. You can examine their values if you expand the triangle next to self you will see all of your objects properties, for example. You should search google for how to use the Xcode debugger. As you single step you can see the value of `segue,identifier` and the path that our execution takes through the function – Paulw11 Jul 02 '16 at 23:52
  • I researched the Xcode debugger, and clicking through the Threads on the left and the objects down below the code but I just don't know what to take away from it. – user3884788 Jul 03 '16 at 00:06
  • You need to use the step over button to move to the next line and watch your application execute line by line – Paulw11 Jul 03 '16 at 00:07
  • @Paulw11 I used the step over. I can tell the issue occurs as soon as the segue is in action. But I don't know how to proceed. – user3884788 Jul 03 '16 at 02:10
  • Look at the segue.identifier; why doesn't it match any of your if statements – Paulw11 Jul 03 '16 at 02:11
  • The segue.identifier @"abortSeg" matches with the Abortion topic – user3884788 Jul 03 '16 at 02:58
  • Which matches the actual Abortion segue identifier set in Interface Builder manually – user3884788 Jul 03 '16 at 03:05
  • Then does it enter the `if` statement associated with that string? set a breakpoint on the line where you set the topic to cyber security and see when that is hit – Paulw11 Jul 03 '16 at 03:06
  • I missed an "o" in the segue name. I feel so stupid. setting a breakpoint on the last topic caught it for the first. – user3884788 Jul 03 '16 at 04:18

1 Answers1

0

An if statement cannot 'retain data from' an else statement. It just means that the condition in the if statement isn't being met so it is defaulting. I would recommend checking your spelling on the segue identifiers. Those in your code must match exactly to your storyboard. That's really the only thing I can think of if all the others work except for the Abortion statistics. If this doesn't work, try adding some NSLog statements to print the segue identifier and see why it isn't equal to "abortSeg".

In regard to your second question, I don't exactly understand what you are asking. Your app is crashing when you pop a view controller from the navigation stack? I'd need to see some code to figure out what is going wrong.

John Farkerson
  • 2,543
  • 2
  • 23
  • 33
  • I have reviewed my segue identifiers even before asking this question and have a couple times again. Even my NSLogs aren't showing anything, as if prepareForSegue isn't being called at all. – user3884788 Jul 02 '16 at 23:07
  • So you have added an NSLog outside of the if statements and prepareForSegue is never getting called? Are you sure that the class of the View Controller is set to TopicsViewController in the storyboard file? @user3884788 – John Farkerson Jul 03 '16 at 01:51
  • Yeah, I added it outside of the if statements and inside them. It is in fact set to TopicsViewController. Trying to work through breakpoints but I am not discovering anything I found useful there. Thanks for your help by the way. – user3884788 Jul 03 '16 at 02:08
  • No problem, happy to help! What I'm wondering is how could the statistics be set to cybersecurity if prepareForSegue was never being called? I think prepareForSegue must be called for this to happen and I can't imagine why it wouldn't be. Furthermore, you said that the breakpoint inside prepareForSegue was being called in one of your comments above. I'm going out on a limb here, did you maybe set the identifier of the VIEW CONTROLLER to abortSeg instead of the identifier of the SEGUE itself? If not, I'd really need to see more code to figure out the problem. – John Farkerson Jul 03 '16 at 03:14
  • I missed an "o" in the identifier. Overlooked it several times. I have 20 stats and I went way too fast looking over them. My back buttons are crashing the app now. I go from TopicsViewController to StatsViewController and then use another segued button to go back and it's no good on the transition back. Do I need to add code to TopicsViewController's ViewWillLoad() to reset the content? I thought the most recent prepareForSegue call would set the content and then it would remain unless otherwise referenced and changed. – user3884788 Jul 03 '16 at 04:52
  • Hmm, you shouldn't have to put anything in viewWillLoad. Mind showing me the error message? @user3884788 – John Farkerson Jul 03 '16 at 14:25
  • Ah, okay. Yeah sure, I have a `Thread 1: signal SIGABRT` error in **main.m**. I click the Step Over button amongst the debugger controls and get `Thread 1: EXC_BAD_INSTRUCTION (code=EXC_1386_INVOP, subcode=0x0)` on the same line in **main.m**. – user3884788 Jul 03 '16 at 15:43
  • Ok, the first thing I can think of is that you have a problem in your storyboard file. Try going to both your view controllers in the storyboard file. Click on them and then right click on the yellow icon at the top (I think it says Files owner). You may see a little warning icon somewhere on the pop up window. If so, click the X next to that connection. If that doesn't work, try setting an exception breakpoint to see where the error is. @user3884788 – John Farkerson Jul 03 '16 at 19:13
  • Ok so there were no warnings in File's Owner, but the exception breakpoint fell on the line passing the string for citeWhichStat when tapping the "< Hot Topics" back button from the Stats screen. When tapping the "< Statistics" back button from the Cite screen the exception breakpoint falls on another line where I set a string property in the next view controller. Both exception lines occur in ELSE statements – user3884788 Jul 04 '16 at 17:35
  • Ok, so maybe the string is nil? Could I see the relevant code? (Maybe the whole method if you don't mind sharing it) – John Farkerson Jul 04 '16 at 17:41
  • It might not be able to fit here so you might have to edit your original post @user3884788 – John Farkerson Jul 04 '16 at 17:51
  • Hmm, some are nil but they work. Too many characters...how can I post this method not in a comment? – user3884788 Jul 04 '16 at 17:52
  • Edit you original post and post the code @user3884788 – John Farkerson Jul 04 '16 at 17:53
  • ok i did it. may seem messed up because it is. got very confusing cutting out such a large method to post it. basically, it's outer if-else if-else statements identifying the stat number and then nested if-else if-else statements identifying the topic name. – user3884788 Jul 04 '16 at 18:00
  • OK, so I'm almost certain that your problem is that your destination view controller isn't of type CiteViewController. Try adding the following code to the very first line of the prepareForSegue method: `NSLog([[segue destinationViewController] isKindOfClass:[CiteViewController class]] ? @"The citeScreen is a CiteViewController" : @"The citeScreen isn't a CiteViewController. This is a problem.");` Tell me what you see in the console right before the crash. @user3884788 – John Farkerson Jul 04 '16 at 18:17
  • Nothing appears in the console before it crashes with this code. I placed it right after this line: `-(void)prepareForSegue...` and this line: `CiteViewController *citeScreen = [segue destinationViewController];`. Only pasted it once but I just mean after both of those lines. – user3884788 Jul 05 '16 at 22:40
  • Don't put it after that second line. Put it at the very very beginning of the method. Tell me if anything changes. @user3884788 – John Farkerson Jul 05 '16 at 22:42
  • Hm, oddly nothing is printed. `-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { NSLog([[segue destinationViewController] isKindOfClass:[CiteViewController class]] ? @"The citeScreen is a CiteViewController" : @"The citeScreen isn't a CiteViewController. This is a problem."); //stat1 data...` – user3884788 Jul 06 '16 at 01:49