1.1 --- a/Bonjour/MYBonjourRegistration.m Mon Jul 20 14:50:49 2009 -0700
1.2 +++ b/Bonjour/MYBonjourRegistration.m Fri Jul 24 14:06:28 2009 -0700
1.3 @@ -160,6 +160,10 @@
1.4 }
1.5
1.6
1.7 +#pragma mark
1.8 +#pragma mark TXT RECORD:
1.9 +
1.10 +
1.11 + (NSData*) dataFromTXTRecordDictionary: (NSDictionary*)txtDict {
1.12 if (!txtDict)
1.13 return nil;
1.14 @@ -235,8 +239,8 @@
1.15 }
1.16
1.17
1.18 -- (void) updateTxtRecord {
1.19 - [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(updateTxtRecord) object: nil];
1.20 +- (void) updateTXTRecord {
1.21 + [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(updateTXTRecord) object: nil];
1.22 if (self.serviceRef) {
1.23 NSData *data = [[self class] dataFromTXTRecordDictionary: _txtRecord];
1.24 Assert(data!=nil || _txtRecord==nil, @"Can't convert dictionary to TXT record: %@", _txtRecord);
1.25 @@ -254,19 +258,19 @@
1.26 }
1.27
1.28
1.29 -- (NSDictionary*) txtRecord {
1.30 +- (NSDictionary*) TXTRecord {
1.31 return _txtRecord;
1.32 }
1.33
1.34 -- (void) setTxtRecord: (NSDictionary*)txtDict {
1.35 +- (void) setTXTRecord: (NSDictionary*)txtDict {
1.36 if (!$equal(_txtRecord,txtDict)) {
1.37 setObjCopy(&_txtRecord, txtDict);
1.38 - [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(updateTxtRecord) object: nil];
1.39 - [self performSelector: @selector(updateTxtRecord) withObject: nil afterDelay: 0.1];
1.40 + [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(updateTXTRecord) object: nil];
1.41 + [self performSelector: @selector(updateTXTRecord) withObject: nil afterDelay: 0.1];
1.42 }
1.43 }
1.44
1.45 -- (void) setString: (NSString*)value forTxtKey: (NSString*)key
1.46 +- (void) setString: (NSString*)value forTXTKey: (NSString*)key
1.47 {
1.48 NSData *data = [value dataUsingEncoding: NSUTF8StringEncoding];
1.49 if (!$equal(data, [_txtRecord objectForKey: key])) {
1.50 @@ -275,8 +279,8 @@
1.51 [_txtRecord setObject: data forKey: key];
1.52 } else
1.53 [_txtRecord removeObjectForKey: key];
1.54 - [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(updateTxtRecord) object: nil];
1.55 - [self performSelector: @selector(updateTxtRecord) withObject: nil afterDelay: 0.1];
1.56 + [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(updateTXTRecord) object: nil];
1.57 + [self performSelector: @selector(updateTXTRecord) withObject: nil afterDelay: 0.1];
1.58 }
1.59 }
1.60
1.61 @@ -342,8 +346,8 @@
1.62
1.63 - (void) updateTXT {
1.64 NSDictionary *txt = $dict({@"time", $sprintf(@"%.3lf", CFAbsoluteTimeGetCurrent())});
1.65 - _reg.txtRecord = txt;
1.66 - CAssertEqual(_reg.txtRecord, txt);
1.67 + _reg.TXTRecord = txt;
1.68 + CAssertEqual(_reg.TXTRecord, txt);
1.69 [self performSelector: @selector(updateTXT) withObject: nil afterDelay: 3.0];
1.70 }
1.71