mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 10:11:03 +00:00
31 lines
633 B
Mathematica
31 lines
633 B
Mathematica
|
#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);
|
||
|
}
|