안녕하세요 저는 트위터를 표시하기 위해 내 응용 프로그램에서 회전 장치를 사용했습니다. 프로세스가의 ViewController 시간을 많이했다 만 표시 할, 그래서ICarousel보기 업데이트되지 않았습니다.
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{
if (!view)
{
//load new item view instance from nib
//control events are bound to view controller in nib file
view = [[[NSBundle mainBundle] loadNibNamed:@"Empty" owner:self options:nil] lastObject];
//[self performSelectorInBackground:@selector(loadthetweets) withObject:nil ];
//[self performSelectorInBackground:@selector(loadfromtheweb:) withObject:nil];
//[self performSelectorOnMainThread:@selector(loadthetweets) withObject:nil waitUntilDone:YES];
//[self performSelectorInBackground:@selector(loadthetweets) withObject:nil];
/*
NSString *[email protected]"http://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=shoplog1&count=20";
NSURL *feedURL =[NSURL URLWithString:feedname];
//The JSON Part
NSData *data =[NSData dataWithContentsOfURL:feedURL];
NSError* error;
_tweets= [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves
error:&error];
maintext=[[_tweets objectAtIndex:index]objectForKey:@"text"];
NSArray *piecesOfOriginalString = [maintext componentsSeparatedByString:@"http"];
NSString *firstetxt=[piecesOfOriginalString objectAtIndex:0];
NSLog(@"The first text: %@",firstetxt);
NSString *link=[@"http" stringByAppendingString:[piecesOfOriginalString objectAtIndex:1]];
linktogo=[NSURL URLWithString:link];
text.text=firstetxt;
NSLog(@"The link text: %@",link);
//NSDictionary *new =[[[tweets objectAtIndex:index]objectForKey:@"entities"]objectForKey:@"urls"];
NSDictionary *retweeted=[[_tweets objectAtIndex:index]objectForKey:@"retweeted_status"];
if (retweeted) {
NSString *urlll=[[[[_tweets objectAtIndex:index]objectForKey:@"retweeted_status"]objectForKey:@"user"]objectForKey:@"profile_image_url"];
NSURL *iiii=[NSURL URLWithString:urlll];
usericon.image=[UIImage imageWithData:[NSData dataWithContentsOfURL:iiii]];
username.text=[[[[_tweets objectAtIndex:index]objectForKey:@"retweeted_status"]objectForKey:@"user"]objectForKey:@"screen_name"];
}else{
[email protected]"Shoplog";
usericon.image=[UIImage imageNamed:@"MyIcon copy_57.png"];
}
*/
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
[Provideractivity startAnimating];
[ContentActivity startAnimating];
dispatch_queue_t concurrentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(concurrentQueue, ^{
[self loadthetweets];
//[self loadfromtheweb:[NSNumber numberWithUnsignedInt:index ]];
dispatch_async(dispatch_get_main_queue(), ^{
//[self loadfromtheweb:[NSNumber numberWithUnsignedInt:index ]];
maintext=[[_tweets objectAtIndex:index]objectForKey:@"text"];
NSArray *piecesOfOriginalString = [maintext componentsSeparatedByString:@"http"];
NSString *firstetxt=[piecesOfOriginalString objectAtIndex:0];
NSLog(@"The first text: %@",firstetxt);
NSString *link=[@"http" stringByAppendingString:[piecesOfOriginalString objectAtIndex:1]];
linktogo=[NSURL URLWithString:link];
text.text=firstetxt;
NSLog(@"The link text: %@",link);
//NSDictionary *new =[[[tweets objectAtIndex:index]objectForKey:@"entities"]objectForKey:@"urls"];
NSDictionary *retweeted=[[_tweets objectAtIndex:index]objectForKey:@"retweeted_status"];
if (retweeted) {
NSString *urlll=[[[[_tweets objectAtIndex:index]objectForKey:@"retweeted_status"]objectForKey:@"user"]objectForKey:@"profile_image_url"];
username.text=[[[[_tweets objectAtIndex:index]objectForKey:@"retweeted_status"]objectForKey:@"user"]objectForKey:@"screen_name"];
NSURL *iiii=[NSURL URLWithString:urlll];
usericon.image=[UIImage imageWithData:[NSData dataWithContentsOfURL:iiii]];
}else{
[email protected]"Shoplog";
usericon.image=[UIImage imageNamed:@"MyIcon copy_57.png"];
}
[ContentActivity stopAnimating];
[ContentActivity hidesWhenStopped];
[Provideractivity stopAnimating];
[Provideractivity hidesWhenStopped];
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
});
});
}
return view;
}
은 무엇입니까 트윗을 다운로드 할 때 내가 업데이트 할 뷰 컨트롤러, 다음 회전 목마보기를로드 할 수 GDC를 사용했다 여기서 잘못 가고있는 것은 회전 목마의 11 번째 요소가 올바르게 업데이트되고 나머지는 비어 있으며 그 이유는 모르겠다는 것입니다.
누군가 도울 수 있습니까?