Bonjour/MYBonjourService.m
changeset 56 6c3b5372a307
parent 43 aab592ac36fc
child 50 63baa74c903f
     1.1 --- a/Bonjour/MYBonjourService.m	Tue May 05 23:24:50 2009 -0700
     1.2 +++ b/Bonjour/MYBonjourService.m	Thu Jul 02 19:58:11 2009 -0700
     1.3 @@ -232,7 +232,8 @@
     1.4                               &resolveCallback, self);
     1.5  }
     1.6  
     1.7 -- (MYAddressLookup*) addressLookupObservingNewAddresses:(NSObject *)observer {
     1.8 +
     1.9 +- (MYAddressLookup*) addressLookup {
    1.10      if (!_addressLookup) {
    1.11          // Create the lookup the first time this is called:
    1.12          _addressLookup = [[MYAddressLookup alloc] initWithHostname: self.hostname];
    1.13 @@ -240,17 +241,10 @@
    1.14          _addressLookup.interfaceIndex = _interfaceIndex;
    1.15      }
    1.16      // (Re)start the lookup if it's expired:
    1.17 -    if (_addressLookup && _addressLookup.timeToLive <= 0.0) {
    1.18 -		if (observer != nil) {
    1.19 -			[_addressLookup addObserver:observer forKeyPath:@"addresses" options:NSKeyValueObservingOptionNew context:NULL];
    1.20 -		}
    1.21 +    if (_addressLookup && _addressLookup.timeToLive <= 0.0)
    1.22          [_addressLookup start];
    1.23 -	}
    1.24      return _addressLookup;
    1.25  }
    1.26 -- (MYAddressLookup*) addressLookup {
    1.27 -	return [self addressLookupObservingNewAddresses:nil];
    1.28 -}
    1.29  
    1.30  
    1.31  - (MYBonjourQuery*) queryForRecord: (UInt16)recordType {