gpt4 book ai didi

ios - 在任何地方都找不到 UI_APPEARANCE_SELECTOR

转载 作者:行者123 更新时间:2023-12-01 19:19:21 26 4
gpt4 key购买 nike

UIAppearanceContainer 的 iOS 文档协议(protocol)引用 说:

"To participate in the appearance proxy API, tag your appearance property accessor methods in your header with UI_APPEARANCE_SELECTOR."



但是,例如,当我打开 UIButton.h 时,我找不到任何地方 UI_APPEARANCE_SELECTOR ,虽然我可以使用这样的东西没有问题:
    [[UIButton appearance] setBackgroundImage:[[UIImage imageNamed:@"UIButton"] resizableImageWithCapInsets:UIEdgeInsetsMake(5.0, 5.0, 5.0, 5.0)] forState:UIControlStateNormal];

谁能告诉我发生了什么:D?

最佳答案

-[UIButton setBackgroundImage:resizableImageWithCapInsets:]不是属性而是方法。因此,Apple 文档中的引用仍然有效。

UI_APPEARANCE_SELECTOR 是一个简单的#define,我想只是提示编译器使用@property 做一些特殊的事情。

关于ios - 在任何地方都找不到 UI_APPEARANCE_SELECTOR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11104622/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com