Ich verwende die BLIP/MYNetwork-Bibliothek, um eine grundlegende tcp-Socket-Verbindung zwischen dem iPhone und meinem Computer herzustellen. Bisher baut der Code und läuft richtig in Simulator, sondern Gerät bereitstellen ergibt die folgende Fehlermeldung:Vererbungsproblem mit dem ivar auf dem 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
Wer weiß, wie ich würde dies beheben? Würde ich _delegate einfach als öffentliche Eigenschaft der Basisklasse "TCPEndPoint" deklarieren? Danke für die Hilfe!
Ah, ja! Dave, dein Beitrag war sehr hilfreich. Wenn Sie die Delegierten auf eine Ebene ziehen, wird dieses Problem behoben, und ich denke, dass neuere Revisionen des BLIP/MYNetwork-Projekts diese Änderung enthalten. Vielen Dank! – Buffalo
Froh, dass es dir gefallen hat. Fühlen Sie sich frei, es abzustimmen. =) –