I have a problem that I don't quite understand.
The following code fails to compile because of the following two errors:
If I change the method to not return anything (void) it works fine. How come?
From XMLParser.m:
From XMLParser.h:
The following code fails to compile because of the following two errors:
"error: can not use an object as parameter to a method"
"error: incompatible types in return"
If I change the method to not return anything (void) it works fine. How come?
From XMLParser.m:
Code:
- (NSMutableArray)parseNodeData:(NSString *)url {
NSURL *urlObj = [[NSURL alloc] initWithString:url];
NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:urlObj];
self.nodes = [[NSMutableArray alloc] init];
[parser setDelegate:self];
[parser setShouldProcessNamespaces:NO];
[parser setShouldReportNamespacePrefixes:NO];
[parser setShouldResolveExternalEntities:NO];
[parser parse];
NSLog(@"Proceeded from parser.");
[parser release];
return self.nodes;
}
From XMLParser.h:
Code:
- (NSMutableArray)parseNodeData:(NSString *)data;