• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSCell's -setStringValue:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCell's -setStringValue:


  • Subject: Re: NSCell's -setStringValue:
  • From: James Chen <email@hidden>
  • Date: Tue, 18 May 2004 16:43:28 +0800

Why don't you implement the data source?
If you have some reason to not do so, state the problem then maybe we could have some solutions.
If not, implement data is the appropriate way to use table view in my opinion.
Regards,
James
------------------------------------
Ulead Systems Inc.
James Chen
Software Engineer
Image Div.
------------------------------------
On May 18, 2004, at 2:09 PM, Daniel Todd Currie wrote:

When i use NSCell's -setStringValue:, what is it actually doing? It's not changing the table's data source, but it is apparently changing the cell's width, because [cell cellSize].width is changing as I change the string value.

I played around with this using the following code:

NSCell *cell = [[myTableView tableColumnWithIdentifier:@"myIdentifier"] dataCell];

[cell setStringValue:@"test"];
NSLog(@"cell width = %f", [cell cellSize].width);
[cell setStringValue:@"fibula"];
NSLog(@"cell width = %f", [cell cellSize].width);

And the log:

2004-05-17 22:53:30.247 myApp[8699] cell width = 27.594000
2004-05-17 22:53:30.249 myApp[8699] cell width = 39.723999

This ends up doing what I want it to do (it tells me what width the cell should have for the words "test" and "fibula"), but it bothers me a little that this method doesn't seem to have any effect. I can't figure out why this works.

Thanks in advance for any insight...

-- Daniel Currie
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: NSCell's -setStringValue:
      • From: Daniel Todd Currie <email@hidden>
References: 
 >NSCell's -setStringValue: (From: Daniel Todd Currie <email@hidden>)

  • Prev by Date: Re: Safari-like URL field with favicon
  • Next by Date: Where the dictionary words are stored?
  • Previous by thread: NSCell's -setStringValue:
  • Next by thread: Re: NSCell's -setStringValue:
  • Index(es):
    • Date
    • Thread