나는 간단한 RSS 리더가 있습니다. 스토리가 다운로드되어 UITableView에 저장되고 클릭하면 각 스토리가 UIWebView에로드됩니다. 그것은 위대한 작품. 이제 YouTube 앱에서 볼 수있는 것처럼 왼쪽에 이미지를 통합하고 싶습니다. 그러나 내 응용 프로그램은 RSS 피드에서 끌어 오기 때문에 X 행이 내일 Y 행이 될 것이므로 행 X에 이미지 X가 나타나도록 지정할 수는 없습니다. 현재 YouTube RSS feed에서 가져 왔으며 동영상 제목, 설명, 게시 날짜를 얻을 수 있지만 피드의 각 항목 외에 작은 미리보기 이미지를 가져 오는 방법에 관해서는 고민하고 있습니다.iPhone RSS 미리보기
아마 내가 말할 수 있듯이, 저는 코딩 초보자입니다. (이것은 Hello World 앱이 아닌 첫 번째 애플리케이션입니다.) 나는 지식이 부족하여 너무 좌절하고 있습니다.
감사합니다. 내가 XML 구문 분석에 대한 TouchXML을 시도하는 것이 좋습니다
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{
//NSLog(@"found this element: %@", elementName);
if (currentElement) {
[currentElement release];
currentElement = nil;
}
currentElement = [elementName copy];
if ([elementName isEqualToString:@"item"]) {
// clear out our story item caches...
item = [[NSMutableDictionary alloc] init];
currentTitle = [[NSMutableString alloc] init];
currentDate = [[NSMutableString alloc] init];
currentSummary = [[NSMutableString alloc] init];
currentLink = [[NSMutableString alloc] init];
}
}
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
//NSLog(@"ended element: %@", elementName);
if ([elementName isEqualToString:@"item"]) {
// save values to an item, then store that item into the array...
[item setObject:currentTitle forKey:@"title"];
[item setObject:currentLink forKey:@"link"];
[item setObject:currentSummary forKey:@"summary"];
[item setObject:currentDate forKey:@"date"];
[stories addObject:[item copy]];
NSLog(@"adding story: %@", currentTitle);
}
}
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
//NSLog(@"found characters: %@", string);
// save the characters for the current item...
if ([currentElement isEqualToString:@"title"]) {
[currentTitle appendString:string];
} else if ([currentElement isEqualToString:@"link"]) {
[currentLink appendString:string];
} else if ([currentElement isEqualToString:@"description"]) {
[currentSummary appendString:string];
} else if ([currentElement isEqualToString:@"pubDate"]) {
[currentDate appendString:string];
}
}
흠. 필자가 볼 수있는 가장 쉬운 방법은 paradadStart에서 attributeDict를 사용하는 것입니다. 왜냐하면 이것이 나머지 모든 코드를 설정하는 방법이기 때문입니다. 누구든지 미디어의 URL 속성 인 썸네일을 추출하는 코드를 도울 수 있습니까? 개발자 문서 : http://preview.tinyurl.com/cmhzch YouTube API : http://preview.tinyurl.com/az7tek –