2017-01-11 6 views
0

realm Swiftを使用してJSONを解析しようとしています。応答realm swiftのJsonファイルでプロパティ名 "description"を解析できません

{ 
    code = 1; 
    data =  { 
     subjects =   (
         { 
       code = 786; 
       description = "not a good deal"; 
       id = 13; 
       name = "Mechine Learning in iOS"; 
      } 
     ); 
    }; 
    message = success; 
} 

ここでは、このjsonを解析するための私の迅速なファイルです。

Getter for 'description' with Objective-C selector 'description' conflicts with getter for 'description' from superclass 'NSObject' with the same Objective-C selector. 

は、明示的にkey valueを使用せずに、ここにdescriptionを解析する方法はあります:

import UIKit 
import RealmSwift 
import Realm 
class Subject: Object 
{ 
    @objc dynamic var id: Int = 0 
    @objc dynamic var code: String! 
    @objc dynamic var name: String! 
    @objc dynamic var description: String! 

     override class func primaryKey() -> String? { 
      return "id" 
     } 
} 

我々はdescriptionが迅速にキーワードであるので、それは、このエラーが表示されていることを知っていますか?インストーラで>ターミナルユーティリティ - 開くことができ、あなたのマシンの日時を更新するには、マシンの

  1. 更新日
  2. 使用代替USBポート

+0

インストーラファイルが壊れているようです。再ダウンロードしてみてください。 –

答えて

0

は2 soutionsを発見しました現在の日時をコマンドdateでチェックし、間違っている場合はコマンドを使用してください。ntpdate -u time.apple.com

Note that you has to be connected to the internet or use the command date with timestamp to set the datetime manually

関連する問題