• 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
class_addMethod and type encodings.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

class_addMethod and type encodings.


  • Subject: class_addMethod and type encodings.
  • From: Ross Tulloch <email@hidden>
  • Date: Fri, 2 May 2008 12:29:55 +1000

Hi,

I've been experimenting with adding methods to classes at runtime and have some questions regarding the use and importance of type encodings.

1) class_addMethod requires a types array. This array describes the types of the arguments to the method. The type encodings page simply states that this info "assists the runtime". I'm wondering how (and when) this type information is used by the runtime? In my testing I've found the added methods work fine even if you pass an empty types string. How bad an idea is passing an empty types string?

2) I've seen some code which uses type encodings like "@4@4@4". I can't find any doco for this style of encoding. Any hints?

3) The only doco I can find for type encodings in ObjC is the "Runtime System > Type Encodings" page. Is there any other doco I should be reading?


Thanks, Ross. _______________________________________________

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: class_addMethod and type encodings.
      • From: Keith Duncan <email@hidden>
    • Re: class_addMethod and type encodings.
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Calculating file size
  • Next by Date: How Do You Open Default Web Browser and goto URL?
  • Previous by thread: Re: Calculating file size
  • Next by thread: Re: class_addMethod and type encodings.
  • Index(es):
    • Date
    • Thread