diff options
author | krab <krab@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-09-22 18:00:23 +0000 |
---|---|---|
committer | krab <krab@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-09-22 18:00:23 +0000 |
commit | b78b9a5fea6f0a29cad57131e87602bf047e83e1 (patch) | |
tree | 2292c1c01010fcde35f6c597c878ee33bb5ffd67 /gcc/objc/Object.m | |
parent | 07de056ecc618faf59fa5b3abdb7569501d6a4e2 (diff) | |
download | gcc-b78b9a5fea6f0a29cad57131e87602bf047e83e1.tar.gz |
(-compare:, -shouldNotImplement:): Added.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5399 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/objc/Object.m')
-rw-r--r-- | gcc/objc/Object.m | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/objc/Object.m b/gcc/objc/Object.m index 166bff4533f..622dcbe64c3 100644 --- a/gcc/objc/Object.m +++ b/gcc/objc/Object.m @@ -116,6 +116,18 @@ extern int errno; return self==anObject; } +- (int)compare:anotherObject; +{ + if ([self isEqual:anotherObject]) + return 0; + // Ordering objects by their address is pretty useless, + // so subclasses should override this is some useful way. + else if (self > anotherObject) + return 1; + else + return -1; +} + - (BOOL)isMetaClass { return NO; @@ -287,6 +299,12 @@ extern int errno; return [self error:"method %s not implemented", sel_get_name(aSel)]; } +- shouldNotImplement:(SEL)aSel +{ + return [self error:"%s should not implement %s", + object_get_class_name(self), sel_get_name(aSel)]; +} + - doesNotRecognize:(SEL)aSel { return [self error:"%s does not recognize %s", |