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
  • 相关阅读:
    CI登录验证
    兼容所有浏览器的JS动态显示当前日期时间
    Active Record 数据库模式-增删改查操作
    数据库链接的增操作举例
    CI框架获取post和get参数 CodeIgniter
    PHP日期操作类代码-农历-阳历转换、闰年、计算天数等
    根据两点间的经纬度计算距离
    Session 类
    mysql 查询优化规则
    php获取文件夹下面的文件列表和文件夹列表
  • 原文地址:https://www.cnblogs.com/lidongq/p/3867162.html
Copyright © 2011-2022 走看看