Friday, December 15, 2017

#1 2009-10-09 07:35:12 am

chris2
Member
Registered: 2008-09-10
Posts: 331
Website

NSString

I read this in "Cocoa Programming for Mac OS X 3rd edition"

For this exercise, you should recognize that the NSTextField class has the following methods:

- (NSString *)stringValue;
- (void)setStringValue:(NSString *)aString;


I had to use

NSString *string = [textField stringValue];


to solve a exercise in the book and it worked. As much as understand, it means that textField's stringValue is assigned to the instance variable string.

But when I open the help documentation, (by option + double clicking on "NSTextField") I could not find any such methods. I also checked NSString. Could not find anything there either. Can someone enlighten me on what the author meant to say? Or where I must look?


Xcode: Version 3.1.2
Mac OS 10.5

Last edited by chris2 (2009-10-09 07:35:50 am)


Tireless endeavour is the effort required to restrict the modifications of the mind
www.thehungersite.com

Offline

 

#2 2009-10-09 08:04:04 am

tellboy
Member
Registered: 2005-06-23
Posts: 152

Re: NSString

Hi,

NSString actually inherits from NSControl. If you are in the xcode documentation for NSString you will see at the top the other classes it inherits from

So if you look in the documentation for NSControl you will see the functions you require.


All the best


Terry

Offline

 

#3 2009-10-09 08:27:32 am

chris2
Member
Registered: 2008-09-10
Posts: 331
Website

Re: NSString

Thanks tellboy. I understood it now.

NSString actually inherits from NSControl.


I think you meant:

NSTextField actually inherits from NSControl.


Tireless endeavour is the effort required to restrict the modifications of the mind
www.thehungersite.com

Offline

 

#4 2009-10-09 01:26:36 pm

tellboy
Member
Registered: 2005-06-23
Posts: 152

Re: NSString

Hi,

Yes, a senior moment indeed.

A rushed post while at work.

All the best

Terry

Last edited by tellboy (2009-10-09 01:26:57 pm)

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)