Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jjardim

macrumors newbie
Original poster
Mar 19, 2008
26
0
I've been trying to understand the GUI of Xcode, and Interface builder along w/ learning C. I've made good progress learning, things are clicking here and there but I don't understand the standard methods for a class.

Example
I have added an NSTextView object to my .nib file, then added an NSTextField as well. I also added 2 push buttons (NSButton) and linked them up to display text when clicking on the button. But it to display text I could not use the same method.

On the NSTextView I had to use [textView setString: @"Hello World"];
On the NSTextField I had to use ..
[words setStringValue:mad:"Hello, World"];
[words setNeedsDisplay:YES];

How can I find out with out searching the internet how to accomplish stuff like this. From working with Visual Basic, I would just type txtField. (and after I typed . it would bring up a list and I would chose settext=) so it showed me all the associated methods with the txtField class. Is there a way for me to find this info out in Xcode?

Thanks!
Jason

just for reference here are my files
.h
#import <Cocoa/Cocoa.h>


@interface AppController : NSObject {
IBOutlet id textView;

IBOutlet NSTextField *words;
}


- (IBAction) clearText: sender;
- (IBAction) sayHello: (id)sender;

@end


********************
.m
#import "AppController.h"

@implementation AppController

- (IBAction) clearText: sender
{
[textView setString: @"Hello World "];
}

- (IBAction)sayHello:(id)sender{
[words setStringValue:mad:"Hello, World"];
[words setNeedsDisplay:YES];
}

@end
 

sord

macrumors 6502
Jun 16, 2004
352
0
Just turn auto complete on if it isn't already (in XCode's preferences). I think the shortcut to make it pop up is option escape, or something like that (not at my mac at the moment).
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
From working with Visual Basic

I'm so sorry, now you get to use a framework with some thought in it :p.

Seriously now go to Help>Documentation in Xcode, check its set to API and All Doc Sets, then type the name of the class to see what it does.

If you want more VB-like behaviour enable Autocomplete in Xcode Menu>Preferences>Code Sense>Automatically Suggest
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.