protected override void PopulateData(string json) { try { MasterShortTips shortResults = JsonReader.Deserialize <MasterShortTips>(json); if (shortResults.results.Length > 0) { Data = shortResults.results; } else { Debug.LogError("TipsEntry: results empty from server"); return; } } catch { Debug.LogError("TipsEntry: error populating object"); } base.PopulateData(json); }
private void OnGetHealthyTipsListSuccess(string json) { HelperMethods.ResultReponseObject result = JsonFx.Json.JsonReader.Deserialize <HelperMethods.ResultReponseObject>(json); // The retrieved list could be empty if (result.total_count == 0) { Debug.Log("Empty list: resetting offset and fetching more tips"); // The user should start seeing the old tips again. Tipses.Clear(); GetHealthyTipsList(0); } else { MasterShortTips shortResults = JsonReader.Deserialize <MasterShortTips>(json); GetHealthyTipToView(); } if ("[]" == json) { } else { } }