• 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: (hopefully) simple newb question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (hopefully) simple newb question


  • Subject: Re: (hopefully) simple newb question
  • From: Mike Abdullah <email@hidden>
  • Date: Wed, 18 Jan 2006 23:51:53 +0000

It imports my subclass of NSDocument. Do I actually need to import NSDocument itself as well then? That would make little sense to me, but I'll give it a quick go.

Mike.

On 18 Jan 2006, at 22:41, Jonathan Hendry wrote:


Does your NSWindowController subclass's .m file import NSDocument.h?

If not, the compiler won't know the type of the argument, and will
assume it's an id, which is a pointer. Since you're giving it an
int, and it thinks a pointer is required, it gives you the warning.

- Jon

On Wednesday, January 18, 2006, at 05:23PM, Mike Abdullah <email@hidden> wrote:

I keep getting a warning message in my code when I compile and I
cannot see what I'm doing wrong!  However, I'm sure it's fairly easy
to solve (although I couldn't find anything when googling), so please
forgive me if I've just been really, really stupid here.

I have a pretty standard document based app, although I have
subclassed NSWindowController as well as NSDocument.

In my doc window, there is a popup button.

When an item is selected from that popup, the window controller does
[[self document] setEventKind: [[sender selectedItem] tag]].  This
should call the setEventKind: method in my NSDocument yes?

setEventKind is declared in the NSDocument like this:
- (void)setEventKind:(int)newEventKind

Now as far as I can see that is OK.  setEventKind is called by my
NSDocument whilst the document is first loading and it works fine,
but when I try to call it from the window controller, I keep getting
the compiler warning:

"passing argument 1 of setEventKind: makes pointer from integer
without a cast"

Why is this a problem from the window controller, but not from the
NSDocument?

Thanks,
Mike.
_______________________________________________
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



_______________________________________________ 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
References: 
 >(hopefully) simple newb question (From: Mike Abdullah <email@hidden>)

  • Prev by Date: UIElement activation
  • Next by Date: how to generate a map from gis data
  • Previous by thread: Re: (hopefully) simple newb question
  • Next by thread: NSStringEncoding -> NSCharacterSet?
  • Index(es):
    • Date
    • Thread