Sending Data Over Bluetooth

Discussion in 'iOS Programming' started by Cdub16, Jun 28, 2010.

  1. Cdub16 macrumors member

    Joined:
    May 30, 2008
    #1
    Ok so i am trying to send an array of objects over bluetooth.

    I have successfuly created the session and all the methods get called at the right time.

    Code:
    NSData *data = [NSKeyedArchiver archivedDataWithRootObject: array];
    [session sendDataToAllPeers:data withDataMode:GKSendDataReliable error:nil];

    and in my recieve data method:

    Code:
    NSArray *newArray = [NSKeyedUnarchiver unarchiveObjectWithData:data];
    but i try to loop through the newArray object to see what is in it but its count is 0. why is it not successfully sending the array object over bluetooth?
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Have you tried checking the error from your sendDataToAllPeers: call?
     

Share This Page