For (I know this works)
NSMutableData *data= [NSMutableData dataWithBytes:&variableOne length:sizeof(variableOne)];
[dataToPeer appendBytes:&variableTwo length:sizeof(variableTwo)];
use:
NSRange range;
range.location=0;
range.length=sizeof(variableOne);
[data getBytes:&variableOne range:range];
range.location=range.location+range.length;
range.length=sizeof(variableTwo);
[data getBytes:&variableTwo range:range];
range.location=range.location+range.length;
// repeat the above three lines for each variable you wish to transmit.
For: (I think this will work, it might be less compressed than above)
NSData *data = [NSPropertyListSerialization dataWithPropertyList:myDictionary format:NSPropertyListXMLFormat_v1_0 options:0 error:&error1 ];
use:
myDictionary =[NSPropertyListSerialization
propertyListWithData:data options:NSPropertyListMutableContainersAndLeaves format:&format error:&errorDesc];