我想建立一个应用程序来播放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];
}
AMAZING !!!!谢谢你们两位!但是,我怎样才能防止每次有人点击uitableviewController中的一行(歌曲)时创建一个新的mPlayerViewController? (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath :(NSIndexPath *)indexPath {myDetViewCont = [[mPlayerViewController alloc] initWithNibName:@“mPlayerViewController”bundle:nil]; ' – Alby 2011-03-18 05:18:37