• 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: passing NSRect struct as an arg
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: passing NSRect struct as an arg


  • Subject: Re: passing NSRect struct as an arg
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 16 Dec 2002 17:52:54 -0800

On Monday, December 16, 2002, at 05:36 PM, crucial felix wrote:

first of all thanks for all the archives, i've been reading them a lot.

question:
in a view subclass i obtain my bounds:

NSRect bounds = [self bounds];

size is: 480 x 276

pass it to an object that draws:

[sfp drawWaveformFrom:0.0 to: [sfp duration] inRect: bounds];

SFP:
-(void)drawWaveformFrom: (float)start to:(float)end inRect:(NSRect)rect
{
NSLog(@"rect: %f %f",rect.size.width, rect.size.height);

..
}


and when it gets there its garbage
x: 3.5 y: -3.68934881e+19 size: 0 x 0


sorry if this is obvious, but web and archive searching hasn't solved it for me.

Looks like you're examining the values before you've executed the first line in the function.

What happens when you do this:

-(void)drawWaveformFrom: (float)start to:(float)end inRect:(NSRect)rect
{
NSLog(@"start: %f" end:%f", start, end);
NSLog(@"rect: %f %f",rect.size.width, rect.size.height);
NSLog(@"about to leave the method.."); // break here.
..
}

-jcr

John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.

  • Follow-Ups:
    • Re: passing NSRect struct as an arg
      • From: crucial felix <email@hidden>
References: 
 >passing NSRect struct as an arg (From: crucial felix <email@hidden>)

  • Prev by Date: Re: Size limit for NSData.
  • Next by Date: Re: passing NSRect struct as an arg
  • Previous by thread: passing NSRect struct as an arg
  • Next by thread: Re: passing NSRect struct as an arg
  • Index(es):
    • Date
    • Thread