NSData dataWithContentsOfURL?

The method dataWithContentsOfURL take a NSURL as argument not a NSString.

The method dataWithContentsOfURL take a NSURL as argument not a NSString NSData dataWithContentsOfURL:NSURL URLWithString:@"

".

It expects an NSURL as argument, not a string. UIImage *image = UIImage imageWithData: NSData dataWithContentsOfURL: NSURL URLWithString:@"

"; EDIT: To test if the data has loaded succesfully try something like NSError* error = nil; NSData* data = NSData dataWithContentsOfURL:yourURL options:NSDataReadingUncached error:&error; if (error) { NSLog(@"%@", error localizedDescription); error release; } else { NSLog(@"Data has loaded successfully. "); }.

Actuall in my code I am deriving url from { NSURL *jsonURL = NSURL URLWithString:jsonItem objectForKey:@"PictureURL"; } {NSLog(@"%@",jsonItem objectForKey:@"PictureURL");} is also printing correct url but when using code { UIImage *image = UIImage imageWithData: NSData dataWithContentsOfURL: NSURL URLWithString:string;} error is displayed (already explained) – ketan rajput 11-03-147 at 8:26 Hm, that doesn't make sense. What is the exact error message you get after calling UIImage *image = UIImage imageWithData: NSData dataWithContentsOfURL: NSURL URLWithString:string;? – hennes 11-03-147 at 9:25 when I tried this: UIImage image = UIImage imageWithData: NSData dataWithContentsOfURL:jsonItem objectForKey:@"PictureURL"; it giving error :2011-03-14 15:19:42.119 XML8388:20b *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '** -NSCFString isFileURL: unrecognized selector sent to instance 0xd54bc0' 2011-03-14 15:19:42.121 XML8388:20b Stack: ( 807902715, ) – ketan rajput 11-03-147 at 9:49 You need to call UIImage image = UIImage imageWithData: NSData dataWithContentsOfURL:NSURL URLWithString:jsonItem objectForKey:@"PictureURL"; – hennes 11-03-147 at 9:52 when I tried this code, it passing null into image!2011-03-14 15:23:50.999 XML8447:20b image....(null) 2011-03-14 15:23:51.000 XML8447:20b width.....0.000000,height.....0.000000 – ketan rajput 11-03-147 at 9:52.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions