我正在尝试使用 ios5 制作应用程序,我真的很困惑为什么会发生这种情况。有人可以帮我解释一下为什么出现&error时会出现错误
将非本地对象的地址传递给 __autoreleasing 参数以进行回写
以下调用导致错误
// note the following method returns _inStream and _outStream with a retain count that the caller must eventually release
if (![netService getInputStream:&_inStream outputStream:&_outStream]) {
NSLog(@"error in get input and output streams");
return;
}
我的课.h
NSInputStream *_inStream;
NSOutputStream *_outStream;
@property (nonatomic, strong) NSInputStream *_inStream;
@property (nonatomic, strong) NSOutputStream *_outStream;
我的课.m
@synthesize _inStream;
@synthesize _outStream;
getInputStream是一个NSNetService类方法
请在下面的 NSNetService 类 getInputStream 实现
/* Retrieves streams from the NSNetService instance. The instance's delegate methods are not called. Returns YES if the streams requested are created successfully. Returns NO if or any reason the stream could not be created. If only one stream is desired, pass NULL for the address of the other stream. The streams that are created are not open, and are not scheduled in any run loop for any mode.
*/
- (BOOL)getInputStream:(NSInputStream **)inputStream outputStream:(NSOutputStream **)outputStream;
我找到了相关的帖子
从 ios-4 到 ios-5arc-passing-address
但是我无法找到问题
对此问题的任何帮助表示赞赏
谢谢