plist反序列化

//

//  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

 

posted @ 2015-09-28 10:13  。低调ヽ继续  阅读(195)  评论(0编辑  收藏  举报