ARC静态接口问题

发布于 2024-12-28 21:12:57 字数 234 浏览 3 评论 0原文

我的属性中有以下内容,

@property (nonatomic,readonly) NSString itemName;

最初是只读的 == 复制,我正在尝试迁移到 ARC,所以尝试分配 ||很强,但都

因构建错误而失败:

接口类型不能静态分配

有人可以帮我吗我不明白这条消息?

I have the following in my property

@property (nonatomic,readonly) NSString itemName;

originally readonly == copy i'm trying to migrate to ARC so tried assign || strong but all failed

with build error:

Interface type cannot be statically allocated

Can someone help me out here I dont understand this message?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日裸衫吸 2025-01-04 21:12:57

您需要将其更改为:

@property (nonatomic,readonly) NSString* itemName;

您错过了星号,它可以正确地将其转换为 NSString 引用。

You need to change this to:

@property (nonatomic,readonly) NSString* itemName;

You're missing out the asterisk which correctly turns this into an NSString reference.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文