我有一个管理对象,有几个NSString的:管理对象崩溃EXC_BAD_ACCESS
@interface Establishment : NSManagedObject
{
}
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSString * subtitle;
@property (nonatomic, retain) NSString * description;
我创建了管理对象的实例和分配的字符串标签,因为这样的:
if ([establishmentData.name length]!= 0) {
estabName.text = establishmentData.name;
} else {
estabName.hidden = YES;
}
if ([establishmentData.subtitle length]!= 0) {
estabTitle.text = establishmentData.subtitle;
} else {
estabTitle.hidden = YES;
}
if ([establishmentData.description length]!= 0) {
estabDescription.text = establishmentData.description;
} else {
estabDescription.hidden = YES;
}
在这种情况下,名称有一个值,但字幕和说明是零。当它到达字幕时,它成功地失败了if和隐藏文本字段,但是当它描述它时会崩溃EXC_BAD_ACCESS。我试图简单地NSLogging establishmentData.description和它仍然崩溃
回溯抛出62000线的这样的:
62851 0x00d3dbbf在_PF_Handler_Public_GetProperty()
62852 0x00d3f2fb在 - )[NSManagedObject _descriptionValues](
62853 0x00d3d6b5在 - [NSManagedObject描述]()
和与
62854 0x00004b90在结束 - [数据表的tableView:didSelectRowAtIndexPath方法:]
(个体= 0x4d48df0,_cmd = 0x6d59e3, 的tableView = 0x505d200, indexPath = 0x6111b00)在 /用户/ Com_23 /文件/项目/ Est_list /班/数据表。米:330
62855在0x0032e794 - [UITableView的_selectRowAtIndexPath:动画:的scrollPosition:notifyDelegate:]
()
62856 0x00324d50在 - [UITableView的_userSelectRowAtPendingSelectionIndexPath:]
()
62857 0x000377f6 in __NSFireDelayedPerform()
62858 0x00f67fe3 in CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION
()
62859 0x00f69594在__CFRunLoopDoTimer()
62860 0x00ec5cc9在__CFRunLoopRun()
62861在CFRunLoopRunSpecific()
62862在CFRunLoopRunInMode 0x00ec5161(0x00ec5240)
62863 0x018bb2 68 GSEventRunModal()
62864在
0x018bb32d在GSEventRun()62865 0x002c742e在UIApplicationMain()
62866在主(的argc = 1,的argv = 0xbfffefe4)0x00002958
/用户/ Com_23/Documents/projects/Est_list/main.m:14
DataTable是我的UITableViewController。有谁知道发生了什么事?一切看起来都很好。
参见:HTTP: //www.cocoadev.com/index.pl?NSZombieEnabled启用NSZombies。 – magma 2011-04-18 05:35:09