UITableView của tôi đang trả lại EXEC_BAD_ACCESS
, nhưng tại sao!EXEC_BAD_ACCESS trong UITableXem cellForRowAtIndexPath
Xem đoạn mã này!
Tải UITableView hoạt động tốt, vì vậy allXYZArray != nil
và được phổ biến!
Sau đó di chuyển các tableview để phía dưới và sao lưu nguyên nhân nó sụp đổ, vì nó đi để tải lại phương pháp cellForRowAtIndexPath
Nó không thành công trên dòng:
"NSLog(@"allXYZArray::count: %i", [allXYZArray count]);"
(UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAt
IndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"CellIdentifier";
UITableViewCell *cell = [theTableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
@try
{
if (allXYZArray == nil) {
NSLog(@"nil");
allXYZArray = [ToolBox getMergedSortedDictionaries:allXYZGiven SecondDictionary:allXYZSought];
}
NSLog(@"%i", [indexPath row]);
NSLog(@"allXYZArray::count: %i", [allXYZArray count]);
Bạn có thể đăng mã cho phần còn lại của phương thức cùng với mã cho [ToolBox getMergedSortedDictionaries: SecondDictionary:]? – MrHen