model.h
@property (nonatomic,strong)NSString *name,*songer,*time;
//获取本地资源
-(NSMutableArray *)huoqu;
.m
-(NSMutableArray *)huoqu{
//获取本地music.plist
NSString *file=[[NSBundle mainBundle]pathForResource:@"Song.plist" ofType:nil] ;
NSMutableArray *array=[NSMutableArray arrayWithContentsOfFile:file];
return array;
}
controller.m
AudioModel *audio=[AudioModel new];
//获取model里面的plist属性给数组
arr=[audio huoqu];
根据key赋值
cell.Name.text=[NSString stringWithFormat:@"%@",[arr[indexPath.row]objectForKey:@"SongName"]];
cell.Singer.text=[NSString stringWithFormat:@"%@",[arr[indexPath.row]objectForKey:@"Singer"]];
跳转传值
在第二个页面.h
//初始化model
@property (nonatomic,strong)AudioModel *AM;
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPa