• 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: NSTextFieldCell Subclass for Image+Text, any faster way?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextFieldCell Subclass for Image+Text, any faster way?


  • Subject: Re: NSTextFieldCell Subclass for Image+Text, any faster way?
  • From: Brian Amerige <email@hidden>
  • Date: Mon, 20 Nov 2006 23:59:45 -0500

Hi all,

I tried out the attributed string, and the performance was the same, and considering others have said the performance should be fine with the subclass, I'm going to use a subclass as it does a lot of the dirty work forme. Here's my code:

if ([[aCell className] isEqualToString:@"ImageAndTextCell"])
{
if ([[[remoteFiles objectAtIndex:rowIndex] objectForKey:@"NSFileType"] isEqualToString:@"NSFileTypeDirectory"])
{
IconForRemoteTableRow = [[NSWorkspace sharedWorkspace] iconForFile:@"/tmp"];
}
else
{
IconForRemoteTableRow = [[NSWorkspace sharedWorkspace] iconForFileType:[[[remoteFiles objectAtIndex:rowIndex] objectForKey:@"cxFilenameKey"] pathExtension]];
}
[IconForRemoteTableRow setSize:NSMakeSize(16,16)];
[aCell setImage:IconForRemoteTableRow];
}



I tried playing with releasing and allocating the image, caching it (wasn't really familiar with that), or retaining the data, but nothing seemed to help.


Thanks,
Brian.
On Nov 20, 2006, at 11:20 PM, Scott Stevenson wrote:


On Nov 20, 2006, at 7:49 PM, Brian Amerige wrote:

They're quite fine for simple things like TableView's with say, 5 items, but seriously, once I pass 20 or so items, actions are painful in regard to the subclass! This makes sense to me because it's actually redrawing the cell every-time you, say resize the window, scroll, highlight all, etc.

There might be a bug somewhere. Unless you're using a 333Mhz iMac, the computer really should be able to handle redrawing a lot of images very quickly.


It might not be the cell class itself but how you're fetching the images to feed to the cell?

    - Scott

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSTextFieldCell Subclass for Image+Text, any faster way?
      • From: Stephane Sudre <email@hidden>
    • Re: NSTextFieldCell Subclass for Image+Text, any faster way?
      • From: Scott Stevenson <email@hidden>
References: 
 >NSTextFieldCell Subclass for Image+Text, any faster way? (From: Brian Amerige <email@hidden>)
 >Re: NSTextFieldCell Subclass for Image+Text, any faster way? (From: Scott Stevenson <email@hidden>)

  • Prev by Date: Custom images with NSProgressIndicator
  • Next by Date: Re: NSTextFieldCell Subclass for Image+Text, any faster way?
  • Previous by thread: Re: NSTextFieldCell Subclass for Image+Text, any faster way?
  • Next by thread: Re: NSTextFieldCell Subclass for Image+Text, any faster way?
  • Index(es):
    • Date
    • Thread