Learn Courses My Dashboard

Working with "2D" Arrays

I am a newbie and having trouble with some basics.

Created a Core Data Entity with 9 properties: 1 string, 1 ID, 6 Int64’s and 1 timestamp.

Manually saved 5 entries (“rows” in the matrix) to ensure Core Data is working. It is.

Every time I perform a FetchRequest, I’d like to add the respective “columns” from the matrix, to then divide by number of “rows”, i.e., to get an average.

Any suggestions on how to do this?

And can I place a call to “calcAvgs” (a function I’ll create to do the above), right after the FetchRequest?

Any help is appreciated.

– Doxie

Oh, I should have mentioned, I’m obviously only interested in finding the average of the Int64 attributes, not the string, ID or timestamp.