Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Log in or create an account to edit The Apple Wiki.


NSSet5413174 is a mutable array pretending to be a mutable set. Therefore, searching, insertion and deletion would cost O(N) instead of O(log N) as guaranteed by CFSet. Nevertheless, you gain the property that enumeration is always in the insertion order.

Example

	NSSet5413174* xset = [[NSSet5413174 alloc] init];
	[xset addObject:@"d"];
	[xset addObject:@"a"];
	[xset addObject:@"c"];
	[xset addObject:@"b"];
	[xset addObject:@"a"];
	[xset removeObject:@"a"];
	for (NSString* obj in xset) {
		NSLog(@"%@", obj);	// prints d, c, b.
	}
	[xset release];

Header