What are UILabel's initWithCoder encoded keys?
I have a subclass of a UILabel that overloads initWithCoder and I was wondering if anyone has any documentation on how the coder is encoded so that I might be able to get information that comes from IB myself.
Thanks.
EDIT
Reason for doing this: I would like the font name given in the xib file. Apple's implementation of initWithCoder disregards the font name given in the file if it's a cu开发者_Python百科stom font and when you go to access the label's font, it returns the system font. Therefore I'd like to catch the font name before the original initWithCoder ignores it.
Looking through the documentation, there does not appear to be a way to retrieve all the keys used in an NSKeyedArchiver
. One way "around" this is to archive your custom UILabel to an NSData object, write the data object out to a file, and then pop it open in a text editor and see if you can find some of the keys that way.
What information do you need from the UILabel that you can't access through its normal accessors?
If you look at the nib file compiled from the xib file for the interface you wanna decode, you'll be able to make out some of the keys you can use. It's kind of hard to find stuff, but it's better than nothing.
精彩评论