【发布时间】:2011-07-16 23:23:43
【问题描述】:
我想构建一个在 iPhone 上播放本地音频文件的应用程序,但我的一些代码卡住了。 我想知道如何推送视图,返回 uitableviewcontroller 并使用按钮(如媒体播放器中的“现在播放”按钮)返回视图而不将任何新字符串推入其中..
谢谢你
我应该对我的代码进行哪些更改?
在 uitableviewcontroller..
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
*)indexPath {
selectedSong = [directoryContent objectAtIndex:indexPath.row];
NSString *storyLin = [[directoryContent objectAtIndex:[indexPath row]] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
patch = [NSString stringWithFormat:@"/%@", storyLin];
myDetViewCont = [[mPlayerViewController alloc] initWithNibName:@"mPlayerViewController" bundle:nil];
myDetViewCont.myProgLang = selectedSong; // assigning the correct value to the variable inside DetailViewController
[self.navigationController pushViewController:myDetViewCont animated:YES];
[myDetViewCont release]; // releasing controller from the memory
}
在 mPlayerViewController.m 中
-(IBAction) backtoplayer{
myDetViewCont = [[mPlayerViewController alloc] initWithNibName:@"mPlayerViewController" bundle:nil];
}
【问题讨论】:
标签: iphone xcode uitableview uinavigationcontroller pushviewcontroller