你好!
我尝试从数组(prepTime)中提取值,但它没有显示它们。当我编译程序时,我得到一个错误:
0xec80b0: cmpl (%eax), %ecx Thread 1: EXC_BAD_ACCESS (code=1, address=0xff31e10)
在这里,我创建了数组:
{
NSArray *tableData;
NSArray *thumbnails;
NSArray *prepTime; //Here I created the array
}
在这里,我用值填充它:
- (void)viewDidLoad
{
[super viewDidLoad];
// Initialize table data
tableData = [NSArray arrayWithObjects:@"Egg Benedict", ... @"Angry Birds Cake", @"Ham and Cheese Panini", nil];
// Initialize thumbnails
thumbnails = [NSArray arrayWithObjects:@"egg_benedict.jpg", ... @"angry_birds_cake.jpg", @"ham_and_cheese_panini.jpg", nil];
//Initialize prep time
prepTime=[NSArray arrayWithObjects: @"90 min", "60 min", "45 min", ... "10 min", "60 min", "40 min", nil];
}
如您所见,我的代码中定义了三个数组并填充了值,但只有“ prepTime ”数组不会在我的表格单元格中显示它的值,而是在编译时给出错误。
为什么会发生?
非常感谢!