tags:

views:

46

answers:

1

after nsXml pasring value of my NSMutable array AB

=\n\n\n\thttp://xyz.com/uploads/resto_6298__20091209@1621_250.JPG\n\thttp://xyz.com/uploads/resto_6298__200912099_2_250.JPG\n"

now i am doing this to make this url working

NSString *sw=AB;


NSArray *strings = [sw componentsSeparatedByString: @"\n\t"];
NSLog(@"what I have %@",strings);

but my app always crash and i am getting this error

[NSCFArray componentsSeparatedByString:]: unrecognized selector sent to instance 0x1b28b0
2010-10-05 10:17:31.382 Wat2Eat[2311:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFArray componentsSeparatedByString:]: unrecognized selector sent to instance 0x1b28b0'

how to parse this AB so that i can extract exact URL

A: 

NSString *sw=AB;

AB is an NSMutableArray? the compiler should print a warning if you try to do this. You tried to assign an NSArray to an NSString. This will not work.

Did you mean NSString *sw = [AB objectAtIndex:foo]; ?

fluchtpunkt
i just want to extract exact URL from AB
prajakta
wow NSString *sw = [AB objectAtIndex:0] worked perfectly thanks a lot
prajakta