我正在使用BLIP/MYNetwork库建立iPhone和我的电脑之间的基本tcp套接字连接。到目前为止,代码生成和模拟器正常运行,但部署到设备产生以下错误:iPhone上的伊娃继承问题
error: property 'delegate' attempting to use ivar '_delegate' declared in super class of 'TCPConnection'
@interface TCPConnection : TCPEndpoint {
@private
TCPListener *_server;
IPAddress *_address;
BOOL _isIncoming, _checkedPeerCert;
TCPConnectionStatus _status;
TCPReader *_reader;
TCPWriter *_writer;
NSError *_error;
NSTimeInterval _openTimeout; }
/** The delegate object that will be called when the connection opens, closes or receives messages. */
@property (assign) id<TCPConnectionDelegate> delegate;
/** The delegate messages sent by TCPConnection. All methods are optional. */
@protocol TCPConnectionDelegate <NSObject>
@optional
/** Called after the connection successfully opens. */
- (void) connectionDidOpen: (TCPConnection*)connection;
/** Called after the connection fails to open due to an error. */
- (void) connection: (TCPConnection*)connection failedToOpen: (NSError*)error;
/** Called when the identity of the peer is known, if using an SSL connection and the SSL
settings say to check the peer's certificate.
This happens, if at all, after the -connectionDidOpen: call. */
- (BOOL) connection: (TCPConnection*)connection authorizeSSLPeer: (SecCertificateRef)peerCert;
/** Called after the connection closes. You can check the connection's error property to see if it was normal or abnormal. */
- (void) connectionDidClose: (TCPConnection*)connection;
@end
@interface TCPEndpoint : NSObject {
NSMutableDictionary *_sslProperties;
id _delegate;
}
- (void) tellDelegate: (SEL)selector withObject: (id)param;
@end
有谁知道我将如何解决这一问题?我是否会简单地声明_delegate作为基类“TCPEndPoint”的公共属性?感谢您的帮助!
啊,是的!戴夫,你的帖子非常有帮助。将代表降到一个级别可以解决这个问题,我相信BLIP/MYNetwork项目的更新版本将包含此更改。谢谢! – Buffalo 2009-07-09 22:11:45