There are some image resources in my Images.xcassets. Recently they cannot be displayed in the app when testing in the iPhone/iPad devices.
I guess they are not copied to the Bundle when build and package. Then i check the Copy Bundle Resources in Build Phases. The Images.xcassets is in here. One weird situation is it works well in simulators, but failed in the real devices. For a clean test, every time i will delete the app and then run again.
Some of snippets are as below:
UIButton *button_Share = [[UIButton alloc]initWithFrame:CGRectMake(13,33,64,20)];
[button_Share setBackgroundColor:[UIColor clearColor]];
[button_Share setUserInteractionEnabled:YES];
[button_Share setImage:[UIImage imageNamed:@"share_btnM@2x.png"] forState:UIControlStateNormal];
[button_Share addTarget:self action:@selector(click_Share) forControlEvents:UIControlEventTouchUpInside];
[imageview_ButtonBg addSubview:button_Share];
UIButton *button_AddTo = [[UIButton alloc]initWithFrame:CGRectMake(112,33,97,20)];
[button_AddTo setBackgroundColor:[UIColor clearColor]];
[button_AddTo setUserInteractionEnabled:YES];
[button_AddTo setImage:[UIImage imageNamed:@"add_cart_btnM@2x.png"] forState:UIControlStateNormal];
[button_AddTo addTarget:self action:@selector(click_AddToCart) forControlEvents:UIControlEventTouchUpInside];
[imageview_ButtonBg addSubview:button_AddTo];
UIButton *button_Buy = [[UIButton alloc]initWithFrame:CGRectMake(243,33,64,20)];
[button_Buy setBackgroundColor:[UIColor clearColor]];
[button_Buy setUserInteractionEnabled:YES];
[button_Buy setImage:[UIImage imageNamed:@"buynow_btnM@2x.png"] forState:UIControlStateNormal];
[button_Buy addTarget:self action:@selector(click_Buy) forControlEvents:UIControlEventTouchUpInside];
[imageview_ButtonBg addSubview:button_Buy];
images in the image set are as below:
Any help would be appreciated.