0
에서 배열에 UIImages 추가 "- [있는 NSMutableArray은 insertObject : atIndex :] : 0 전무 개체를 삽입하는 시도 ''경로 '에서 내가 하드 코딩 된 경로를 (사용하는 경우엑스 코드 - RSS 피드의 URL 문제
' 코드) 이미지를 올바르게 추가합니다. RSS 피드에서 동일한 URL을 검색 할 때 작동하지 않습니다 (위의 오류).
간단한 평등 검사로 URL을 검사 해 보았는데 디버거 출력에있는 것처럼 보이지만 같지 않음을 나타냅니다.
메모리 관리에 대한 통찰력 또한 도움이 될 것입니다. 나는 플래시 작업 세계와 멍청한 놈부터 xcode (미안)에 올거야. 친구가 답을 찾을 나에게 도움이
- (void)viewDidLoad
{
[super viewDidLoad];
[self prepareGalleryLoad]; //sets up coverflow, waiting for data
NSString *xmlpath = @"http://mydomain.com/gallery3/index.php/rss/feed/gallery/album/12";
xmlreader = [[XMLReader alloc] init];
[xmlreader parseXMLFileAtURL:xmlpath];
NSMutableArray *imagearray = [[NSMutableArray alloc]init]; //array of images
NSMutableArray *imagearraycaptions = [[NSMutableArray alloc]init]; //array of captions for images
NSString *path;
NSString *pathfromrss;
UIImage *tempimage;
for (int y = 0; y < [xmlreader.stories count]; y++){
[imagearraycaptions addObject:[[xmlreader.stories objectAtIndex:y] objectForKey:@"title"]];
path = @"http://mydomain.com/gallery3/var/resizes/College-of-Nursing-and-Health-Studies/health10.jpg?m=1299713266";
pathfromrss = [NSString stringWithFormat:@"%@",[[xmlreader.stories objectAtIndex:y] objectForKey:@"link"]];
//DIAGNOSTIC check of path vs path temp.
if (path == pathfromrss){
NSLog(@"path is equal");
}else{
NSLog(@"path is not equal");
NSLog(@"%@",path);
NSLog(@"%@",pathfromrss);
}
//END DIAGNOSTIC path check
tempimage = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:path]]];
//tempimage is NIL when using "pathfromrss", works fine with "path"
if(tempimage){
[imagearray addObject:tempimage];
}
}
coverstext = imagearraycaptions; //coverflow uses this
covers = imagearray; //coverflow uses this
[self finishGalleryLoad];
}