• 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: Can't make window.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't make window.


  • Subject: Re: Can't make window.
  • From: David Remahl <email@hidden>
  • Date: Mon, 10 Feb 2003 19:33:49 +0100

Thanks for the help in creating a custom window.

Heh, heh, typing code to make windows, just like the good old days!

But what's wrong with this (unknown message selector):
------------------
NSRect rect = NSMakeRect(20, 20, 200, 200);
NSWindow *wind;
[wind
initWithContentRect:rect:NSBorderlessWindowMask:NSBackingStoreBuffered: t
rue];

The documentation says:

- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned
int)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag

You seem not to understand the basic syntax of sending messages in objective-C.

You should send the message ("call the method") like this:

NSWindow *wind = [[wind alloc] initWithContentRect:rect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];

That is, you should include the "parameter names" (which are actually part of the method name!), not just specify the arguments. Also, you need to first allocate the window before calling -init on it.

You really should read ObjC.pdf, which is Apple's introduction and reference to the objective C language:

/Developer/Documentation/Cocoa/ObjectiveC/ObjC.pdf

/ Regards, David
_______________________________________________
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: 
 >Can't make window. (From: Steve <email@hidden>)

  • Prev by Date: Re: iCal calendar parser
  • Next by Date: Re: iCal calendar parser
  • Previous by thread: Can't make window.
  • Next by thread: RE: Can't make window.
  • Index(es):
    • Date
    • Thread