In Objective-C, I have a category for the class:
@interface UILabel(CustomInit) - (id)initWithCoder:(NSCoder *)coder; @end
What I am doing is writing a custom init function that does some extra things, and what I would like to do in this custom init function is to call the UILabel initWithCoder database. Is it possible? Why so?
EDIT
Thanks. Okay, so my plans are controversial. Can't just overload initWithCoder. Is there a way to achieve the same functionality (where all UILabels get this added initialization step) without overloading initWithCoder? Or maybe there is a sample code for UILabel initWithCoder that I can just rewrite with the code added?
EDIT
Okay, so I want to say that I'm trying:
Can I embed my own font in an iPhone app?
has an answer in which someone manually adds a custom font to iphone using the private GraphicServices GSFontAddFromFile function. I tried this code and it worked great for manually setting the label font. However, if you try to install the font in Interface Builder, it does not load properly, it just drops to the system font. What I wanted to do was download the font manually and automatically set the font of the label with the selected font to IB. This way, I donβt need to issue every label that I put. I also do not need to write a funny label subclass (which was also suggested in this thread and makes a large amount of custom drawing), which I found pretty grotesque. Now I can still subclass all of my shortcuts, but then there is a case of inline labels in other user interface objects, i.e. UIButtons. I would like the inline labels not to be broken either.
Any suggestions would be great. Thanks.
source share