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

Re: NSScrollView setDocumentView: problem with NSView subclass


  • Subject: Re: NSScrollView setDocumentView: problem with NSView subclass
  • From: John Pannell <email@hidden>
  • Date: Wed, 20 Jul 2005 19:03:41 -0600

Hi Matt-

I don't think your view is allocated correctly... in the following line...

theImageView = [[imageView alloc] initWithFrame:NSMakeRect (20,20,300,200)];

I think you meant [NSImageView alloc] instead of [imageView alloc].

HTH!

John

On Jul 20, 2005, at 6:18 PM, Matt Ball wrote:

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:
40positivespinmedia.com


This email sent to email@hidden



_______________________________________________ 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: Matt Ball <email@hidden>
References: 
 >NSScrollView setDocumentView: problem with NSView subclass (From: Matt Ball <email@hidden>)

  • Prev by Date: Inspects, Bindings over keyPaths and the Not Applicable placeholder
  • Next by Date: NSOutlineView and outlineViewSelectionIsChanging
  • Previous by thread: NSScrollView setDocumentView: problem with NSView subclass
  • Next by thread: Re: NSScrollView setDocumentView: problem with NSView subclass
  • Index(es):
    • Date
    • Thread