Re: NSImageCell continued...
Re: NSImageCell continued...
- Subject: Re: NSImageCell continued...
- From: Ondra Cada <email@hidden>
- Date: Tue, 26 Feb 2002 18:16:36 +0100
Lukasz,
sorry I can't find why it does not work at all, but some issues I seem to
bumped into:
>
>>>>> Lukasz Kuczborski (LK) wrote at Tue, 26 Feb 2002 15:51:15 +0100:
LK> Table *nowy = [[Table alloc] init];
Would leak if the code below raises exception. Use autorelease.
LK> [nowy setIconCell:[[NSWorkspace sharedWorkspace]
LK> iconForFile:[[NSFileManager defaultManager] currentDirectoryPath]]];
Looks like you set the very same icon (of the / when app's launched from
Finder) to any file. That does not seem to be what you wanted?
Anyway, try here
NSImage *img=[[NSWorkspace sharedWorkspace] iconForFile:path];
NSLog(@"Got image %@",img);
to be sure whether you get an image. I guess your path is *not* complete,
from the code it looks you have to do something like
path=[theScannedFolderPath stringByAppendingFileComponent:path] first.
LK> [nowy release];
See above, this is a wrong memory management pattern.
LK> [table reloadData];
put this outside the loop.
>
>>>>> Lukasz Kuczborski (LK) wrote at Tue, 26 Feb 2002 15:35:01 +0100:
LK> - (void)setIconCell:(NSImage *)s
LK> - (NSImageCell *)iconCell;
And what does this have to do with displaying the icons in the table?
LK> But still...i can't get icons displayed in my Table...hmmm...what's
LK> wrong?
You have to set the cell's image in the table, before it is displayed.
If you are satisfied with an image-only column, you can put the image as the
cell's objectValue, and you have to change the cell class to NSImageCell. If
you wanna have images and texts boths, you need to make your own cell
subclass. See the Examples on your hard disk, it's all there.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.
References: | |
| >NSImageCell (From: Lukasz Kuczborski <email@hidden>) |