我需要一点帮助,我有一个搜索字段和按钮可以触发此方法,但我得到了下面的错误。
- (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:options:error:]: 无参数
谁能帮忙,谢谢,萨米。