adding image to a button in other View

2019-08-12 15:56发布

In my app i have two view controllers and have table view in both.Both table view have certain button showing certain images .Now i am trying to set a new image to a button in view B through view A using UIPopOverController.for this i created an object of class B and then done like this.

[ObjB.button setImage:[UIImage imageNamed:@"1.png" forstate:UIControlStateNormal];

but i am not able to get the new image on the button.What could be the possible reason.Please help.Any help will be appreciated.

Thanks, Christy

1条回答
趁早两清
2楼-- · 2019-08-12 16:27

when you are going from popovercontroller to View B retain the B controllers object.

查看更多
登录 后发表回答