Skip to content

Commit

Permalink
iOS: Fixed all bugs in Dropbox Sync prototype.
Browse files Browse the repository at this point in the history
Related to issue #405.
  • Loading branch information
ycastonguay committed Oct 16, 2013
1 parent 1d55763 commit fa2629e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions MPfm/MPfm.iOS/Classes/Controllers/SyncCloudViewController.cs
Expand Up @@ -52,6 +52,8 @@ public override void ViewDidLoad()

DBError error = null;
var account = DBAccountManager.SharedManager.LinkedAccount;

// TODO: account will be null when the user delogs out
_store = DBDatastore.OpenDefaultStoreForAccount(account, out error);
if(error != null)
throw new Exception(error.Description);
Expand Down Expand Up @@ -137,7 +139,11 @@ public override void ViewWillAppear(bool animated)
DBError error = null;

var table = _store.GetTable("stuff");
var records = table.Query(NSDictionary.FromObjectAndKey(new NSString("hello"), new NSString("world")), out error);
//var record = table.GetRecord("H8f7Q9JRhAkzzzmBa-dDww", out error);
var records = table.Query(null, out error);
if(error != null)
throw new Exception(error.Description);

if (records.Length == 0)
{
lblValue.Text = "No value!";
Expand Down Expand Up @@ -199,13 +205,8 @@ public override void ViewWillAppear(bool animated)
try
{
DBError error = null;
var account = DBAccountManager.SharedManager.LinkedAccount;
_store = DBDatastore.OpenDefaultStoreForAccount(account, out error);
if(error != null)
throw new Exception(error.Description);

var table = _store.GetTable("stuff");
var records = table.Query(NSDictionary.FromObjectAndKey(new NSString("hello"), new NSString("world")), out error);
var records = table.Query(null, out error);
if (records.Length == 0)
{
lblValue.Text = "No value!";
Expand Down

0 comments on commit fa2629e

Please sign in to comment.