NSInvocation object not getting allocated iphone sdk

Posted by neha on Stack Overflow See other posts from Stack Overflow or by neha
Published on 2010-06-11T13:05:05Z Indexed on 2010/06/11 13:12 UTC
Read the original article Hit count: 255

Filed under:
|
|

Hi all,

I'm doing

        NSString *_type_ = @"report";
        NSNumber *_id_ = [NSNumber numberWithInt:report.reportId];

        NSDictionary *paramObj = [NSDictionary dictionaryWithObjectsAndKeys:
                                _id_, @"bla1", _type_, @"bla2",nil];

_operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(initParsersetId:) object:paramObj];

But my _operation object is nil even after processing this line.

The selector here is actually a function I'm writing which is like:

-(void)initParsersetId:(NSInteger)_id_ type:(NSString *)_type_
{   
NSString *urlStr = [NSString stringWithFormat:@"apimediadetails?id=624&type=report"];
NSString *finalURLstr = [urlStr stringByAppendingString:URL];
NSURL *url = [[NSURL alloc] initWithString:finalURLstr];

NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url];

//Initialize the delegate.
DetailedViewObject *parser = [[DetailedViewObject alloc] initDetailedViewObject];

//Set delegate
[xmlParser setDelegate:parser];

//Start parsing the XML file.
BOOL success = [xmlParser parse];

if(success)
    NSLog(@"No Errors");
else
    NSLog(@"Error Error Error!!!"); 

}

Can anybody please point out wheather where I'm going wrong.

Thanx in advance.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk