Definition at line 27 of file OOWeakSet.m.
◆ compact
Extends class OOWeakSet.
Definition at line 17 of file OOWeakSet.m.
240{
242 BOOL compactRequired = NO;
243 foreach (weakRef, _objects)
244 {
245 if ([weakRef weakRefUnderlyingObject] ==
nil)
246 {
247 compactRequired = YES;
248 break;
249 }
250 }
251
252 if (compactRequired)
253 {
254 NSMutableSet *newObjects = [[NSMutableSet alloc] initWithCapacity:[_objects count]];
255 foreach (weakRef, _objects)
256 {
257 if ([weakRef weakRefUnderlyingObject] !=
nil)
258 {
259 [newObjects addObject:weakRef];
260 }
261 }
262
263 [_objects release];
264 _objects = newObjects;
265 }
266}
The documentation for this category was generated from the following file: