0920 JSON数据 蓝懿

《JSon数据》

基本顺序

1,NSString *path=@“路径”;

2,NSData *pathdata=[nsdata datawithcontentsoffile:path];

如果存入的是字典

3,NSDicitonary *dic=[NSJsonserialization JSONobjectwithData:pathdata];

 

《网络路径使用》

NSString *str=@http:\/\/www.1905.com\/vod\/play\/838297.shtml”;

UIImageview *iv=[uiimageview alloc]initwith….;

NSData *data=[NSData datawithcontentofURL:[NSURL URLwithstring:str];

iv.imageview.image=[uiimage imagewithdata:data];

 

《跳转网络页面》

UIViewController *vc=[[UIViewController alloc]init];

//创建web页面wv 让其加载电影

    UIWebView *wv=[[UIWebView alloc]initWithFrame:vc.view.bounds];

//创建网络请求

    NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:s.detail_url]];

    [wv loadRequest:request];

 

    [vc.view addSubview:wv];

 

 

 

posted @ 2015-09-21 19:41  十九_黄  阅读(173)  评论(0)    收藏  举报