• 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: Newbie: How to understand Xcode's documentation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: How to understand Xcode's documentation


  • Subject: Re: Newbie: How to understand Xcode's documentation
  • From: Nick Zitzmann <email@hidden>
  • Date: Tue, 15 Jul 2008 16:33:49 -0600


On Jul 15, 2008, at 4:19 PM, Phil Faber wrote:

- (void)getCharacters:(unichar *)buffer range:(NSRange)aRange
[...]
Can anyone explain how I can 'decode' the usage information shown in the documentation into real code? Not just for this example, but in general.


OK, let's do this one part at a time, from left to right:

1. The - means that the method is an instance method, not a class method. That means you use it on an NSString instance you have initialized somewhere else.

2. The (void) means the method doesn't return anything, so depending on its return value makes no sense.

3. The "unichar *" means the first argument takes a unichar pointer. You have to declare this pointer beforehand.

4. The "NSRange" means the second argument is an NSRange data structure. You usually make these using the NSMakeRange() macro.

As others have said, I'd strongly recommend reading up first on the C programming language, and then on ObjC. Then this stuff will make more sense.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

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


References: 
 >Newbie: How to understand Xcode's documentation (From: Phil Faber <email@hidden>)

  • Prev by Date: Re: [[NSDate alloc] initWithString] crashes with valid string
  • Next by Date: Re: Inter-thread communications (live/deadlock?)
  • Previous by thread: Re: Newbie: How to understand Xcode's documentation
  • Next by thread: Re: Newbie: How to understand Xcode's documentation
  • Index(es):
    • Date
    • Thread