我想通过gamekit找出我通过发送函数发送的数据类型。基本上我将这些数据存储在 CFPropertyListRef 中。dataReceived 的类型为 NSMutatableData。
- (void) receiveData:(NSMutableData *)data fromPeer:(NSString *)peer inSession: (GKSession *)session context:(void *)context {
// Read the bytes in data and perform an application-specific action.
[dataReceived setData:data];
if([dataReceived length]> 0 ) {
CFStringRef errorString;
CFPropertyListRef plist = CFPropertyListCreateFromXMLData(kCFAllocatorDefault, (CFDataRef)dataReceived, kCFPropertyListMutableContainers, &errorString);
}
我的目标是找出 plist 是否属于 NSDictionary 类型,因为我想适当地处理这些数据