• 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: Declared or not?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Declared or not?


  • Subject: Re: Declared or not?
  • From: "David W. Halliday" <email@hidden>
  • Date: Wed, 26 Mar 2003 10:16:23 -0600
  • Organization: TNRCC

Peter Karlsson wrote:

Dear list!

My interface file looks like this:

----------

@interface DataManager : NSObject
{
@private
Byte **partmidi_ptr;
}

...

@end

----------

And my implementation file looks like this:

----------
...
----------

But this line (located in another file) generates an error, `partmidi_ptr' undeclared, why? I declared it in my interface file...

if((partmidi_ptr = malloc(sizeof(*partmidi_ptr) * 1024)) == NULL)

Peter

First, you don't state whether this other file includes "DataManager.h". If it doesn't, then you /certainly/ haven't declared `partmidi_ptr' (so far as we can see in what you've shown us). However, even if you have included "DataManager.h", the only `partmidi_ptr' you /have/ declared (that we can see) is an /instance/ variable that is only accessible within an instance of the "DataManager" class, or an instance of a subclass thereof (or via a data structure view of such).

By the way, what programming languages have you had experience with? (This will help us tune our terminology, and provide a basis for analogies that should help us help you.)

I hope this helps.

David Halliday
_______________________________________________
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: 
 >Declared or not? (From: "Peter Karlsson" <email@hidden>)

  • Prev by Date: Re: Dragging a file out of an NSTableView
  • Next by Date: Re: Secondary doc window connection (window titles)
  • Previous by thread: Declared or not?
  • Next by thread: Re: Secondary doc window connection (window titles)
  • Index(es):
    • Date
    • Thread