I am working on a project where I have some value (stored in my database as float) in my array Download and give them yoga. I can NSLog numbers but unfortunately in my array is the hardest time to sum those values.
Adding some code
DETAILS.H
#import & lt; Foundation / Foundation. H & gt; Description of @Intefaces: NSobis @ Property (non-ram, strong) NSNM * minutes; // property (non-stick, strong) NSString * min; @end
The part of the code where I put the value in the array
for (int i = 0; I & lt; jsonArray.count; i ++) {NSDIPan * JasonAlement = Jason Aurere [I]; TempDetails * downloadTemps = [[tempDetails alloc] init]; DownloadTemps.min = jsonElement [@ "min"]; // Add this question to the Places array [_locations addObject: downloadTemps]; }
See administrator code
for (description * sav in _importArray) {NSLog (@ "High: -% @ ", Sav.min); // List all my values properly) NSMutableArray * newArray = [_importArray mutableCopy]; Int totalSum = 0; For (int i = 0; i
The selector is asking for you intValue
, but You should ask for the selector minute
.
totalSum = totalSum + [[NewOrreOutIndexX: i] minute] IntValue];
You were very close to the first block you posted:
for (description * sav in _importArray) {NSLog (@ "High: % @ ", Sav.min); / / List all my values properly}
then:
int totalSum = 0; (Description * sav in _importArray) {totalSum + = [sav.min intValue]; }
By coincidence, why are you asking intValue
for some of the writing that you initially wrote?
Comments
Post a Comment