Im having problems trying to add (sum) up all the values in a NSMutable Array: The ProfileItems contains data from a Core Data Entity, and is populated with the correct data. I'm just having problems parsing through the NSMutableArray and adding up the profileItems.songLength data.
Thanks in advance
ProfileItems *profileItems = [profileItemsNSMArray objectAtIndex:indexPath.row];
//Renumber the rows
int numberOfRows = [profileItemsNSMArray count];
NSLog(@"numberofRows: %d", numberOfRows);
for (int i = 0; i < numberOfRows; i++)
{
int sumOfSongs = sumOfSongs + [[profileItems.songLength] objectAtIndex:i];
NSLog(@"length: %@",sumOfSongs);
}