Hello guys, my app is working (almost...) the way I want it to, but I want to have a 0 error/warning app and I can't figure this one out..
My code:
Code:
@implementation VideoController
-(void)awakeFromNib
{
NSString *dataFilePath = [[NSBundle mainBundle] pathForResource:@"video" ofType:@"xml"];
stories = [[NSMutableArray alloc]init];
parser = [[NSXMLParser alloc] initWithData:[NSData dataWithContentsOfFile:dataFilePath]];
[parser setDelegate:self];
[parser parse];
NSLog(@"file trovato e caricato");
}
The warning, applying to the line above "[parser setDelegate:self];", is actually double:
Quote:
|
Class 'VideoController' does not implement the 'NSXMLParserDelegate' protocol
|
Quote:
|
Sending 'VideoController' to parameter of incompatible type 'id<NSXMLParserDelegate>'
|
I guess this part of the NSXMLParser.h file might relate to the above, since Xcode indicates it under Semantic issue relating to the warning "Sending...":
"- (void)setDelegate

id <NSXMLParserDelegate>)delegate;" as follows:
Quote:
|
1. Passing argument to parameter 'delegate' here
|
...and this is the context (in the .h file)
Code:
@interface NSXMLParser : NSObject {
@private
void * _parser;
id _delegate;
id _reserved1;
id _reserved2;
id _reserved3;
}
- (id)initWithContentsOfURL:(NSURL *)url; // initializes the parser with the specified URL.
- (id)initWithData:(NSData *)data; // create the parser from data
// delegate management. The delegate is not retained.
- (id <NSXMLParserDelegate>)delegate;
- (void)setDelegate:(id <NSXMLParserDelegate>)delegate;
What am I missing here? I am programming trial & error and am a total noob, so I will be very grateful for instruction in plain words, thanks a million