Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 使UIAlertView与单击以打开它的单元格具有相同的标题_Objective C_Ios_Cocoa Touch_Uitableview_Uialertview - Fatal编程技术网

Objective c 使UIAlertView与单击以打开它的单元格具有相同的标题

Objective c 使UIAlertView与单击以打开它的单元格具有相同的标题,objective-c,ios,cocoa-touch,uitableview,uialertview,Objective C,Ios,Cocoa Touch,Uitableview,Uialertview,我需要UIAlertView与打开它的单元格具有相同的标题。我已经有一大堆名字了。例如,如果我打开一个名为White的单元格,UIAlertView的标题应该是White。每个打开的单元格都必须有特定的AlertView标题 我已经尝试过实现self.(数组的名称)方法,但当我这样做时,它似乎不起作用 任何帮助都将不胜感激。谢谢这应该能帮助您: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexP

我需要UIAlertView与打开它的单元格具有相同的标题。我已经有一大堆名字了。例如,如果我打开一个名为White的单元格,UIAlertView的标题应该是White。每个打开的单元格都必须有特定的AlertView标题

我已经尝试过实现self.(数组的名称)方法,但当我这样做时,它似乎不起作用

任何帮助都将不胜感激。谢谢

这应该能帮助您:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[myArray objectAtIndex:indexPath.row] message:@"message" delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:nil, nil];
    [alert show];
}

@parisianastro97如果此答案对您有所帮助,请务必单击答案旁边的“复选标记”将其标记为正确!