iPhone:简单的UITableViewController崩溃没有控制台错误或调试线索 [英] iPhone : Simple UITableViewController crash without console error nor debugging clue

查看:210
本文介绍了iPhone:简单的UITableViewController崩溃没有控制台错误或调试线索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个简单的TableView程序struture。
看起来工作正常,但如果我将列表滚动到高或低,应用程序崩溃没有任何控制台错误,跟踪到调试器没有帮助。

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.

您可以自己查看我投放的项目: http:// shine .free.fr / tmp / myTestApp.zip

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

可以帮助我:


  • 知道发生了什么问题

  • 知道我怎么会发现问题,而不必每次都问。通常我检查我的连接,lokk的编译错误,看看控制台,并尝试调试,但有没有什么帮助我。

感谢您的帮助

推荐答案

问题是,当从nib文件加载时,ListController对象不会保留,不保证它将在nib加载后有效(事实上它不是)。为了解决你的问题添加一个ListController属性的出口,并为它定义保留属性。 FenetreListeController.h 修复了您的问题:

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

您还需要在IB中设置出口连接并合成属性。 m文件

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

有关如何从xib文件加载对象的详细信息,请检查The Nib Object Life Cycle中的资源编程指南

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

这篇关于iPhone:简单的UITableViewController崩溃没有控制台错误或调试线索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆