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.
这让我发疯!这里有什么问题?
不能保证引用没有被另一个线程修改。在创建时将套接字分配给局部变量,修改它,设置属性并释放局部变量:
CFSocketRef socket = CFSocketCreateWithNative(...); if (socket) { ... self.listeningSocket = socket; CFRelease(socket); }