简体   繁体   中英

iPhone : Simple UITableViewController crash without console error nor debugging clue

I'm trying to build a simple TableView program struture. It seems to work fine, but if I scroll the list to high or to low, the app crashes without any console error and the trace into the debugger does not help.

You can see it by yourself looking at the project I put at : http://shine.free.fr/tmp/myTestApp.zip

Can you help me :

  • to know what goes wrong
  • to know how I may find what goes wrong without having to ask each time. Usually I check my connection, lokk for compile errors, look into the console and try to debug, but there, nothing helps me.

Thank you for your help

The problem is that your ListController object is not retained when it is loaded from nib file, so it is not guaranteed that it will be valid after nib is loaded (and in fact it is not). To solve your problem add an outlet for ListController property and define retaining property for it. Here's FenetreListeController.h that fixes your problem:

#import <UIKit/UIKit.h>

@class ListeController;

@interface FenetreListeController : UIViewController {
    IBOutlet ListeController* listController;
}

@property (nonatomic, retain) ListeController* listController;
@end

You will also need to set outlet connection in IB and synthesize property in .m file

For more information about how objects are loaded from xib files check "The Nib Object Life Cycle" section from "Resource Programming Guide"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM