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 > NSTableColumn question...

NSTableColumn question...
Thread Tools
Junior Member
Join Date: Dec 2000
Location: Houston, TX, USA
Status: Offline
Reply With Quote
Jan 15, 2001, 11:53 PM
 
hello,

I'm working on a program using a TableView. I want the datasource method for the TableView to return a value with formatting depending on which column the data is for. So i have the line of code

if ( [aTableColumn == @"aString" ) {
....
}

but that doesn't seem to be doing the trick. Does anyone know what the problem might be?
     
ali
Forum Regular
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jan 16, 2001, 03:23 PM
 
Not sure if this is the problem, but...

Typically it's best to compare NSStrings (and other objects) using isEqual:

if ([string isEqual:@"aString"]) { ...

Pointer equality (==) will only work when the two objects are exactly the same. isEqual: will allow objects to do other sorts of equality testing.

Ali

     
Junior Member
Join Date: Dec 2000
Location: Houston, TX, USA
Status: Offline
Reply With Quote
Jan 16, 2001, 05:47 PM
 
Hey ali, thanks for the reply. your suggestion did the trick. Thanks!
     
   
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 11:25 PM.
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