Problem in displaying image in NSTableView
Problem in displaying image in NSTableView
- Subject: Problem in displaying image in NSTableView
- From: cocoa learner <email@hidden>
- Date: Sun, 19 Apr 2009 08:54:28 +0600
Hello All,
In my NSTableView I am using NSImageCell as one column to display images.
And I have implemented my datastore method like this -
- (id) tableView: (NSTableView *)aTableView
objectValueForTableColumn: (NSTableColumn *)aTableColumn
row: (NSInteger)rowIndex
{
/* code to display other column data
.....
*/
//Code to display image
if (coloumnIndex == 2)
{
NSImage *tmpImage = [[tableData objectAtIndex: rowIndex] personPhoto];
NSLog(@"TableController::dataSourceSecondAPI : [ Debug ] Coloumn Index = 2,
so returning the image");
return tmpImage;
}
}
And my persons init method looks like this -
- (id) init
{
[super init];
personName = @"New name";
personAddr = @"New addrress";
personPhoto = [[NSImage alloc] initWithContentsOfFile:
@"/Volumes/Working/cocoa/Play-NSTableView/Linea.jpg"];
if (personPhoto == nil)
{
return nil;
}
return self;
}
After running my application the image looks very small like an icon.
Can any one tell me how to display a bigger image in NSTableView?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden