【发布时间】:2010-04-10 10:38:03
【问题描述】:
我对此很陌生,正在尝试通过为自己创建一些小应用程序来学习。 我有一个基于导航的应用程序,用户在其中点击该行来选择电影标题 - 然后我希望第二个视图显示电影的详细信息。
感谢一位非常乐于助人的人,我将行的结果按下为“rowTitle”,如下所示:
(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *key = [keys objectAtIndex:indexPath.section];
NSArray *nameSection = [names objectForKey:key];
NSString *rowTitle = [nameSection objectAtIndex:indexPath.row];
NSLog(@"rowTitle = %@", rowTitle);
[tableView deselectRowAtIndexPath:indexPath animated:YES];
但是,我正在努力使“rowTitle”处的数据可用于第二个视图 -
基本上,如果我能获得信息 - 例如 rowTitle 是“aliens2” - 我希望能够在 'rowTitle' 返回的字符串末尾添加一个新扩展名以指向图像(如果这是有道理的)在第二个视图中......
有点像
tempImageName=[** this is where the info from rowTitle needs to be I suppose**];
tempImageType=@".png";
finalImageName=[tempImageName stringByAppendingString:tempImageType];
这对任何人都有意义吗(如果没有,请道歉 - 我知道我想要什么,但如何解释它有点尴尬!)
【问题讨论】:
标签: ios iphone uitableview cocoa-touch persistence