Iphone – NSData datawithcontentsOfURL not working in the project

iphonensdata

While I m trying to get data from the URL it returns nil. But the same line works in other projects. I have tested it with by creating new project. My code is here

NSData *imgData=[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://image.projectnext.eu/RBXF_Icon.jpg"]];

it gets data perfectly in my test project but not working in needed project. Is there any settings to be enabled in my original project?

Best Answer

Make sure you have network connectivity -- either WiFI or over the phone network....