• 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
int* array going astray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

int* array going astray


  • Subject: int* array going astray
  • From: James Maxwell <email@hidden>
  • Date: Tue, 24 Nov 2009 16:20:29 -0800

I have a couple of int* arrays I'm using as instance variables - they're declared in my @interface section, and inited using malloc when I init the object (and free()'d in the dealloc). I can set them, using standard array notation (i.e., number[i] = 7) while I'm in a given method, but the values reset to zeros as soon as I try to read them from another method - that is, they don't seem to be retained by the object. I really don't get what's up. I have other 2D float* arrays inited in the same way, and these work as expected, with their contents being retained by the class (and thus accessible from other methods). Does anyone have any explanation as to why this might be happening?

thanks in advance,

J._______________________________________________

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: int* array going astray
      • From: Michael Babin <email@hidden>
    • Re: int* array going astray
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: Inactivity Timer
  • Next by Date: Re: int* array going astray
  • Previous by thread: Re: How do you use an Application ID for an iPhone application
  • Next by thread: Re: int* array going astray
  • Index(es):
    • Date
    • Thread