• 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
Problem in displaying image in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Problem in displaying image in NSTableView
      • From: Steve Christensen <email@hidden>
  • Prev by Date: Re: Compiling a XIB creates a different NIB file everytime
  • Next by Date: simulating nested classes in objective-c
  • Previous by thread: Re: Empty stack trace in crash reports
  • Next by thread: Re: Problem in displaying image in NSTableView
  • Index(es):
    • Date
    • Thread