• 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
NSScrollView setDocumentView: problem with NSView subclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSScrollView setDocumentView: problem with NSView subclass


  • Subject: NSScrollView setDocumentView: problem with NSView subclass
  • From: Matt Ball <email@hidden>
  • Date: Wed, 20 Jul 2005 20:18:55 -0400

I've got an NSScrollView (added with IB) in my app. I've got an NSView
subclass that I am trying to add as the scrollView's documentView, but
I keep getting the following warning:

"Passing argument 1 of 'setDocumentView:' from incompatible pointer type."

Here's my code:

// scrollViewController.h

@class imageView;

@interface imageViewController : NSObject
{
    IBOutlet id scrollView;
	imageView *theImageView;
}

// scrollViewController.m

- (void)dealloc {
	[theImageView release];
	[super dealloc];
}

- (void)awakeFromNib {
	theImageView = [[imageView alloc] initWithFrame:NSMakeRect(20,20,300,200)];
	[scrollView setHasHorizontalScroller:YES];
	[scrollView setHasVerticalScroller:YES];
	[scrollView setScrollsDynamically:YES];
	[scrollView setDrawsBackground:YES];
	[scrollView setBackgroundColor:[NSColor colorWithCalibratedWhite:0.4
alpha:1.0]];
	[scrollView setDocumentView:theImageView];
}

Does anyone have an insight into why I am getting this error? (The
NSView subclass never shows up in the window, by the way). Thanks.

- Matt Ball
 _______________________________________________
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: NSScrollView setDocumentView: problem with NSView subclass
      • From: glenn andreas <email@hidden>
    • Re: NSScrollView setDocumentView: problem with NSView subclass
      • From: John Pannell <email@hidden>
  • Prev by Date: Re: NSFileManager - "Can't read ..." - Strange update
  • Next by Date: Inspects, Bindings over keyPaths and the Not Applicable placeholder
  • Previous by thread: NSValueTransfomer with lots of data
  • Next by thread: Re: NSScrollView setDocumentView: problem with NSView subclass
  • Index(es):
    • Date
    • Thread