Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我从图像创建一个 NSData 文件并使用套接字通过服务器发送。
CFWriteStreamWrite(myWriteStream, (const UInt8 *)data, [data length]);
但是服务器以不同的格式接收它。并且无法打开文件。
您的代码片段中的“数据”类型是什么?
如果它是一个 (NSData *) 对象,你应该这样写:
CFWriteStreamWrite(myWriteStream, (const UInt8 *)[data bytes], [data length]);