mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 02:01:03 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@291 72102866-910b-0410-8b05-ffd578937521
30 lines
633 B
Objective-C
30 lines
633 B
Objective-C
#include <foundation/NSArray.h>
|
|
|
|
int
|
|
main()
|
|
{
|
|
id a, b;
|
|
|
|
set_behavior_debug(1);
|
|
a = [NSArray arrayWithObjects:
|
|
[NSObject class],
|
|
[NSArray class],
|
|
[NSMutableArray class]];
|
|
|
|
printf("NSArray has count %d\n", [a count]);
|
|
printf("Classname at index 1 is %s\n", [[a objectAtIndex:1] name]);
|
|
|
|
assert([a containsObject:[NSObject class]]);
|
|
assert([a lastObject]);
|
|
[a makeObjectsPerform:@selector(self)];
|
|
|
|
b = [a mutableCopy];
|
|
assert([b count]);
|
|
[b addObject:[NSObject class]];
|
|
[b removeObject:[NSArray class]];
|
|
[b removeLastObject];
|
|
|
|
assert([b firstObjectCommonWithArray:a]);
|
|
|
|
exit(0);
|
|
}
|