• 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: NSImageView and custom cells....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImageView and custom cells....


  • Subject: Re: NSImageView and custom cells....
  • From: "John C. Randolph" <email@hidden>
  • Date: Thu, 26 May 2005 09:34:01 -0700


You're probably running into the classic problem of unarchiving custom controls from nib files.   If you're creating your custom Image view by setting the "custom class" attribute in IB, then when the nib file is read, you'll get an instance of your WGDBImageView, but the cell it contains will be a plain old image cell.

To correct this, implement -awakeFromNib in your WGDBImageView class, and replace the cell with a new WGDBImageCell.

-jcr


On May 26, 2005, at 12:52 AM, Teunis Peters wrote:

Am trying to replace cell in an NSImageView subclass.  I don't think the cell code much matters here - here's the image code.
No matter what I do, all I get is 
*** -[NSImageCell setImageCell:]: selector not recognized
Exception raised during posting of notification.  Ignored.  exception: *** -[NSImageCell setImageCell:]: selector not recognized

ideas?   I'm just about to rewrite the whole thing into a custom control (ick).   The cell incidentally works just fine in an NSMatrix control, just for what it's worth.

OSX 10.3, xCode 1.5.   Have been searching archives last 2 hours, no leads.   This is the best I've gotten so far.

@implementation WGDBImageView
+ (Class) cellClass { return [WGDBImageCell class]; }
+ (void)initialize {
    if (self == [WGDBImageView class]) { [self setCellClass:[WGDBImageCell class]]; }
}

-setImageCell:(id)_link {
    WGDBImageView* qc = [self cell];
    return [qc setImageCell:_link];
};

-(id)imageCell{
    WGDBImageView* qc = [self cell];
    return [qc imageCell];
};
@end
 ____________________________________


John C. Randolph <email@hidden> (408) 974-8819
Lame Duck Cocoa Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html



 _______________________________________________
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: NSImageView and custom cells....
      • From: Teunis Peters <email@hidden>
References: 
 >NSImageView and custom cells.... (From: Teunis Peters <email@hidden>)

  • Prev by Date: Re: List of QuickTime File Types
  • Next by Date: Re: NSTableView - Text Style
  • Previous by thread: NSImageView and custom cells....
  • Next by thread: Re: NSImageView and custom cells....
  • Index(es):
    • Date
    • Thread