Re: Newbie (EXE_BAD_ACCESS?)
Re: Newbie (EXE_BAD_ACCESS?)
- Subject: Re: Newbie (EXE_BAD_ACCESS?)
- From: Thomas Lachand-Robert <email@hidden>
- Date: Mon, 24 Mar 2003 08:02:25 +0100
Dear Bernard,
Your code below seems correct to me, except I'm not sure that it's
possible to suppress the part before ':' (did you try
drawLineFrom:(float)X to:(float)Y for instance?). Maybe you should send
the offending part, too, so the people on the list can check.
Notice that you don't need a new class for that anyway: you can add a
method to NSBezierPath (using a category) to do that.
Le lundi, 24 mars 2003, ` 00:27 Europe/Paris, Bernard Banks a icrit :
On 3/23/03 6:00 AM, "Thomas Lachand-Robert" <email@hidden> wrote:
Your error message says: "invalid RECEIVER"; this means that the
object
receiving the message is not as expected. Try [[Line class]
drawLine:100.0:100.0], but I suspect there is something wrong in your
Line.h file: are you sure you define a class here?
Dear Thomas,
Thanks for your suggestion. I am afraid that neither your suggestion or
Nick's worked. I am missing something fundamental. I imported the
class from
IB, so IB structured Line.h and Line.m. Here are both files:
/* Line */
#import <Cocoa/Cocoa.h>
@interface Line : NSObject
{
}
+(void)drawLine:(float)X:(float)Y;
@end
And
#import <Cocoa/Cocoa.h>
#import "Line.h"
@implementation Line
+(void)drawLine:(float)X:(float)Y
{
NSPoint p1 = NSMakePoint(0,0);
NSPoint p2 = NSMakePoint(X,Y);
[NSBezierPath strokeLineFromPoint:p1 toPoint:p2];
}
@end
Why the warning '(void)(short int, short int)' should appear when the
call
is +(void)drawLine:(float)X:(float)Y is beyond me.
If you have a moment to meditate on this it would be greatly
appreciated.
Thomas Lachand-Robert
********************** email@hidden
_______________________________________________
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.