objective c - why does this code keep coming up with errors. xCode 4.6 -


nsimagecell *imagefrombundle;      nsdata *imagedata;      nsurl *imageurl = [nsurl urlwithstring:@"http://www.greatwhatsit.com/wp-content/uploads/2012/03/jeremiah1.jpg"];      nslog(@"url");      nslog(@"data");      nsimage *imagefrombundle = [[nsimage alloc] initwithdata:imagedata];  

why doesn't code work. xcode 4.6

you have have same type definition , init of imagefrombundle

nsimagecell *imagefrombundle; nsimage *imagefrombundle = [[nsimage alloc] initwithdata:imagedata]; 

change to:

nsimage *imagefrombundle; nsimage *imagefrombundle = [[nsimage alloc] initwithdata:imagedata]; 

also, zakhej sais, need init imagedata


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -