objective c - Accessing elements of an array, Objectice C -


Hi trying to reach the elements of an array and change them as if I have a number with numbers and variable x The array is the I go through the array and with the values ​​the variable x is replaced. I tried to do this, but I get an error for the statement which is ending the application due to the exception exception 'NSR exchange', because: ' * - [__ NSAMM Object Attendex:] : Limits beyond index 3 [0 .. 2] '

  if ([stack contains object: @ "x"]) {int x; For (x = 0; [stack object atxxx]; x ++) {[Stack object at index: with x object: [variable value objectForcae: @ "x"]]; }    

What error are you getting? There may be some things to look at on your code. If the array length is zero, then accessing an object on index 0 will throw an error. Also, for the workplace, the array needs to be unstable.

- Also, if your object returns to Neil again, in the replacement method, throw an error in trying to change the zero Will go. See the update code below:

  If ([Object included in the stack: @ "X"]) (emphasis [[Stack hackedoff class: [NSMUtABErera class]]); NSUInteger calculation = [ Stack count]; (NSUntessor x = 0; XLL; count; x ++) {value of ID = [variable value objectForcowi: @ "X"]; if (value! = Zero) {[instead of stack ObjectAutandx: Object with X: Value];}}}    

Comments