Reputation: 29
UIImage *img=[[UIImage alloc]initWithFrame:CGRectMake(50,50,145,20)];
img.image=[UIImage imageNamed:@"dollor.png"];
I get the error "Request for member image in something not a structure or union" for the above code could any one help.
Also i get the same eror for the code
img.tag=1;
Any help is appreciated
Upvotes: 0
Views: 535
Reputation: 26390
UIImage *img=[[UIImage alloc]initWithFrame:CGRectMake(50,50,145,20)];
should be
UIImageView *img=[[UIImageView alloc]initWithFrame:CGRectMake(50,50,145,20)];
Replace this and everything will be fine...
Upvotes: 1