views:

98

answers:

1

In the iPhone SDK, in my .n, I can say:

-(IBOutlet) UITextField *MyNameIs;
-(IBOutlet) UILabel *DisplayMyNameIsHere;

}

-(IBAction)PressButtonToDisplayYourName;

Then in my .m, I'll do:

-(IBAction)PressButtonToDisplayYourName {
     DisplayMyNameIsHere = MyNameIs.text;
}

But now how would I translate that to making a Mac application. If I wanted to display someones name from a textfield in a label? I have been trying to figure this out, but the ".text" extension only works in the iPhone SDK, not the Mac SDK. Someone please help! Thanks!

A: 
Chromium
Thanks, I'll try that!
Daniel Ricany
It didn't work..It gave me an error."'NSTextField' may not respond to '-text'"
Daniel Ricany
I'm trying to do this on a Mac application.....I already know how to do it in the iPhone SDK.
Daniel Ricany
Sorry- I gave you the wrong property- I think it's "stringValue".So it should be, `[myLabel setText:[myTextField stringValue]];`
Chromium
Thanks for the suggestions, I managed to figure it out after the last response. It wasn't [myLabel setText:[myTextField stringValue]];, it was [myLabel setStringValue:[myTextField stringValue]]; I typed set then hit the esc key and looked through and I found setStringValue. So it worked. Thanks for the help guys!!! Its a reference application. =)
Daniel Ricany
There we go! (That was a little confusion between Cocoa's and iOs's methods).Yeah, I find it helpful to hit the escape key once in a while to fine out what method I should use.
Chromium