gpt4 book ai didi

ios - 类扩展 'AppDelegate' 中属性的非法重新声明(属性必须是 'readwrite' ,而它的主要属性必须是 'readonly' )

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:36:56 28 4
gpt4 key购买 nike

我移动了这一行:

@property (nonatomic, retain) IBOutlet UIWindow *window;

进入我的 App Delegate 中的类扩展,但现在出现此错误:

Illegal redeclaration of property in class extension 'AppDelegate' (attribute must be 'readwrite', while its primary must be 'readonly')

.m 文件中的完整代码如下所示:

@interface AppDelegate()
@property (nonatomic, retain) IBOutlet UIWindow *window;
@end

有什么问题?

最佳答案

您粘贴的代码重量较轻,无法分析问题。

但是,根据我的猜测,您可能可以从 .m 文件中删除声明。

您可以在以下链接中找到更多信息。

Objective-C : (private / public properties) making a property readonly for outside class calls and readwrite for self calls

关于ios - 类扩展 'AppDelegate' 中属性的非法重新声明(属性必须是 'readwrite' ,而它的主要属性必须是 'readonly' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28993921/

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