Failure when adding images to a thumbnail gallery
morning all, I've been browsing around trying to work out what I've done wrong when trying to add a thumbnail to a gallery view, but can't work out what on earth it might be. I'm trying to use the following code to stick a thumbnail onto a blank view:
UIImageView *any = [[UIImageView alloc] initWithFrame:CGRectMake(a,b,70,60)];
any.image = [UIImage imageNamed:selectedThumbPath];
any.tag = 0;
[self.view addSubview:any];
In the above example:
a = 165
b = 150
selectedThumbPath = the full path to a thumbnail ie. /users/Cleverbum/library etc
I'm pulling my hair out, there are no error messages, and no clues as to开发者_开发知识库 why it's not drawing anything. What's worse is that this is one of the only parts of the code i've not changed!
I ran into a problem similar to this a while back. If I recall, imageNamed: only seemed to work on images in my project. Try looking into imageWithContentsOfFile: and pass it the NSFile from that path.
精彩评论