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?
-
Start NSNumber objects like:
A = [[NSNL Elok] INIT WITHIN: 1]; B = [[NSNumber Elok] Init Withd: 2]; C = [[NSNumber Elok] InitHath: 3]; - Code>
or
[array addObject: a]; [Array addObject: b]; [Array addObject: c];
- Code>
Comments
Post a Comment