• 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: shared instance and nstableview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shared instance and nstableview


  • Subject: Re: shared instance and nstableview
  • From: Andy Lee <email@hidden>
  • Date: Tue, 9 May 2006 22:19:21 -0400

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.


--Andy

_______________________________________________
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


  • Follow-Ups:
    • Re: shared instance and nstableview
      • From: "Lawrence Sanbourne" <email@hidden>
References: 
 >shared instance and nstableview (From: Yorh <email@hidden>)
 >Re: shared instance and nstableview (From: "Lawrence Sanbourne" <email@hidden>)

  • Prev by Date: iClass example, core data and multiple stores
  • Next by Date: Re: shared instance and nstableview
  • Previous by thread: Re: shared instance and nstableview
  • Next by thread: Re: shared instance and nstableview
  • Index(es):
    • Date
    • Thread