這是我從任何URL JSON
文本http://www.example.com/json.php解析JSON在Qt的C++黑莓10
請任何一個可以告訴我,我該如何解析這個JSON並把它放在一個陣列,以便它可以是模式的定製化的ListView ?
讓我告訴你,我是以前iOS開發者的黑莓開發新手。
我檢查了這個link,但無法運行它。
如果任何人有任何完整的解決方案(例子或用法),請幫助我。
我從developer.blackberry.com下載了JSON
的樣本,但無法運行。
我還張貼在此link
{
"status": "success",
"result": [
{
"offer_id": "456",
"member_id": "648",
"offer_type": "printable",
"cat_name": "Health & Wellbeing",
"price": "50",
"discount": "20% Off.",
"title": "20% Off",
"quantity": "200",
"details": "Enjoy 20% Off any Service.",
"coupon_code": "45600010106",
"company_logo": "http://beta/files/offers/logos/",
"offer_image": "http://beta/files/offers/images/f4d118737e_image_456.jpg",
"bc_image": "http://beta/files/offers/qrcodes/qrcouponid_45600010106.png",
"company_address1": "Oud Metha - Mohammed Saeed Hareb Bldg. Opp. American Hospital",
"company_address2": "Not Available",
"company_city": "Not Available",
"company_phone": "04 357 6738 Mob: 509284567",
"location": "Oud Metha",
"company_name": "Golden House Gents Spa Club",
"merchant_name": "Golden House Gents Spa Club",
"url": "http://google.com",
"date_end": "2013/12/30",
"date_start": "2013/07/25",
"condition": "1. Cannot be Combined with any other offer.\r\n2. Advance booking required.\r\n3. This Voucher must be Mentioned during time of Booking.\r\n4. Not Valid on Thurs & Sat.\r\n5. Expires 31st December 2013.",
"rating": "0",
"latitude": "25.2374",
"longitude": "55.3117"
}
]
}
如果我不想對數組進行排序。但我想顯示來自Web服務的結果。我試過這個GroupDataModel * model = new GroupDataModel();但是它向我展示了相反的順序 –
如果順序剛好顛倒過來而沒有指定鍵,那麼只需要顛倒sortedAscending #property-sortedascending)屬性。 –