tag:blogger.com,1999:blog-3509978114633708798.post4863236388782060046..comments2022-03-29T16:56:00.086-07:00Comments on Random Snippets: Objective C/Xcode 4: How to label and internationalize a Round Rect Button (UIButton) programaticallystphnhttp://www.blogger.com/profile/01031559330515056587noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-3509978114633708798.post-33170928933853979532011-08-10T09:18:29.803-07:002011-08-10T09:18:29.803-07:00Hey muguira,
make sure that you have your label&#...Hey muguira,<br /><br />make sure that you have your label's outlet set to myButton1 in Interface Builder. Then it should work to set the title as described above.<br /><br />Let me know if that helped.stphnhttps://www.blogger.com/profile/01031559330515056587noreply@blogger.comtag:blogger.com,1999:blog-3509978114633708798.post-53656307820121856412011-07-30T12:42:57.114-07:002011-07-30T12:42:57.114-07:00This is not working for me. I set the property as...This is not working for me. I set the property as<br /><br />@property (nonatomic, assign) IBOutlet UIButton *myButton1;<br /><br />but the title does not change when I synthesize then call the setTitle method as shown above. It only works if I call the IBAction method for the button and use the sender id like this<br /><br />[sender setTitle:@"Howdy" forState:UIControlStateNormal];<br /><br />Could it be that I have set something incorrectly in the Interface Builder? I also tried<br /><br />UIButton* button = (UIButton *)[self.view viewWithTag:9];<br />[button setTitle:@"Howdy" forState:UIControlStateNormal];<br /><br />in the IBAction method of another button. I would like to be able to change the title of this button in another method. <br /><br />Any suggestions would be greatly appreciated.muguirahttps://www.blogger.com/profile/14444789099948186970noreply@blogger.com