Sending Data Over Bluetooth

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

  1. Cdub16 macrumors member

    May 30, 2008
    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.

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

    and in my recieve data method:

    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


    Staff Member

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

Share This Page