DidSelectRowAtIndexPath causes my app to crash

Hi,
I'm just learning Cocoa. I've implemented a tab bar, and the first view (a UIViewController) contains a table view. I've implemented a separate class as the tableview datasource and delegate. Everything works fine, until I add either didSelectRowAtIndexPath or accessoryButtonTappedForRowWithIndexPath. Even if these methods have absolutely no code in them, just adding their implementation to my delegate creates a problem: when I click on a table row or on the disclosure button, my app breaks, and when I "step into" the code, it crashes with a “EXCBADACCESS”. I do not have any symbolic breakpoints defined.
Here's the error I see in gdb:
Loading program into debugger…
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".warning: Unable to read symbols for "/System/Library/Frameworks/UIKit.framework/UIKit" (file not found).
warning: Unable to read symbols from "UIKit" (not yet mapped into memory).
warning: Unable to read symbols for "/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics" (file not found).
warning: Unable to read symbols from "CoreGraphics" (not yet mapped into memory).
Program loaded.
sharedlibrary apply-load-rules all
Attaching to program: `/Users/Beth/Library/Application Support/iPhone Simulator/User/Applications/24242BF8-FA78-4360-A519-593EC497D8CE/NDQ.app/NDQ', process 237.
Program received signal: “EXCBADACCESS”.
I currently suspect one of two things, but honestly, have no idea what is causing the problem. I suspect that either, because I'm not using a Navigation controller, it's looking for a stack, but not finding one. Or I haven't hooked something up right in IB.
As I mentioned, the table is working fine without these method implementations - that is, it is displaying some simple string data and without those method implementations, I can click on a table row and of course, nothing happens, but it doesn't crash.
Thanks so much in advance for any help.
Elisabeth

Elisabeth Freeman wrote:
I've made a lot of progress since I last posted!
I can see that!!
I have set the View Controllers property (using IB) to the Navigation Controller (topicsTableNavController in the code below) for the first tab.
Neither your code nor your IB conections should set the navigationController property of a view controller. That property is set by the nav controller when the vc is pushed onto its stack. Your code can then use the property to get the nc's address when it wants to push another vc onto the stack.
Then, I have set the view (through IB) of the Navigation Controller to the Table View Controller.
Similarly, you should normally consider nc.view to be read only. The nc's view content is a composite of the nav bar and the top vc's view. It's managed by the nc, so neither your code nor your IB connections should change nc.view.
I think you've simply made a wrong (and very common!) assumption about the relationship between a nav controller and the view controllers it manages: The nc's view is the one that needs to be added to the hierarchy (the tab view in this case). The vc's view is then added to the nc's view, not the other way around. So when we visualize the relationship, the nav controller is always the parent of the view controllers that are pushed on and popped from its stack.
Since you defined your controllers and their connections in IB, the solution you're looking for is in the xib file, not your code. It turns out that IB already knows the correct structure, so it's deceptively easy to build it. That can make it harder to learn what's going on, so you're lucky you managed to scramble the stucture this time, else you might have never learned it.
Try building a new test bed in IB as follows:
1) File->New Project->iPhone OS->Application->Tab Bar Application;
2) Open MainWindow.xib in IB and bring up the window named MainWindow.xib (Window->Document);
3) Switch View Mode (upper left corner) to the center position (2 columns with small-icon tree view to the left);
4) Expand Tab Bar Controller and select (not expand) the first View Controller so it's highlighted in blue;
5) Delete the first View Controller by pressing the Delete key or Edit->Delete while that controller is highlighted;
6) Drag a Navigation Controller to the MainWindow.xib tree (Tools->Library->Objects->Controllers);
7) Position the nav controller over the tab bar controller icon until the tbc is shaded and outlined;
8) Drop the nc so that the tbc becomes its parent--i.e. the nc takes the place of the deleted vc;
9) Expand the nc and expand its child root controller to see the structure;
10) Select the root vc, open the Attributes panel (Tools->Attributes Inspector) and enter a title for the root vc;
11) If you want to define the root vc's view in it's own xib, enter a name for the new xib;
12) else you can now drag a view (e.g. UIView or UITableView from the library onto the root vc's icon;
13) If you want the root vc to be a UITableViewController. go back to step 10 and replace the root UIViewController;
14) After you have the structure you want, right click on each icon to see the connections IB has already made.
Btw, if you decide to make a separate xib in step 11, make sure you set the controller's class id in both MainWindow.xib and the new xib. I.e. both the icon that creates the controller and its proxy need to have the same class (else you get a very common crash).
I'm counting on you to let me know if the above is as clear as mud, ok? I've recently tried to help in two other threads that involved the same misunderstanding about nav controllers. Start reading each of these threads at the quoted paragraph:
The reason your current code isn't producing the transition you expect is that the tab bar has attached the table controller's view to the hierarchy (i.e. using addSubview) instead of the nav controller's view. You want the nav controller's view because that's the one which will change when you push a new controller. [http://discussions.apple.com/thread.jspa?messageID=9592005&#9592005];
It's the nav controller's view that contains the content view, not the other way around. This point is worth taking a moment to see, and it seems to be commonly misunderstood. [http://discussions.apple.com/message.jspa?messageID=9607946#9607946].

Similar Messages

  • RH8 causing other apps to crash?

    Hello -
    I have a colleague (working in another office, so I can't really see this problem first hand) who is trying to install RH8 on a Win7/32 machine (new install, not an upgrade). A member of her IT dept is performing the install.
    After the installation of the app and patches is finished, RH seems to work more or less normally (she's new to RH, so her sense of "normal" is rather limited at this stage).  The problem is that other applications lock up and crash (she mentioned MS Office apps in particular, but that could be because those are the ones she tends to use the most).
    After un-installing RH, the other apps no longer crash.
    I've recommended re-installing but skipping the "RoboHelp for Word" piece, but I can't think of anything else.
    I'm just wondering if anyone else has seen a similar situation? I've found other threads that deal with RH crashing or the RH install failing, but I couldn't find any in which RH caused other apps to crash.
    Thanks,
    Dave

    Hmm...I posted a reply via email, but it isn't showing up, so I'm pasting it in.
    Hi, Rick -
    Thanks for the suggestions. Like some of the other threads I've found, these seem to deal mainly with RH crashes rather than other apps. But your first link possibly has some overlap as the menu issue it describes also pops up in a thread I found:
    "RoboHelp 8 crashes on Windows 7"
    http://forums.adobe.com/message/2955493#2955493
    This thread includes a scenario in which Outlook and other apps are failing. Additionally, some users were having RH crashes related to the menu bug. Some users found relief by uninstalling source control, others did not. Finally, An Adobe employee posted a fix that corrects issues related to Oleacc.dll which helped some users.
    To be thorough, I'll mention that the problems are occurring on a laptop (another thread traced RH crashes to a BioMetric service running on their laptop). And my colleague has the FoxIt PDF utility installed (I don't think this should be the issue here, but perhaps worth a mention.)
    I'm going to suggest that they try:
    1a. Check the registry to ensure traces of the previous RH install are gone.
    1b. Reinstall but omit source control and RH for Word (I think you can skip these during install?  I'm no longer allowed to to perform my own installs, so I'm less familiar with the process than I once was.)
    2. Ensure patches are installed (version should be 8.02.208)
    3. If that doesn't work, try the Oleacc.dll fix.
    4. If that doesn't work, try another Win7/32 machine (preferably non-laptop).
    5. If all is well on the other machine, I guess it is time to start looking at which non-essential services might be causing a conflict.
    Regards,
    Dave

  • When I plug in my Lacie Firewire 800 drive it causes certain apps to crash. Chrome will immediately crash when I open it, so will DVD player. It's only when I plug in my Firewire 800 drive, USB does not cause issues. What's the deal?

    When I plug in my Lacie Firewire 800 drive into my Mid-2009 Macbook Pro running Mountain Lion - 10.8.2,  it causes certain apps to crash. Chrome will immediately crash when I open it, so will DVD player. It's only when I plug in my Firewire 800 drive, USB does not cause issues. What's the deal?
    I've restarted, verfied the disk, repaired permissions, smc reset.. don't know what else to do..

    Contact Lacie since it's their product you are having issues with. 

  • Importing photos to my ipad 2 on iOS 4.3.2 using camera connection kit causes photo app to crash

    Importing photos to my ipad 2 on iOS 4.3.2 using camera connection kit causes photo app to crash. Tried importing photo from an iPhone 4/ Panasonic DMC-FX50 via USB and SD card but without success. However, importing video from a Flip Mino HD is ok. Can't seem to figure out what I'm doing wrong

    Have you tried a reset by holding the power and home buttons for ten seconds until the apple appears?
    Since it's multiple different import devices not working with the CCK, it appears to be on the iPad side...
    If the reset doesn't help, try a restore from within iTunes on the computer.

  • Recent Update causes my App to crash. What should I do?

    Recent update causes my Adobe Revel App to crash. What can I do?

    Are you using ios? Is your app crashing or not installing an update?
    There is an issue that the Revel version 2.3.2 on iOS does not seem to install.  We are working with Apple to resolve it as quickly as possible. We sincerely apologize for the inconvenience this is causing you. In the mean time, you can still access your photos on adoberevel.com from a browser and from our mac, win8, and android apps.
    If you are using a different platform, please let us know the details.
    Pattie

  • Restrictions tab causes settings app to crash

    I'm using iphone 4 GSM IOS 7.0.4. everytime try to enter Restrictions section in Settings app, It crashes the settings app completely. please help ASAP.
    Thanks in advance.

    Unfortunately Stage3D recording does use up a lot of memory, because it's sending every single mesh and texture over wifi to Scout. If your game has a lot of 3D resources then this could cause it to run out of memory - in this case, it's not AIR that's crashing, but the OS is killing it because of it using too much memory.
    My suggestion would be to do Stage3D recording when running your content on desktop (e.g. in a simulator), since you won't have these memory constraints. If you're deep-diving into rendering, then you should be able to solve your problems on the desktop, since the rendering is the same. Profiling on device is best for looking into performance and memory issues, since you absolutely have to run it on the target platform in order to meaningfully see what's going on.

  • 10.6.5 Update causing QT apps to crash

    I think the 10.6.5 update is causing my Nokia QT apps to crash with the following message:
    Exception Type: EXCBADACCESS (SIGSEGV)
    Exception Codes: KERNINVALIDADDRESS at 0x0000000000000000
    Crashed Thread: 0 Dispatch queue: com.apple.main-thread
    plus a long list of other info. I did a file permissions repair, a disk repair, and reinstalled the 10.6.5 update manually, but the problem is still not fixed. Anybody have any ideas?

    baltwo wrote:
    Can't help with the CUPS issue, since it's not occurring here. If you want to report this issue to Apple's engineering, send a bug report or an enhancement request via its Bug Reporter system. To do this, join the Mac Developer Program—it's free and available for all Mac users and gets you a look at some development software. Since you already have an Apple username/ID, use that. Once a member, go to Apple BugReporter and file your bug report or enhancement request. The nice thing with this procedure is that you get a response and a follow-up number; thus, starting a dialog with engineering.
    I will register for the developer program tomorrow. Do you know someone who knows about CUPS?, it might be helpful to sort this problem out. Should I take the sledge hammer approach and do a clean reinstall for OSX? Also there's a chance that this problem might be related to Apple portables only, since the other user is having the same issue that I do in a MacBook Pro as well but his MacBook is the 17" inch one but still there might be one common denominator here.
    I really hope this thread gets seen by more users in this forum, to see if more information surfaces about this problem.
    Anyways, thank you for your assistance.

  • Pasting in a network path causes Mail app to crash every time.

    Whenever I try to copy and paste a network path (example \\servername.domain.school.edu\rootfolder\subfolder) into an email within the mail app, it crashes.
    Running iPhone 4 AT&T iOS 6.0.1

    Note that your System Details List shows that you have a user.js file in the profile folder to initialize some prefs on each start of Firefox.
    The user.js file is only present if you or other software has created it, so normally it wouldn't be there.
    you can check its content with a plain text editor if you didn't create this file yourself.
    The user.js file is read each time you start Firefox and initializes preferences to the value specified in this file, so preferences set via user.js can only be changed temporarily for the current session.
    *http://kb.mozillazine.org/Preferences_not_saved

  • Stage3D Recording Causes iOS App to Crash

    Wanted to give a heads up on a major Scout crash:
    I have a pretty good gigabit ethernet and wasn't downloading anything at the time, but with Stage3D Recording turned on, my iOS app crashed due to 150MB worth of Network Buffers, which I assume is a bunch of Stage3D data that is queued up. When I turned Stage3D off, there was no Network Buffer memory issue and no crash.
    Session Info:
    Runtime: 11.6.602.161
    AIR: 3.6.0.5920
    SWF ver 19
    iOS 6.1.2 iPad2

    Unfortunately Stage3D recording does use up a lot of memory, because it's sending every single mesh and texture over wifi to Scout. If your game has a lot of 3D resources then this could cause it to run out of memory - in this case, it's not AIR that's crashing, but the OS is killing it because of it using too much memory.
    My suggestion would be to do Stage3D recording when running your content on desktop (e.g. in a simulator), since you won't have these memory constraints. If you're deep-diving into rendering, then you should be able to solve your problems on the desktop, since the rendering is the same. Profiling on device is best for looking into performance and memory issues, since you absolutely have to run it on the target platform in order to meaningfully see what's going on.

  • Configurator 1.4.3 causing certain apps to crash on start-up

    I am using Configurator 1.4.3 and while I have things set up the way that I want for our high school iPad cart, there are two apps that will ask for user authentication and then crash when you try to open them.  The apps are Nuclear and Nova Elements (both science apps).  When I put in our username and password (which it shouldn't even be asking for to just open the app) the app just closes itself back to the home screen.
    I installed a default settings profile on the iPad and the apps still wouldn't open.  I unsupervised and factory-reset the iPad and installed the apps without using configurator and they open fine, so something in configurator is causing the issue, but I don't know what.  I haven't had problems with any other apps on the iPad, so I don't know how it could be a setting preventing the apps since all the others work. 
    Any insight would be appreciated.

    I notice you haven't called Adobe support--unless you overlooked mentioning it. That is what I would do at this point. Without knowing just what apps you have on and all the facts of your configuration, it will be a matter of mostly guesswork here. That it hangs on ui.dll may give Adobe support the clue they need to troubleshoot it.
    Here's one solution that might work. Set up a dual boot system, putting nothing but LR on one side--no internet, just the bare bones. Put LR on alone. Then add programs you may want to use with it, one at a time. If that solves the problem, LR will also run faster--in my case about 1.5 times as fast. Sorry, I can't be of more help.

  • ICal opens slow and causes other apps to crash

    Whenever I open iCal, it takes a very long time for it to load. And, once it does, it is very difficult to maneuver or add/delete any info. If I keep the program open, I'm unable to use any other applications. It makes everything lock up. And, I usually end up force quitting iCal in order to get out of it. My RAM is fine. This problem occurs even when I have no other programs open. I've tried reinstalling iCal, but after it "fixes", the problem keeps returning.
    any thoughts?

    We're sorry to hear that your Firefox seems to be crashing. Please perform the following steps to give us a crash report ID that helps us find out more about the cause of the crash.
    #Enter about:crashes in the Firefox location bar (that's where you enter your website names) and press Enter. You should now see a list of submitted crash reports.
    #Copy the most recent 5 report IDs that you see in the crash report window and paste them into your forum response.
    Thanks in advance for your help!
    More information and further troubleshooting steps can be found in the [[Firefox crashes]] article.

  • Printing since updates causes all apps to crash

    Since the last round of updates from Apple, including the EFi firmware update, I am unable to print at all.
    I have two printers, neither of which will print, I dont even get the print box come up before the applications "Unexpectedly quit".
    I am using an Epson R1800 printer and a HP Laserjet 1018, the latter of which I know doesn't work with OSX natively but using a 3rd party driver always has.
    I have tried running the Disk Utility to repair permissions, and also run the reset printer option, followed by a reboot and then added the printers again. Still no joy. I have also tried these steps but only added one printer at a time and still the apps crash.
    Has anyone got any ideas?
    Thanks
    Paul

    Try downloading the 10.4.10 Combination Updater from Apple and re-update.

  • 4.2.7 upgrade causing all apps to crash as well.  Anyone else?

    Just upgraded to 4.2.7.  All apps purchased or free crash upon launch.

    When I signed on to Itunes on my computer to synchronize my IPhone Apps a message came up asking me to "Authorize this computer or all apps will be deleted" or something to that effect.  I authorized by entering my MacBookPro (MBP) password.  Once I did that all apps sync'd and all IPhone apps then worked.  It only took a few minutes. 
    Originally when I tried to sync it came up with a message saying it could not sync the paid apps and I might lose them if I tried.  Apparently this was because the MacBook was not authorized (and therefore legal) to sync.
    I don't know why the ugrade screwed up all the apps but syncing through ITunes restored them.
    I'm not a newbie to Macs but I am to ITunes, IPhones and MacBookPros so I am learning as I go.
    I discovered all this with a little trial and error.  Hope it works for you.

  • Built-in Browser Causing Viewer Apps To Crash

    We're seeing Folios with multiple links to websites crashing the viewer app its housed in. Seems like the built-in browser is the culprit. When it slides up to open a link, the whole app crashes. Anyone experience the same thing?
    For now we're making links open in device browser, but we'd prefer a more seamless experience with the built-in browser.

    Just checked Console and it's spamming these two messages several times per second -
    ReportCrash[3452]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
    ReportCrash[3452]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0

  • Firefox crashes and causes other apps to crash too

    This is not a duplicate of 792342 because several actions make it crash. Some times it crashes at start.
    Fire fox has been crashing every day. Actually every hour. After the crash, everything else starts crashing too. It started about 5 days ago.
    I've been logging the crashes using aLogRec and aLogCat. I'll try to include the files in this report.
    Sadly, I still couldn't isolate the issue for reproduction. Once it crashed at start. Once it crashed using facebook (aparently some javascript bad coding or bad interpretation when clicking the message buttom in facebook's site).
    What I surely know that always happends is that I only can use the device again after turning it off and on again (resetting makes it crash from start or loop).

    We're sorry to hear that your Firefox seems to be crashing. Please perform the following steps to give us a crash report ID that helps us find out more about the cause of the crash.
    #Enter about:crashes in the Firefox location bar (that's where you enter your website names) and press Enter. You should now see a list of submitted crash reports.
    #Copy the most recent 5 report IDs that you see in the crash report window and paste them into your forum response.
    Thanks in advance for your help!
    More information and further troubleshooting steps can be found in the [[Firefox crashes]] article.

Maybe you are looking for