'__strong'仅适用于objective-c对象或块指针类型;这里输入的是XXX“警告 [英] '__strong' only applies to objective-c object or block pointer types; type here is XXX" warning

查看:334
本文介绍了'__strong'仅适用于objective-c对象或块指针类型;这里输入的是XXX“警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到许多类型的警告:

i get many warnings of type:


'__ strong'仅适用于objective-c对象或块指针类型;这里输入的是...

'__strong' only applies to objective-c object or block pointer types; type here is...

警告指向框架标题。例如NSNotification,NSURL,NSIndexset等。

the warnings are pointing to framework headers. e.g NSNotification, NSURL, NSIndexset etc..

它们是什么以及如何修复它?

what are they and how can i repair it?

note 1:我使用ARC

note 1: i use ARC

注意2:该应用程序似乎正常工作

note 2: the app seems to work

编辑1:警告似乎源自我的pch文件。这是:

edit 1: the warnings seems to originate from my pch file. which is:

//
// Prefix header for all source files of the 'myapp' target in the 'myapp' project
//

#import <Availability.h>

#ifndef __IPHONE_5_0
     #warning "This project uses features only available in iOS SDK 5.0 and later."
#endif

#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
#endif

编辑2:
警告示例:
NSString.h中的警告指向:

edit 2: example of warning: warning in NSString.h point to:

/* Methods to convert NSString to a NULL-terminated cString using the specified encoding.     Note, these are the "new" cString methods, and are not deprecated like the older cString     methods which do not take encoding arguments.
*/
- (__strong const char *)cStringUsingEncoding:(NSStringEncoding)encoding; //"Autoreleased"; NULL return if encoding conversion not possible; for performance reasons, lifetime of this should not be considered longer than the lifetime of the receiving string (if the receiver string is freed, this might go invalid then, before the end of the autorelease scope)


推荐答案

似乎我已经解决了它。
出于某种原因我在项目本地文件夹中有一个带有标题的Framework文件夹。删除该文件夹并且警告消失了。我不知道该文件夹的创建方式和原因。 (我没有创建它。)

it seems i've solved it. for some reason i had a "Framework" folder with headers in my project local folder. removing that folder and the warnings are gone. i don't know how and why that folder was created. (i did not created it).

这篇关于'__strong'仅适用于objective-c对象或块指针类型;这里输入的是XXX“警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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