我试图将两种不同的观点放在一个 xib 上。其中在一个视图中我使用了两个表视图。我完美地完成了所有 IBOutlet 和映射部分。 在加载它时,我收到此消息(如图所示)。 当我隐藏 self.table1.delegate=self; 时 self.table2.delegate=self; self.table1.datasource=self; self.table2.datasource=self;
它显示了我想要的正常视图,但两个表都没有数据滚动。 我正在使用 XCODE 4.2 IDE 和 lion 操作系统。
I m trying to put two different view on one xib. out of which in one view I m using two table view.I did all IBOutlet and mapping part perfectly.
And while loading it ,I get this message (which is shown in image).
And when I hide the self.table1.delegate=self;
self.table2.delegate=self;
self.table1.datasource=self;
self.table2.datasource=self;
its shows normal view whatever I want, but both the tables without data n scroll.
I m using XCODE 4.2 IDE and lion os.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
EXC_BAD_EXCESS 错误是由过度释放的对象(未设置为 nil)引起的。为了追踪这些,你需要使用僵尸。虽然使用僵尸的方法有多种,但我更喜欢......
“配置文件”您的代码以使用 Instruments 运行它。选择“僵尸”乐器。重新创建错误。仪器将暂停,指向内存位置,并为您提供保留和释放僵尸的所有位置的列表,并提供一个调用树以显示它在代码中发生的位置。
EXC_BAD_EXCESS errors are caused by over released objects (which aren't set to nil). To track these down you use zombies. While there are multiple ways of using zombies, I prefer....
"Profile" your code to run it using Instruments. Choose the 'Zombies' instrument. Re-create the error. Instruments will pause, point to the memory location and give you a list of all the places the zombie was retained and released as well as providing a call tree to show where it happens in your code.
实际上,问题是因为我正在使用 UIView,并且在该视图上我正在使用自定义视图,并在该视图上使用表视图。因此,在视图中确实加载了我获取的本地实例。
所以我把它放在各自的.h中,并且我在viewcontroller类中做了转发声明。
(因为在运行时实例被释放,然后被调用,所以问题是)
注意:-当您向已释放的对象发送消息时,通常会收到此错误实例。所以我在你的代码中怀疑的是,你创建了一些视图,然后将其添加到其他一些视图并释放了之前创建的视图。现在,如果对第一个视图(已发布)执行任何操作都会导致异常。即:第一个视图包含一个按钮,并且该按钮内部的修饰操作是在 FristViewController 中编写的。现在我创建了 FirstView 的实例并将其添加到第二个视图中并释放了第一个视图实例。现在假设用户点击FirstView的按钮,iOS会搜索已经发布的控制器(FirstViewController),就会出现这个问题。
Actualy problem is as I am using a UIView and on that I am taking a custom view and on that a table view..so in view did load I was taken a local instances.
so I take it in respective .h, And I DID FORWARD DECLARATION in viewcontroller class..
(because in that at runtime the instance was released,then that was called so the prob was)
Note:-You generally get this error when you send a message to already released instance. So what I suspect in your code is, you created some views and then you added it to some other view and released the previous created view. Now if any action performed on the first view (which is already released) will cause the exception. i.e.: First View contains a button and action for this button's touchup inside is written in FristViewController. Now I created the instance of FirstView and added into second view and released the firstview instance. Now suppose user tap on FirstView's button then, iOS will search for controller (FirstViewController) which is already released, and this problem will occur.