diff -r 1d6924779df7 -r aab592ac36fc Bonjour/MYBonjourService.m --- a/Bonjour/MYBonjourService.m Wed Apr 29 13:29:31 2009 -0700 +++ b/Bonjour/MYBonjourService.m Tue May 05 23:24:50 2009 -0700 @@ -232,8 +232,7 @@ &resolveCallback, self); } - -- (MYAddressLookup*) addressLookup { +- (MYAddressLookup*) addressLookupObservingNewAddresses:(NSObject *)observer { if (!_addressLookup) { // Create the lookup the first time this is called: _addressLookup = [[MYAddressLookup alloc] initWithHostname: self.hostname]; @@ -241,10 +240,17 @@ _addressLookup.interfaceIndex = _interfaceIndex; } // (Re)start the lookup if it's expired: - if (_addressLookup && _addressLookup.timeToLive <= 0.0) + if (_addressLookup && _addressLookup.timeToLive <= 0.0) { + if (observer != nil) { + [_addressLookup addObserver:observer forKeyPath:@"addresses" options:NSKeyValueObservingOptionNew context:NULL]; + } [_addressLookup start]; + } return _addressLookup; } +- (MYAddressLookup*) addressLookup { + return [self addressLookupObservingNewAddresses:nil]; +} - (MYBonjourQuery*) queryForRecord: (UInt16)recordType {