• 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: NSMutableArray is null?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableArray is null?


  • Subject: Re: NSMutableArray is null?
  • From: Ken Thomases <email@hidden>
  • Date: Tue, 31 Mar 2009 21:19:05 -0500

On Mar 31, 2009, at 9:12 PM, Pierce Freeman wrote:

Whoops, sorry I didn't put that in...

@interface Example_Class : NSObject {

   IBOutlet NSTableView *tableView;
   NSMutableArray *globalVariable;
}

That's not a global variable. It's an instance variable. That's a massive conceptual error, and you should do your best to understand why you made it before going much further. Perhaps reading Apple's guide to Object-Oriented Programming with Objective-C would help:


http://developer.apple.com/documentation/Cocoa/Conceptual/OOP_ObjC/index.html

Next, what you showed is the declaration of the variable. The variable is a pointer, which may point to an object. Declaring a pointer does not allocate or initialize the object, nor make the pointer point to the object (or anything in particular). You have to do that separately.

Regards,
Ken

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSMutableArray is null?
      • From: Pierce Freeman <email@hidden>
References: 
 >Re: NSMutableArray is null? (From: Pierce Freeman <email@hidden>)

  • Prev by Date: Re: NSMutableArray is null?
  • Next by Date: Re: NSMutableArray is null?
  • Previous by thread: Re: NSMutableArray is null?
  • Next by thread: Re: NSMutableArray is null?
  • Index(es):
    • Date
    • Thread