• 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: variable problem is driving me nuts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: variable problem is driving me nuts


  • Subject: Re: variable problem is driving me nuts
  • From: Andy Lee <email@hidden>
  • Date: Sat, 27 Oct 2012 20:48:15 -0400

You're sure the later method is being called before clients is set? What if you put NSLog statements next to each of the two statements you showed?

Any chance you have another variable called "clients" somewhere?

Any chance you have two instances of your app delegate class? In the NSLog statements, try printing the address of self.

--Andy

On Oct 27, 2012, at 7:51 PM, H Miersch <email@hidden> wrote:

> hi.
>
> in my current project i have this line in the header for the app delegate:
>
> NSMutableArray *clients;
>
> in the app delegate itself, there's this line, in applicationDidFinishLaunching:
>
> clients = [[NSMutableArray alloc] init];
>
> that works as expected. so far so good. but later, in another method in the app delegate, there's this line:
>
> int count = [clients count];
>
> and by the time that line is executed, clients is nil. @property/@synthesize or not makes no difference, ARC on or off makes no difference. WTF? what am i doing wrong? can someone point me in the right direction? thanks.
> _______________________________________________
>
> 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

_______________________________________________

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

References: 
 >variable problem is driving me nuts (From: H Miersch <email@hidden>)

  • Prev by Date: Re: Warning message using stringWithContentsOfFile:encoding:error:
  • Next by Date: Re: variable problem is driving me nuts
  • Previous by thread: Re: variable problem is driving me nuts
  • Next by thread: Re: variable problem is driving me nuts
  • Index(es):
    • Date
    • Thread