nsarray - Objective-C/cocoa losing array values -


I have several arrays, however, they do not keep their data for use in other ways.

Here's how I set it up (Simplified)

.h

  NSArray * array ; @property (nontromic, copy) NSArray * array; - (zero) someMethod: (NSArray *) someArray; - (zero) heresNewMethod;  

meter

  - (zero) someMethod: (NSArray *) someArray {array = [someArray copy]; } - (zero) heresNewMethod // is not called by law {nslog (@ "% @", array);  

One of two things happened:

  • You sent a some method: message to the object, zero (possibly without meaning) passed. Returns a message zero for zero , so you've specified the result as a result of zero as a copy message < Code> array example variable even if you had already placed an indicator in an array, then you have to do it with zero with some code: some method: Replaced with message
  • You have never sent a some method to the object: as the example is started in the variable variable zero , and you array < / Code> Do not keep anything separate in the example variable, it still has zero .

To test the first code, sprinkle more NSLog statements in your code. The truth is either one or the other, so the confirmation of the first principle demeans the other, and vice versa.


Comments