Re: shared instance and nstableview
Re: shared instance and nstableview
- Subject: Re: shared instance and nstableview
- From: "Lawrence Sanbourne" <email@hidden>
- Date: Tue, 9 May 2006 21:45:18 -0500
On 5/9/06, Andy Lee <email@hidden> wrote:
On May 9, 2006, at 7:02 PM, Lawrence Sanbourne wrote:
> On 5/9/06, Yorh <email@hidden> wrote:
>> +(GAChannelList*)sharedInstance{
>> static GAChannelList * sharedList = nil;
>> if (sharedList == nil) {
>> sharedList = [[GAChannelList alloc] init];
>> }
>> return sharedList;
>> }
>
>
> Hi Yorh,
>
> The problem is that you're setting sharedList to nil every time
> +sharedInstance is called.
That is not correct. A static variable is initialized exactly once,
no matter where it is declared.
My apologies! That's cool, and I didn't know that.
Larry
_______________________________________________
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