Rakesh
Rakesh

Reputation: 29

Request for member in something not a structure or union

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

Answers (1)

visakh7
visakh7

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

Related Questions