J'utilise la bibliothèque BLIP/MYNetwork pour établir une connexion de base tcp entre l'iPhone et mon ordinateur. Jusqu'à présent, le code construit et fonctionne correctement dans le simulateur, mais le déploiement à l'appareil donne l'erreur suivante:Problème d'héritage avec ivar sur l'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
Est-ce que quelqu'un sait comment je résoudre ce problème? Serais-je simplement déclarer _delegate comme une propriété publique de la classe de base "TCPEndPoint"? Merci pour l'aide ya'll!
Ah, oui! Dave, votre message a été très utile. Tirer les délégués à un niveau fixe ce problème et je crois que les nouvelles révisions du projet BLIP/MYNetwork incluront ce changement. Merci! – Buffalo
Je suis content que vous l'ayez aimé. N'hésitez pas à voter pour cela. =) –