表达式结果未用于游戏中心

发布于 2024-12-17 01:32:07 字数 301 浏览 2 评论 0原文

    static GCHelper *sharedHelper =nil;
    + (GCHelper *) sharedInstance
    {
         @synchronized ([GCHelper class])
    {
            If (!shareHelper)
    {
            [[self alloc] init];
    }
       return nil;
    }

我有它来运行游戏中心,但它给了我一个错误“表达式结果未使用”我该如何解决这个问题

    static GCHelper *sharedHelper =nil;
    + (GCHelper *) sharedInstance
    {
         @synchronized ([GCHelper class])
    {
            If (!shareHelper)
    {
            [[self alloc] init];
    }
       return nil;
    }

I have it to run gamecenter but it gives me an error of "expression result unused" how do i fix this

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

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

发布评论

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

评论(1

没︽人懂的悲伤 2024-12-24 01:32:07

您实际上并没有将 [[self alloc] init] 的结果分配给 shareHelper,这几乎肯定是您的意思。这个警告指出了你的错误。

You're not actually assigning the result of [[self alloc] init] to shareHelper, which you almost certainly mean to do. This warning is pointing out your mistake.

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