• 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: Amount of Arguments per Method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Amount of Arguments per Method


  • Subject: Re: Amount of Arguments per Method
  • From: Andy Lee <email@hidden>
  • Date: Mon, 22 Jun 2009 10:14:42 -0400

On Jun 22, 2009, at 4:03 AM, Roland King wrote:
This still the longest one or has Apple outdone themselves since? 11 args, you really wouldn't want much more than this.

- (id )initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel :

That's still the longest, both by name length (148) and number of arguments, if you look only at the most commonly used frameworks.


However, as of Leopard, the longest *documented* method name (150, though with only 9 arguments) is

[QCPlugInContext outputImageProviderFromBufferWithPixelFormat:pixelsWide:pixelsHigh:baseAddress:bytesPerRow:releaseCallback:releaseContext:colorSpace:shouldColorMatch :]

<http://developer.apple.com/documentation/Cocoa/Reference/QCPlugInContext_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/QCPlugInContext/outputImageProviderFromBufferWithPixelFormat:pixelsWide:pixelsHigh:baseAddress:bytesPerRow:releaseCallback:releaseContext:colorSpace:shouldColorMatch: >.

I also found two undocumented methods with 15 arguments, both in DOMMouseEvent:

initMouseEvent:canBubble:cancelable:view:detail:screenX:screenY:clientX:clientY:ctrlKey:altKey:shiftKey:metaKey:button:relatedTarget :

initMouseEvent:::::::::::::::

On the iPhone [2], the longest by name (113), with 6 arguments, is

[NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero :]

Until recently, the method with the most arguments (7) was

[NSString drawAtPoint:forWidth:withFont:minFontSize:actualFontSize:lineBreakMode:baselineAdjustment :]

In the 3.0 SDK there is now

[NSMigrationManager migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error :]

with 8 arguments.

--Andy

[1] Based on a search of:
   AddressBook,
   AirPort,
   AppKit,
   ApplicationServices,
   Automator,
   CalendarStore,
   Collaboration,
   CoreData,
   DiscRecording,
   DiscRecordingUI,
   ExceptionHandling,
   Foundation,
   InputMethodKit,
   InstantMessage,
   IOBluetooth,
   IOBluetoothUI,
   Message,
   OpenDirectory,
   PreferencePanes,
   PubSub,
   QTKit,
   Quartz,
   QuartzCore,
   ScreenSaver,
   ScriptingBridge,
   SecurityFoundation,
   SecurityInterface,
   ServerNotification,
   SyncServices,
   WebKit,
   XgridFoundation

[2] Based on a search of:
   AddressBook,
   AddressBookUI,
   AudioToolbox,
   AudioUnit,
   AVFoundation,
   CFNetwork,
   CoreAudio,
   CoreData,
   CoreFoundation,
   CoreGraphics,
   CoreLocation,
   ExternalAccessory,
   Foundation,
   GameKit,
   MapKit,
   MediaPlayer,
   MessageUI,
   OpenGLES,
   QuartzCore,
   Security,
   StoreKit,
   SystemConfiguration,
   UIKit

_______________________________________________

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: Amount of Arguments per Method
      • From: WT <email@hidden>
References: 
 >Amount of Arguments per Method (From: Chunk 1978 <email@hidden>)
 >Re: Amount of Arguments per Method (From: WT <email@hidden>)
 >Re: Amount of Arguments per Method (From: Roland King <email@hidden>)

  • Prev by Date: Re: Amount of Arguments per Method
  • Next by Date: Re: Warnings suggest compiler confusion between 32 and 64 bit code.
  • Previous by thread: Re: Amount of Arguments per Method
  • Next by thread: Re: Amount of Arguments per Method
  • Index(es):
    • Date
    • Thread