I have constructed my model object with following.
@property (strong, nonatomic) NSString *id;
@property (strong, nonatomic) NSString *somevalue;
@property (strong, nonatomic) NSString *another value;
@property (strong, nonatomic) NSString *xtz;
@property (strong, nonatomic) NSString *st;
@property (strong, nonatomic) NSMutableArray *sc;
Now my mutable array is filled with following sample objects,
{a = 1;b = 6;c = 0;},{a = 2;b = 7;c = 0;},{a = 2;b = 8;c = 0;},{a = 3;b=9;c = 0;}
There are roughly 200 of such objects in my array. Now I cannot figure out a decent way of looping through the array updating the value of for example 'c' to '1' where 'a' ==1.
I could use a for loop like that:
for(int i = 0 ; i <myobject.sc.count; i++) {
NSLog(@"%@",[[myobject sc]objectAtIndex:i]);
}
It would allow me to iterate through the array. But still face the problem of looping through values contains within each object. Maybe a nested loop?