• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTimer: Debug vs. Release build
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimer: Debug vs. Release build


  • Subject: Re: NSTimer: Debug vs. Release build
  • From: Martin Wierschin <email@hidden>
  • Date: Mon, 16 Mar 2009 17:34:23 -0700

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 (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTimer: Debug vs. Release build
      • From: Michael Ash <email@hidden>
References: 
 >Re: NSTimer: Debug vs. Release build (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: [iPhone] NumberPad with the dot
  • Next by Date: Re: case-insensitive NSDictionary
  • Previous by thread: Re: NSTimer: Debug vs. Release build
  • Next by thread: Re: NSTimer: Debug vs. Release build
  • Index(es):
    • Date
    • Thread