• 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
NSCell's -setStringValue:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSCell's -setStringValue:


  • Subject: NSCell's -setStringValue:
  • From: Daniel Todd Currie <email@hidden>
  • Date: Mon, 17 May 2004 23:09:53 -0700

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.


  • Follow-Ups:
    • RE: NSCell's -setStringValue:
      • From: "Jonathan E. Jackel" <email@hidden>
    • Re: NSCell's -setStringValue:
      • From: James Chen <email@hidden>
  • Prev by Date: Safari-like URL field with favicon
  • Next by Date: Re: disk:// and help:// security problems
  • Previous by thread: Re: Safari-like URL field with favicon
  • Next by thread: Re: NSCell's -setStringValue:
  • Index(es):
    • Date
    • Thread