• 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: NSImage method problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage method problem


  • Subject: Re: NSImage method problem
  • From: Greg Titus <email@hidden>
  • Date: Fri, 16 May 2003 08:03:44 -0700

On Friday, May 16, 2003, at 07:24 AM, Jericho Hasselbush wrote:

In the method:

- (void)drawInRect:(NSRect)dstRect fromRect:(NSRect)srcRect operation:(NSCompositingOperation)op fraction:(float)delta

when I use 1.0 or a float value for the fraction: argument, I get a compile error:

SimpleGameView.m:29: incompatible type for argument 4 of indirect function call

Which makes absolutely no sense, because I am calling the function as follows:

[image drawInRect:box fromRect:NULL operation:NSCompositeSourceOver fraction:1.0];

Hi Jericho,

Your problem is actually with the srcRect argument. You are passing it a pointer (NULL) instead of an NSRect. The reason why the compiler is telling you argument 4 is that there are two hidden and implicit arguments at the beginning of every Objective-C method: the receiver, and the selector. So from the compiler's point of view, the srcRect argument is the 4th one.

Hope this helps,
- Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSImage method problem (From: Jericho Hasselbush <email@hidden>)

  • Prev by Date: RE: HTML hexidecimal code from NSColor
  • Next by Date: Re: NSImage method problem
  • Previous by thread: NSImage method problem
  • Next by thread: Re: NSImage method problem
  • Index(es):
    • Date
    • Thread