iPhoneのプログラミングが新しく、すぐに完了する必要があるプロジェクトがあります。私は3つのウェブサイトをリストアップし、選択したウェブサイトにロードするためにUITableViewを使用しようとしています。これはこれまでのコードです:UITableViewのインデックスを使用して文字列を変更しようとすると問題が発生する
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
int storyIndex = [indexPath indexAtPosition: [indexPath length] - 1];
if (storyIndex = 1) {
venueLink = @"http://kos-mediadesign.com/Storage/IconVenues/IconVenue.html";
}
else if (storyIndex = 2) {
venueLink = @"http://kos-mediadesign.com/Storage/IconVenues/SmythsVenue.html";
}
else if (storyIndex = 3) {
venueLink = @"http://kos-mediadesign.com/Storage/IconVenues/SinnotsVenue.html";
}
}
最初に選択したサイトは、いつでもDetailViewで開きます。私は本当にこれについていくつかの助けに感謝します。
おかげで、 ケヴ
が "==" と "=" を置き換えてみてください割り当てることです。その後、それは動作します。また、行インデックスを取得するには、 "[indexPath indexAtPosition:[indexPath length] - 1]"の代わりに "indexPath.row"を使用できます。 – Satya