In general, make sure to match the types of methods that you override (the obj-c runtime does not consider types).
The signature of isEqual is:
        - (BOOL)isEqual:(id)object;
Note the "id" type for the argument (however, if Browfile is an obj-c class, then things ought to work, so I assume that this is not the root cause).

Jesper

On Jun 19, 2009, at 8:40 AM, Jerry Krinock wrote:

I implemented an -isEqual: method in one of my classes today.  This
causes the app to crash while loading a document, after some
milliseconds.  Crashes occur in different unrelated places.

I then simplified the implementation to just log and call super --

- (BOOL)isEqual:(Browfile*)otherBrowfile {
    NSLog(@"isEqual???") ;
    return [super isEqual:otherBrowfile] ;
}

Or, return a constant --

- (BOOL)isEqual:(Browfile*)otherBrowfile {
    NSLog(@"isEqual???") ;
    return NO ;
}

Crashes either way, and the log statement in there never logs.

Simply removing this implementation by renaming it to XXisEqual:
results in no more crashes.  The crash looks like a memory-smasher,
but under the circumstances maybe something is being linked
incorrectly.  I "touched" all of the files and re-built, and did not
get any "multiple implementations -- using this one" warnings.

I've implemented -isEqual: in several other of my classes with no
problems.  What in the world could do this?

Please make my day by giving me ^something^ to chew on here.

Jerry Krinock

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jsbache%40adobe.com

This email sent to jsba...@adobe.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to