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

plist反序列化

时间:2015-09-28 11:38:26      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:

//

//  ViewController.m

//  03-plist文件的一个反序列化

//

//  Created by jerry on 15/9/28.

//  Copyright (c) 2015年 jerry. All rights reserved.

//

 

#import "ViewController.h"

 

@interface ViewController ()

 

@end

 

@implementation ViewController

 

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

    

    // 1.URL

    NSURL *url = [NSURL URLWithString:@"http://127.0.0.1/videos.plist"];

    

    // 2.请求

    NSURLRequest *request = [NSURLRequest requestWithURL:url];

    

    // 3.连接 connection

    [NSURLConnection sendAsynchronousRequest:request queue:[[NSOperationQueue alloc]init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {

       

        id result = [NSPropertyListSerialization propertyListWithData:data options:0 format:NULL error:NULL];

        NSLog(@"%@------%@",result,[result class]);

    }];

    

    

}

@end

 

plist反序列化

标签:

原文地址:http://www.cnblogs.com/pengpengzhang/p/4843401.html

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