On 25/11/2009, at 11:20 AM, James Maxwell wrote:

> 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? 


This should work. Are you sure your object is being inited using -init, and not 
e.g. -initWithCoder:? I think you'll need to post your code, there must be a 
bug somewhere.

--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to