Я пробую этот код, но он вылетает в - (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) линия.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell" ;
Custom *cell = (Custom *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell=nil;
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"Custom" owner:self options:nil];
cell = satir;
}
// Configure the cell.
cell.adLabel.text=[array objectAtIndex:[indexPath row]];
cell.adLabel.textColor= [UIColor darkGrayColor];
cell.adLabel.font = [UIFont systemFontOfSize:15];
cell.adresTextView.text=[array2 objectAtIndex:[indexPath row]];
cell.adresTextView.textColor= [UIColor darkGrayColor];
cell.adresTextView.font = [UIFont systemFontOfSize:13];
cell.telefonLabel.text=[array3 objectAtIndex:[indexPath row]];
cell.telefonLabel.textColor= [UIColor darkGrayColor];
cell.telefonLabel.font = [UIFont systemFontOfSize:13];
return cell;
}
- (IBAction)tablodaGosterBtnClick:(id)sender {
NSUInteger numComponents = [[pickerView dataSource] numberOfComponentsInPickerView:pickerView];
NSMutableString * text = [NSMutableString string];
for(NSUInteger i = 0; i < numComponents; ++i) {
selectedRow = [pickerView selectedRowInComponent:i];
title = [[pickerView delegate] pickerView:pickerView titleForRow:selectedRow forComponent:i];
[text appendFormat:@"Selected item \"%@\" in component %lu\n", title, i];
}
if ([title isEqualToString:@"Restaurant"]) {
array = [[NSMutableArray alloc] initWithObjects:@"Ehl-i Keyf Cafe", @"Enginarcı Mini Hotel ",@"Ginza Cafe",@"Lins Cafe",@"Opera Patisserie & Cafe",@"Patsa Cafe ",@"Sita Balık Evi ",nil];
array2 = [[NSMutableArray alloc] initWithObjects:@"Fulya Mah. Mevlüt Pehlivan Cad. Erdoğanlar İş Merkezi No:14 Şişli/İstanbul",@"Fulya Mah. Mevlüt Pehlivan Sok. No:6 Fulya/İstanbul",@"Fulya Mah. Mevlüt Pehlivan Sok. No:13/A Şişli/İstanbul",@"Fulya Mah. Mevlüt Pehlivan Sok. No:13/A Şişli/İstanbul",@"Mevlüt Pehlivan Cad. No:25/2 Şişli/İstanbul",@"Fulya Mah. Mevlüt Pehlivan Sok. Multinet Plaza No:12 Şişli/İstanbul",@"Mevlüt Pehlivan Sok. No:9 Şişli/İstanbul", nil];
array3 = [[NSMutableArray alloc] initWithObjects:@"0212 272 37 06",@"0536 304 33 28",@"0212 275 60 36",@"0212 204 15 15",@"0212 288 48 58",@"0212 336 88 00",@"0212 267 16 88", nil];
[table reloadData];
}
else {
[array removeAllObjects];
[array2 removeAllObjects];
[array3 removeAllObjects];
[table reloadData];
}
}
Как я могу решить это? Возможно ли, исчезнуть табличное представление данных или удалить?