EnjoySR / ESJsonFormat-Xcode

将JSON格式化输出为模型的属性
MIT License
2.13k stars 351 forks source link

作者速度飞快!赞!Swift 第一版问题 #7

Closed androidcn closed 9 years ago

androidcn commented 9 years ago

json 数据 http://www.jisilu.cn/jisiludata/sfnew.php?___t=1433258531432

生成 数据:

var total: Int? = 0

var rows: [Rows]?

var page: Int? = 0

}

class Rows: NSObject {

var id: String?

var cell: Cell?

}

class Cell: NSObject {

var upper_recalc_price: String?

var a_amount_increase_rt: String?

var fund_company_nm: String?

var recalc_to: String?

var calc_info: String?

var base_fund_nm: String?

var base_est_dis_rt: String?

var coupon_descr_s: String?

var min_apply_amount: String?

var manage_fee: String?

var fully: String?

var coupon: String?

var apply_fee: String?

var fund_descr: String?

var mtrade: String?

var coupon_descr: String?

var last_chg_dt: String?

var base_est_dis_rt_tip: String?

var issue_dt: String?

var fundA_nm: String?

var active_fl: String?

var fundA_id: String?

var coupon_next: String?

var fundB_nm: String?

var apply_fee_tip: String?

var redeem_fee: String?

var mujiprice: String?

var fundB_id: String?

var price: String?

var maturity_dt: String?

var redeem_fee_tip: String?

var lower_recalc_price: String?

var mujidate: String?

var left_year: String?

var index_nm: String?

var abrate: String?

var a_amount: String?

var a_ratio: String?

var coupon_next2: String?

var index_id: String?

var asset_ratio: String?

var base_lower_recalc_rt: String?

var base_fund_id: String?

var lower_recalc_comment: String?

var notes: String?

var next_recalc_dt: String?

var market: String?

var b_ratio: String?

var b_gangan: String?

var status_cd: String?
EnjoySR commented 9 years ago

能具体描述一下遇到的问题嘛,是数据不全?还是数据格式不对?

androidcn commented 9 years ago

@EnjoySR 我直接把JSON数据粘贴到输入框获取的最后数据 就是这样的

Cell的类 前后括号丢失 Root 的Class 也不见了 不完整

EnjoySR commented 9 years ago

你光标是停留在root class的后面括号" } "的上面嘛?还是?

androidcn commented 9 years ago

抱歉!没看清说明~ 我以为会生成完整的Class 我一行代码也没写 当然也就没有root Class了

建议 直接生成完整的Root Class

EnjoySR commented 9 years ago

RootClass文件一般都是自己建的,然后名字也是自己取的,里面的属性是json决定的,如果要插件生成RootClass文件的话,class顶部的一些注释里面东西有一部分我暂时还没取到。正在努力中。谢谢你的建议。多测试,有问题直接Issues我。