objective c - Error: index 1 beyond bounds for empty array -


I created a NSMutableArray to store some letters there. When I'am add some character it gives me an error here My code:

  @property (strong, nonatomic) NSMutableArray * functions; & Lt; Synchronize the actions of ViewController.h; & Lt; ViewController.m Action = [[NSMUTABELARROL] INIT]; Switch ([sender tag]) {case 0: currentLabel = water; [Enter objects: @ "0" on index: i]; I ++; break; Case 1: Current Label = Coke; [Enter the objects Object: @ "1" at index: i]; I ++; break; Case 2: Current Labels = Imagery; [Enter objects: @ "2" andx: ii]; I ++; break; } [Actions addObject: @ "X"]  

/ Code> Instead of if there is no element in the array, then you can not put the pointer on object 1.


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

list Class in C++ -