ios - NSMutableArray crashes or have 0 data -


I am trying to use an unstable array of data to keep, and as my edit program uses it.

  NSMutableArray * array; NSN * A = 1; NSN * B = 0; NSNumber * C = 3;  

These methods have tried to define the array:

Method 1:

  array = [[NSMUTABELARROL] init ]; [Array addObject: a]; [Array addObject: b]; [Array addObject: c]; // Results - Accidents  

Method 2:

  array = [[NSMUTABELARROL] initWithObjects: a, b, c, nil]; // result - [array number] return 0  

method 3:

  array = [[NSMUTABELARROL] INST]; Array = [NSMutableArray arrayWithObjects: a, b, c, zero]; // Results - Crash  

It seems that if I do [[NSMutableArray alloc] init]; This will be the cause of the accident, I am not sure that there is a line which causes the crash.

How do I solve it?

  1. Start NSNumber objects like:

    A = [[NSNL Elok] INIT WITHIN: 1]; B = [[NSNumber Elok] Init Withd: 2]; C = [[NSNumber Elok] InitHath: 3];
  2. Code>

    or

      [array addObject: a]; [Array addObject: b]; [Array addObject: c];  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -