我正在我的应用程序中实现音频播放器。我有一个 UITableView,我在其中显示了我的音轨列表。
音频列表被添加到一个数组中
fileArray = [[NSMutableArray alloc] initWithObjects:
[[NSBundle mainBundle] pathForResource:@"A Million Years" ofType:@"mp3"],
[[NSBundle mainBundle] pathForResource:@"2 Million Years" ofType:@"mp3"],...
在我的 cellForRowAtIndexPath 我正在做
cell.textLabel.text = [[NSString stringWithFormat:@"%@", [self.fileArray objectAtIndex:indexPath.row]] stringByDeletingPathExtension];
但问题是它仍然向我展示了一个完整的扩展名“/Users/....”。我只希望显示文件名(“一百万年”、“两百万年”)。
我究竟做错了什么?我一直在寻找答案,但从未得到答案(可能是由于措辞错误)
非常感谢大家。:)