中等blob通过json uiimage

时间:2014-02-10 22:54:43

标签: php iphone objective-c json blob

我在mysql数据库中有一个中等blob字段,我想用json将它拉到UIImage我试过这个:

<?php

   $con=mysql_connect("localhost","root","");
   mysql_select_db("PictureBox",$con);

   include("get_pic_data.php");

   $pic_data=new PicData;
   $pic_id=$_GET['pic_id'];

   $blob=$pic_data->get_pic_blob($pic_id);//this method returns the the medium blob from database
   $array=array();

   array_push($array, $blob);

   echo json_encode($array);

   mysql_close($con);
?>

我有这些我不知道该做什么

-(UIImage *)getPicture:(int)picId{
    NSString *urlString=@"http://localhost/iospicturebox/picture/get_pic_blob.php";
    NSString *setParameter=[NSString stringWithFormat:@"%d",picId];
    NSMutableArray *array=[jsonCon jsonConnectionArray:urlString :@"pic_id" :setParameter];

    //UIImage *img=[[UIImage alloc]initWithData:array objectAtIndex:0]];

    return img;
   }

0 个答案:

没有答案