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++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -