Friday, 15 May 2015

iphone - how to create array string -


I have NSMutableArray with student information, now I just want to remove the student's name and their average score, so did I

  NSMutableArray * stuCollection = [[NSMutableArray alloc] initWithCapacity: [student count]]; For (Int i = 0; I & lt; [Student count]; i ++) {If ([Object ot & amp; Ax: i]! = Null) {NSDrivement * DYK = [Student ObjectEndex: I]; NSString * temp = [Dick ObjectForcae: @ "name"]; [Stuckuction Ad Object: Name]; }} For (int jm = 0; jum [l} [stuCollection count]; j ++) {NSLOG (@ "name% @", [stew collection objectindex: j]); }  

I am able to run it for the first time, but when I auto scan, I can exe for loop 1, 2, 3, but then the apps can be down In the end of the show, the app ended due to the reason:

2009-12-02 14: 57: 37.908 AppBuzz [13073: 207] * Expected exception 'NSInvalidArgumentException' * - [NSCFArray insertObject: atIndex:]: 57: 37.916 AppBuzz [13073: 207] Heap: Attempt to insert zero 2009-12-02 14 (820,145,437, 837,578,260, 819,694,387, 819,694,291, 814,683,071, 814,716,415 , 814, 716,245, 17529, 24,097, 814,480, 795, 819,893,443, 819,891,231, 85 8682228, 861592624, 861585968, 8997, 8860) are terminated after throwing an example of the 'NSException' program received. "SIGABRT"

How this can be improved

thanks

Do you understand logic?

  emphasis (students); Emphasizing ([count of students]); NSMutableArray * stuCollection = [[NSMutableArray alloc] initWithCapacity: [student count]]; StuCollection; (Int i = 0; i & lt; [students count]; i ++) {if ([students objectAtIndex: I] = zero!) {NSDictionary * DIC = [students objectAtIndex: i]; Emphasis (DIC); NSString * temp = [Dick ObjectForcae: @ "name"]; Emphasis (temporary); Emphasis (name); [Stuckuction Ad Object: Name]; }} ...  

No comments:

Post a Comment