• 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: Accessing array from class [newbie]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing array from class [newbie]


  • Subject: Re: Accessing array from class [newbie]
  • From: jean Bousquet <email@hidden>
  • Date: Sun, 01 Sep 2002 23:22:47 +0200

le 31/08/02 22:41, email@hidden `
email@hidden a icrit :

> On lxrdag, aug 31, 2002, at 19:15 Europe/Oslo, Sherm Pendley wrote:
>
>> On Saturday, August 31, 2002, at 09:17 AM, Onar Vikingstad wrote:
>>
>>> I am trying to access/get an array from another class, but when I use
>>> [[[AccessControl init] alloc] getAccess] it just returns null.
>>
>> You've got your alloc: and init: reversed. Alloc creates an object,
>> and init initializes it - you have to call them in that order, because
>> if you reverse them, you're trying to initialize an object that
>> doesn't exist yet.
>>
>> Try this instead:
>>
>> [[[AccessControl alloc] init] getAccess];
>>
>
> Ok, that was a typo on my part. But I still get "null" from the array
> I'm trying to get. Why is that? In the class I'm getting it from
> (AccessControl) the array named access works just fine. And when I use
> the getAccess method to return that array, shouldn't it work?

I suppose access is an instance variable in your AccessControl class.
Does your init method initialize access to some thing ?

Jean
_______________________________________________
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.

  • Prev by Date: Re: [newbie] Using progress indicators in different threads
  • Next by Date: Selecting NSTextFieldCell as First Responder?
  • Previous by thread: Re: Accessing array from class [newbie]
  • Next by thread: Deprecation Warning for archivedDataWithRootObject(Object) in NSArchiver (10.2 Cocoa - Java)
  • Index(es):
    • Date
    • Thread