diff -r dd637bdd214e -r 8713f2d6a4c5 Bonjour/MYBonjourRegistration.m --- a/Bonjour/MYBonjourRegistration.m Mon Jul 20 14:50:49 2009 -0700 +++ b/Bonjour/MYBonjourRegistration.m Tue Jul 21 15:06:15 2009 -0700 @@ -160,6 +160,10 @@ } +#pragma mark +#pragma mark TXT RECORD: + + + (NSData*) dataFromTXTRecordDictionary: (NSDictionary*)txtDict { if (!txtDict) return nil; @@ -235,8 +239,8 @@ } -- (void) updateTxtRecord { - [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(updateTxtRecord) object: nil]; +- (void) updateTXTRecord { + [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(updateTXTRecord) object: nil]; if (self.serviceRef) { NSData *data = [[self class] dataFromTXTRecordDictionary: _txtRecord]; Assert(data!=nil || _txtRecord==nil, @"Can't convert dictionary to TXT record: %@", _txtRecord); @@ -254,19 +258,19 @@ } -- (NSDictionary*) txtRecord { +- (NSDictionary*) TXTRecord { return _txtRecord; } -- (void) setTxtRecord: (NSDictionary*)txtDict { +- (void) setTXTRecord: (NSDictionary*)txtDict { if (!$equal(_txtRecord,txtDict)) { setObjCopy(&_txtRecord, txtDict); - [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(updateTxtRecord) object: nil]; - [self performSelector: @selector(updateTxtRecord) withObject: nil afterDelay: 0.1]; + [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(updateTXTRecord) object: nil]; + [self performSelector: @selector(updateTXTRecord) withObject: nil afterDelay: 0.1]; } } -- (void) setString: (NSString*)value forTxtKey: (NSString*)key +- (void) setString: (NSString*)value forTXTKey: (NSString*)key { NSData *data = [value dataUsingEncoding: NSUTF8StringEncoding]; if (!$equal(data, [_txtRecord objectForKey: key])) { @@ -275,8 +279,8 @@ [_txtRecord setObject: data forKey: key]; } else [_txtRecord removeObjectForKey: key]; - [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(updateTxtRecord) object: nil]; - [self performSelector: @selector(updateTxtRecord) withObject: nil afterDelay: 0.1]; + [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(updateTXTRecord) object: nil]; + [self performSelector: @selector(updateTXTRecord) withObject: nil afterDelay: 0.1]; } } @@ -342,8 +346,8 @@ - (void) updateTXT { NSDictionary *txt = $dict({@"time", $sprintf(@"%.3lf", CFAbsoluteTimeGetCurrent())}); - _reg.txtRecord = txt; - CAssertEqual(_reg.txtRecord, txt); + _reg.TXTRecord = txt; + CAssertEqual(_reg.TXTRecord, txt); [self performSelector: @selector(updateTXT) withObject: nil afterDelay: 3.0]; }