Is that possible to add a subclassed UIButton to XCode 4.5 Interface Builder Object Library, but as Custom Object?
Here you can find the small sample project:
https://www.dropbox.com/s/ioucpb6jn6nr0hs/blabla1.zip
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It isn’t possible to add new objects to the Interface Builder Object Library, but you can drag a regular UIButton out, and change the Custom Class property to you custom class name in the 3rd tab of the Identity Inspector. You wont see any of your customizations in the xib file though.
I took a look at your sample code. In the BlaButtonVC.m you have the method
This doesn’t get called when you’re initing from the xib. You need to add the code in that method to
I tested it and it worked.
As an aside, I don’t think BlaButtonVC is a good name, because it implies that your class is a view controller, when it is actually a view (unless VC stands for something else in your project).