警告:由于原型的原因,传递了'objc_setProperty'的参数3 [英] warning: passing argument 3 of 'objc_setProperty' as signed due to prototype

查看:38
本文介绍了警告:由于原型的原因,传递了'objc_setProperty'的参数3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我激活所有警告之后,编译器对此有所抱怨:

The compiler complains about this, after I activated all kind of warnings:

我有一个这样的应用程序委托:

I have an app delegate like this:

#import <UIKit/UIKit.h>

@class MyViewController;

@interface TestAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    MyViewController *myViewController;
}

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

@end

在实现文件中,我具有合成代码:

In the implementation file, I have the synthesize code:

@synthesize window;
@synthesize rootViewController;

在实现文件的末尾,编译器抱怨:

At the end of the implementation file, the compiler complains:

At top level:
warning: passing argument 3 of 'objc_setProperty' as signed due to prototype
warning: passing argument 5 of 'objc_setProperty' with different width due to prototype
warning: passing argument 6 of 'objc_setProperty' with different width due to prototype
warning: passing argument 3 of 'objc_setProperty' as signed due to prototype
warning: passing argument 5 of 'objc_setProperty' with different width due to prototype
warning: passing argument 6 of 'objc_setProperty' with different width due to prototype

$而传递了具有不同宽度的'objc_setProperty'的参数6 b
$ b

是什么意思?我必须为此担心吗?

What does that mean? Must I worry about it?

推荐答案

是的-那是不对的。一点也不。您应该为此担心。

Yes -- that isn't right. Not at all. And you should worry about it.

当您在顶层收到这样的警告时,通常意味着您的头文件中有一些搞砸的错误导致以后出现问题。

When you have a warning like this at the top level, it generally means that there is something screwed up in your header files that is causing problems later.

所以,问题是什么?可能是某个地方的#define。可以是某物的先前声明,特别是某物的声明,试图修复通过#import正确的系统提供的标头可以适当修复的错误。

So, the question is, what? Could be a #define somewhere. Could be a previous declaration of something, specifically a declaration of something in an attempt to fix an error that would be appropriately fixed by #importing the correct system provided header.

添加发出这些警告的完整编译命令行(您可以在Xcode中找到它)。

Add the full compilation command line that spewed those warnings (you can find it in Xcode).

这篇关于警告:由于原型的原因,传递了'objc_setProperty'的参数3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆