Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将任意属性附加到在编辑器中创建的 UIKit 控件。这可能吗?当我尝试时,我得到了臭名昭著的错误:
NSUnknownKeyException: [<UISwitch 0x9d79140> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key hello.
这让我说不,但如果可能的话,它真的会清理一些东西。
我会尝试以下方法之一:
setValue:forUndefinedKey:
setValue:forKey: