在EAAccessoryManager的文档中,它说我们需要在设置plist中添加“支持的外部附件协议”。但这可以针对已知的协议字符串来完成。如果我不知道协议字符串或不在列表中的字符串,如果我的应用程序必须检测任何“为iPod制造”的任意设备,我该怎么办?
另外,我如何知道设备的协议字符串?在哪里可以找到这个?
发布于 2010-10-15 17:03:05
如果您希望检索protocolString,请尝试执行以下操作:
//Load all connected accessories
NSMutableArray *_accessoryList = [[NSMutableArray alloc] initWithArray:[[EAAccessoryManager sharedAccessoryManager] connectedAccessories]];
//Load attribute protocolString into NSString, note that the "objectAtIndex" is just to show the string on a UITableViewCell of a UITableView.
NSString *eaAccessoryProtocolString = [[_accessoryList objectAtIndex:indexPath.row] protocolString];在Info.plist中,您必须添加设备实现的协议,并且该协议必须与应用程序相同。在这种情况下,您需要联系制造商,否则您必须申请MFi/WWi许可证,然后您可以定义自己的协议,如用于向外部设备发送和恢复数据的数据模式。
希望这是有用的。
https://stackoverflow.com/questions/3931910
复制相似问题