btw, this method doesn't have any parameter, it's definition is:
Whether you need it or not, you must take it, because that's the
method
signature that NSTimer expects to call back.
I don't want to confuse the issue for Stefan, as matching up selector/
method names exactly is obviously very important. However, is there
actually any issue when a dynamic method dispatch includes arguments
not present in the actual method declaration/definition? Eg:
@interface XXObject
- (void) blissfulIgnorance ;
@end
@implementation XXObject
- (void) blissfulIgnorance
{
// do something
}
@end
{
XXObject* obj = [[[XXObject alloc] init] autorelease];
[obj performSelector:@selector(blissfulIgnorance) withObject:obj];
}
As far as I can see, the dispatcher would push the argument to the
stack (or wherever), and they would simply be ignored by the method,
no harm done. The only theoretical problem I can imagine is if the
method returned a value whose location in memory was dependent on the
placement of the method arguments- is that the case on some
architectures? Or is there some other problem?
~Martin
_______________________________________________
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