zoukankan      html  css  js  c++  java
  • 歌曲页面显示

    //
    //  MusicList.m
    //  播放器
    //
    //  Created by apple on 14-7-24.
    //  Copyright (c) 2014年 apple. All rights reserved.
    //
    
    #import "MusicList.h"
    #import "ViewController.h"
    @interface MusicList ()<UITableViewDataSource,UITableViewDelegate>
    
    {
        ViewController *viewCt;
        
        NSArray *musiclist;//歌曲名列表    
    }
    @end
    
    @implementation MusicList
    
    - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    {
        self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
        if (self) {
            // Custom initialization
        }
        return self;
    }
    
    - (void)viewDidLoad
    {
        [super viewDidLoad];
        UITableView *musicListTable=[[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
        musicListTable.delegate=self;
        musicListTable.dataSource=self;
        [self.view addSubview:musicListTable];
    //    musiclist=[[NSArray alloc]initWithArray:[viewCt musiclist1]];
        musiclist=@[@"Beyond-光辉岁月",@"G.E.M.邓紫棋-你把我灌醉",@"G.E.M.邓紫棋-回忆的沙漏 (国)",@"Beyond-海阔天空",@"Declan Galbraith-Tell Me Why"];
    }
    
    #pragma mark-行数设置
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
        return 5;
    }
    
    
    
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"cell"];
        if (cell==nil)
        {
            cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
        }
        
        cell.textLabel.text=[NSString stringWithFormat:@"%@",musiclist[indexPath.row]];
        return cell;
    }
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
    //    viewCt=[[ViewController alloc]init];
    //    [viewCt setIndex:indexPath.row];
        [self.pCV setIndex:indexPath.row];
        [self presentViewController:self.pCV animated:YES completion:^{
            NSLog(@"进入播放页面");
            [self.pCV play];
        }];
    }
    
    - (void)didReceiveMemoryWarning
    {
        [super didReceiveMemoryWarning];
        // Dispose of any resources that can be recreated.
    }
    
    /*
    #pragma mark - Navigation
    
    // In a storyboard-based application, you will often want to do a little preparation before navigation
    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
        // Get the new view controller using [segue destinationViewController].
        // Pass the selected object to the new view controller.
    }
    */
    
    @end
  • 相关阅读:
    Asynchronous AOF fsync is taking too long (disk is busy?). Writing the AOF buffer without waiting for fsync to complete, this may slow down Redis.
    DHCP "No subnet declaration for xxx (no IPv4 addresses)" 报错
    Centos安装前端开发常用软件
    kubernetes学习笔记之十:RBAC(二)
    k8s学习笔记之StorageClass+NFS
    k8s学习笔记之ConfigMap和Secret
    k8s笔记之chartmuseum搭建
    K8S集群集成harbor(1.9.3)服务并配置HTTPS
    Docker镜像仓库Harbor1.7.0搭建及配置
    Nginx自建SSL证书部署HTTPS网站
  • 原文地址:https://www.cnblogs.com/lidongq/p/3867162.html
Copyright © 2011-2022 走看看