10

我刚刚更新到 Xcode 6,现在在 FacebookSDK.framework > Headers > FBOpenGraph.h 我有 2 个警告,其中一个读取

'atomic' attribute on property 'description' does not match the property inherited from NSObject

第二个读

'copy' attribute on property 'description' does not match the property inherited from NSObject

代码中第 69 行的这两个警告我在该行上方添加了一条注释 这是我正在使用的 .h 文件

    /*
 * Copyright 2010-present Facebook.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#import <Foundation/Foundation.h>

#import "FBGraphObject.h"

/*!
 @protocol

 @abstract
 The `FBOpenGraphObject` protocol is the base protocol for use in posting and retrieving Open Graph objects.
 It inherits from the `FBGraphObject` protocol; you may derive custome protocols from `FBOpenGraphObject` in order
 implement typed access to your application's custom objects.

 @discussion
 Represents an Open Graph custom object, to be used directly, or from which to
 derive custom action protocols with custom properties.
 */
@protocol FBOpenGraphObject<FBGraphObject>

/*!
 @property
 @abstract Typed access to the object's id
 */
@property (retain, nonatomic) NSString              *id;

/*!
 @property
 @abstract Typed access to the object's type, which is a string in the form mynamespace:mytype
 */
@property (retain, nonatomic) NSString              *type;

/*!
 @property
 @abstract Typed access to object's title
 */
@property (retain, nonatomic) NSString              *title;

/*!
 @property
 @abstract Typed access to the object's image property
 */
@property (retain, nonatomic) id                    image;

/*!
 @property
 @abstract Typed access to the object's url property
 */
@property (retain, nonatomic) id                    url;

/*!
 @property
 @abstract Typed access to the object's description property
 */
 //*******************************************
//the line below this is where the warnings are
//&*********************************************
@property (retain, nonatomic) id                    description;

/*!
 @property
 @abstract Typed access to action's data, which is a dictionary of custom properties
 */
@property (retain, nonatomic) id<FBGraphObject>     data;

@end

当我运行我的应用程序时,我也收到此错误,不确定这意味着什么

registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.

在此处输入图像描述

我在这里先向您的帮助表示感谢!!!

4

5 回答 5

7

我有同样的问题。

所以我description改为copy

然后descriptionatomic

没有更多警告,您也可以尝试上传新的 Facebook.SDK,因为他们可能已经更改了它

没问题

于 2014-10-15T02:30:54.263 回答
5

将 Facebook SDK 更新到最新版本应该可以解决您的问题,您可能正在使用尚未为 iOS 8 SDK 做好准备的旧版本

在此处下载 - https://developers.facebook.com/docs/ios

安装新的 FB SDK 后,您应该只清理项目并再次构建而不会出现错误

于 2014-09-24T08:49:24.640 回答
2

我只是通过注释掉属性来修复警告

这些警告来自 FBOpenGraphObject.h。如果您检查生成它们的行,您将看到 description 属性无论如何都已贬值,并且应该使用 objectDescription。

@property (retain, nonatomic) id      Description __attribute__ ((deprecated("use objectDescription instead")));

我建议你只遵循 FB 的建议。很可能无论如何您都没有使用此属性。就我而言,由于我没有使用它,因此注释掉该属性会删除警告。

希望能帮助到你。

于 2014-10-02T20:01:50.957 回答
1

转到 ~/Library/Developer/Xcode 并删除 Xcode 目录的全部内容(请注意那里有一些 Xcode 档案等,因此请确保您不会丢失任何您需要的东西)。

于 2014-09-19T11:58:29.393 回答
1

刚刚禁用了这个警告

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 
@property (retain,  atomic) id description __attribute__ ((deprecated("use objectDescription instead")));
#pragma clang diagnostic pop
于 2015-01-29T08:11:33.690 回答