码迷,mamicode.com
首页 > 其他好文 > 详细

plist文件的读取

时间:2015-09-30 16:27:49      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:

   NSString *filePath = [[NSBundle mainBundle] pathForResource:@"cinemalist" ofType:@"plist"];
    
    NSMutableDictionary *myDic = [NSMutableDictionary dictionaryWithContentsOfFile:filePath];

    //读取plist文件
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"cinemalist" ofType:@"plist"];
    
    NSMutableDictionary *myDic = [NSMutableDictionary dictionaryWithContentsOfFile:filePath];
    
    for (NSDictionary * dic in [[myDic objectForKey:@"result"] objectForKey:@"data"]) {
        
        //所有的title
        NSString * title = [dic objectForKey:@"cinemaName"];
        
        //所有的content
        NSString * content = [dic objectForKey:@"address"];
        
        
        NSLog(@"title = %@",title);
        NSLog(@"content = %@",content);

    }
   

plist文件的读取

标签:

原文地址:http://www.cnblogs.com/lidongxiao/p/4849397.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!