Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Help w/ Xcode - Objective C - Im New at this

Help w/ Xcode - Objective C - Im New at this
Thread Tools
Fresh-Faced Recruit
Join Date: Mar 2008
Status: Offline
Reply With Quote
Mar 19, 2008, 05:58 PM
 
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:@"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: @"Jason Sucks "];
}

- (IBAction)sayHelloid)sender{
[words setStringValue:@"Hello, World"];
[words setNeedsDisplay:YES];
}

@end
     
Mac Enthusiast
Join Date: Jan 2007
Status: Offline
Reply With Quote
Mar 19, 2008, 07:55 PM
 
Have you hooked up your IBOutlet and IBAction connections in Interface Builder yet?

Might want to run through the basic currency converter tutorial to get an idea how to accomplish this. It's a good idea that you learn how to do this before delving any further into your project.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Mar 20, 2008, 01:35 AM
 
Xcode includes full documentation for all of Cocoa and most other system frameworks. You can also get autocomplete (in Xcode or any other Cocoa app, actually) by pressing F5.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:39 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2