- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[[tableView cellForRowAtIndexPath:indexPath] setSelected:NO animated:YES];
if(indexPath.section==0)
{
if([array1 objectAtIndex:0])
{
BirthDateController *yeniSayfa=[[BirthDateController alloc] init];
yeniSayfa.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:yeniSayfa animated:YES];
[yeniSayfa release];
}
}
}
I want only the first one the first item in the array1 to go this BirthDate modal view but now all the first section is using this modalview.Can anybody help me for making only the first cell of the first section opens this modal view.
If I understand correctly, you mean the first row in the first section. Then, change your condition like this:
The resulting code would look like this:
The inner
if:does make sense to me. It will evaluate to true unless
array1isnil(or raise an exception).objectAtIndex:can not returnnilbecause aNSArraycan not storenilvalues and if the index is beyond the end of the array, it raises aNSRangeException.