我需要一点帮助,我有一个搜索字段和按钮来触发这个方法,但我在下面得到了错误。
- (IBAction)fetchTracks:(id)sender {
NSString *input = [searchField stringValue];
NSString *searchString = [input stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"searchString: %@", searchString);
NSError *error;
NSString* libraryPath = [[NSString alloc] initWithString:@"~/Music/iTunes/iTunes Music Library.xml"];
NSURL *url = [NSURL URLWithString:libraryPath];
[doc release];
doc = [[NSXMLDocument alloc] initWithContentsOfURL:url options:0 error:&error];
NSLog(@"doc: %@", doc);
[itemNodes release];
itemNodes = [[doc nodesForXPath:@"ItemSearchResponse/Items/Item" error:&error] retain];
[tableView reloadData];
}
*-[NSXMLDocument initWithContentsOfURL:选项:错误:]:无参数
有人能帮忙吗,谢谢,萨米。