Changeset 270 for trunk/lilypad/Sources/LPEditContactController.m
- Timestamp:
- 16-04-2008 18:01:32 (5 years ago)
- Files:
-
- 1 modified
-
trunk/lilypad/Sources/LPEditContactController.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lilypad/Sources/LPEditContactController.m
r251 r270 140 140 - (void)p_startObservingEntries:(NSArray *)contactEntries 141 141 { 142 NSEnumerator *entriesEnumerator = [contactEntries objectEnumerator]; 143 LPContactEntry *entry; 144 145 while (entry = [entriesEnumerator nextObject]) { 146 [entry addObserver:self 147 forKeyPath:@"allResourcesDescription" 148 options:0 149 context:NULL]; 150 } 142 NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [contactEntries count])]; 143 [contactEntries addObserver:self toObjectsAtIndexes:indexSet forKeyPath:@"allResourcesDescription" options:0 context:NULL]; 151 144 } 152 145 153 146 - (void)p_stopObservingEntries:(NSArray *)contactEntries 154 147 { 155 NSEnumerator *entriesEnumerator = [contactEntries objectEnumerator]; 156 LPContactEntry *entry; 157 158 while (entry = [entriesEnumerator nextObject]) { 159 [entry removeObserver:self forKeyPath:@"allResourcesDescription"]; 160 } 148 NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [contactEntries count])]; 149 [contactEntries removeObserver:self fromObjectsAtIndexes:indexSet forKeyPath:@"allResourcesDescription"]; 161 150 } 162 151