IPhone Sync Sample Not Working RRS feed

  • Question

  • I am trying to setup IPhone List Sample for testing. when i run the Sample. termination sample. 

    Terminating app due to uncaugth exception 'NSInvalidArgumentException', 

    reason : [NSDictionary initWithObject : forKeys:] : count of objects (1) differs from count of keys (2)'

    when I debug i can see syncBlob is nil

    can you please help me



    Wednesday, June 20, 2012 6:53 PM

All replies

  • Hi,

        Sorry for my english but I am french. I am trying to make work the Iphone Sample. I had earlier the same error as you did. The problem was that actually something went wrong when it went through the first time. I restarted the iphone application but used a new login, then I got a different error. If you don't change anything, rerun the Iphone sample and use the same login as the one before then you will have your error again. 

    The data download didn't want to work so I looked into the code (which is hard when you are not used to those type of programming), compare with HTML5 sample and found that at the top of the SyncController.m file, the downloadURL property initialisation is not correct (maybe it worked with older version of the tools). I corrected the line as follow :

    self.downloadURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/DefaultScopeSyncService.svc/DefaultScope/DownloadChanges?userid=%@", self.baseURL, [anc valueForKey:@"userID"]]];

    With that change the synchronisation went further (from what I can read in the log, it went through).

    You will probably have to update the uploadURL property as well

    Now I have an error later with something like :
    2012-10-04 21:21:11.669 iPhoneListSample[469:11603] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ListViewController" nib but the view outlet was not set.'

    I'll look into that tomorrow.

    I also had a little warning at the start : 2012-10-04 21:21:07.081 iPhoneListSample[469:11603] Application windows are expected to have a root view controller at the end of application launch

    It seems like I have to change the line in the IphoneListSampleAppDelegate.m of the sample : [window addSubview:rootController.view];
    With : 
    self.window.rootViewController = self.rootController;

    When I do that, I don't get the warning at the start but I am not sure if that is not what cause the trouble after.

    Well if you are still stuck with error, the change of login and the correction on the downloadURL should fix the problem.

    Jean-Marc Lenormand

    Thursday, October 4, 2012 8:35 PM
  • Hi, 

        Just to update my status on that sample. I made it work.

    The thing is in the ListViewController.xib ( and also in the ItemViewController.xib) : when you open them, you can see on the left side, 3 icons : File Owner, First Responder and List View Controller. The third one is not correct. So we click at the bottom left of the screen that represent the xib file (it is an icon with a arrow that goes to the right). YOu should see then the placeholders. In the objects part, there is a "List View COntroller" line with a ListView line embedded. The "List View Controller" is not needed and is one part of the problem. SO you slide the "ListView" line on to the Objects label right above. The "ListView" line should not be embedded within the "List View Controller" line. Then you select the "List View Controller" line and press the delet key. Now, the second part : you click on the "File's Owner" line above. You should see on the right side of the screen some information about the content with different tabs, click on the third tab (Identity Inspectore). If you don't see that right side, go ine the menu View->Utilities->ShowIdentity Inspector. In the custom Class part, select the ListViewController class in the list. Then go on the last tab (Connections inspector) and draw a line between Outles/View and the "ListView" line you have on the left.

    You have to do the same for the ItemViewController.xib. And then It finally worked for me

    Jean-Marc Lenormand

    PS : just in case someone is trying that sample, you also have to correct the URL used in the postRequestForLogin procedure in the LoginPage.m file. The correct one is @"%@/login.ashx?username=%@"

    • Proposed as answer by Aaron Lentz Saturday, January 19, 2013 11:13 PM
    Monday, October 8, 2012 3:05 PM
  • This was very helpful! Thanks!

    I used both of your comments, fixed the upload url according to the site below, and went ahead and set the sdk to ios6.0 in the iPhoneListSample-Info.plist.

    I think your comments alone were the fix. Thanks again :) 

    UploadURL change site: http://stackoverflow.com/questions/13169754/microsoft-sync-framework-toolkit-iphone-example-date-format-wrong

    Saturday, January 19, 2013 11:20 PM
  • I am trying to learn and test iPhoneListSample too. I am currently on ios6.1. I have Microsoft Sync Framework 2.1 working on the server side and the Seliverlight client is working without errors.

    On the server side, I the sync service is running on IIS 7.0, The url:$diag works (see below).

    On the ios client side, I have ServiceRoOt =

    The problem I am having is on the ios side. After I made the changes I am getting this problem:

    Thread 1 (com.apple.main-thread) o objc_release: 0x141b0ab: testb $2, 2(%edx) <- Thread 1: EXC_BAD_ACCESS (code=2, address=0x2)

    All Output: (lldb)

    I don't know what that means.


    Diagnostic Test Result Comments
    Sync Framework Runtime PASSED None
    Connection to SQL Server PASSED None
    Database Provisioning PASSED None
    Batching Folder Exists? N/A Batching is not enabled.
    Write access to batching folder N/A Batching is not enabled.
    ClientAccessPolicy.xml/CrossDomain.xml files PASSED Found clientaccesspolicy.xml at website root.

    Service Configuration

    Setting Configured Value
    Scope Name defaultscope
    Default Conflict Resolution ClientWins
    Default Serialization Format ODataAtom
    Verbose Error Response true
    Batching Directory BATCHING_NOT_ENABLED
    Download Batch Size BATCHING_NOT_ENABLED
    Friday, March 22, 2013 8:44 PM
  • This link answered my questions in different way:


    Monday, April 1, 2013 4:58 AM