cannot response server.
nsmutabledictionary *dic =[[nsmutabledictionary alloc]init]; nsmutableurlrequest *request = [[nsmutableurlrequest alloc] init] ; nsstring *strvideo=[nsstring stringwithformat:@"https://player.vimeo.com/video/%@/config",arrvideoid[i]]; [request2 seturl:[nsurl urlwithstring:strvideo]]; [request2 sethttpmethod:@"get"]; nsdata *body2 = [self encodedictionary:dic2]; [request2 setvalue:[nsstring stringwithformat:@"%d", body2.length] forhttpheaderfield:@"content-length"]; [request2 setvalue:@"application/x-www-form-urlencoded" forhttpheaderfield:@"content-type"]; [request2 sethttpbody:body2]; nserror *error; nsurlresponse *resultresponse; nsdata *response2 = [nsurlconnection sendsynchronousrequest:request2 returningresponse:&resultresponse error:&error]; nsmutabledictionary *dictresult2 =[nsjsonserialization jsonobjectwithdata:response2 options:nsjsonreadingmutableleaves error:nil];
-(void)setimage { array = [[nsmutablearray alloc]init]; nsmutabledictionary *dictionary1 = [[nsmutabledictionary alloc]init]; [dictionary1 setvalue:@"img_home1.png" forkey:@"imagename"]; [array addobject:dictionary1]; nsmutabledictionary *dictionary2 = [[nsmutabledictionary alloc]init]; [dictionary2 setvalue:@"img_home2.png" forkey:@"imagename"]; [array addobject:dictionary2]; (int = 0; <= array.count; i++) { cgrect frame= cgrectzero; //self.scrollhomeview.frame; frame.origin.x = [[uiscreen mainscreen] bounds].size.width * i; frame.origin.y = 0; frame.size.width=[[uiscreen mainscreen] bounds].size.width; frame.size.height = [[uiscreen mainscreen] bounds].size.height-130; uiimageview *image = [[uiimageview alloc] initwithframe:frame]; image.contentmode= uiviewcontentmodescaleaspectfit; [self.scrollhomeview addsubview:image]; } self.scrollhomeview.contentsize = cgsizemake([[uiscreen mainscreen] bounds].size.width * array.count,self.scrollhomeview.frame.size.height-130); self.scrollhomeview.pagingenabled = yes; self.scrollhomeview.showshorizontalscrollindicator = no; self.scrollhomeview.showsverticalscrollindicator = no; self.scrollhomeview.scrollstotop = no; }
Comments
Post a Comment