Newbie: How to understand Xcode's documentation
Newbie: How to understand Xcode's documentation
- Subject: Newbie: How to understand Xcode's documentation
- From: Phil Faber <email@hidden>
- Date: Tue, 15 Jul 2008 23:19:13 +0100
Hi all.
As a relative newbie I'm eager to learn but my biggest stumbling block
is understanding that the XCode's Help>Documentation actually means;
can someone guide me?
For example, if I want to put a substring of a larger string (eg.
"ertyu" from "qwertyuiop") into a second field, I search the
documentation and come across a thing under NSString called
getCharacters:range. I assume this will do the job as it seems to get
characters from a string as specified by a range; I then look at the
usage information which reads:
- (void)getCharacters:(unichar *)buffer range:(NSRange)aRange
My challenge is that I don't know what this means or how to convert
this into actual code. So I have to keep guessing which surely can't
be the preferred way to learn!
So I try:
[newField setStringValue:[NSString getCharacters:buffer range:2,3]];
..and am told:
error: 'buffer' undeclared
warning: 'NSString' may not respond to '+getCharacters:range:'
..so I try:
[newField setStringValue:[NSString getCharacters:2,3]];
..and am told:
warning: 'NSString' may not respond to '+getCharacters:'
.. so I try:
[newField setStringValue:[NSString getCharacters:buffer range:2-3]];
..and am told:
error: 'buffer' undeclared
warning: 'NSString' may not respond to '+getCharacters:range:'
..and so on.
I'm a newbie; I'm still learning how to do simply stuff like add two
numbers together, display 'hello world' and so on! What I could
really do with is the documentation giving examples.
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.
If I can't understand this, I fear I'll spend most of my time asking
others how to achieve the most basic of tasks.
Thanks.
Phil
_______________________________________________
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