I’ve been profiling my table view and one line in particular is dropping my frame rate from 50 to about 30… the thing is, the line of code seems pretty harmless.
It is in:
– (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
I’ve removed all none relevant code and just left the line as:
oneSession.totalForThisMetric = [NSNumber numberWithInt:1];
What is core data doing with it’s setter than hurts performance so bad? totalForThisMetric, not only is monatomic, retain – but it’s also a transient core data property!
The thing is: transient properties are not meant to be set this way. You should set them in the -awakeFromFetch and/or -awakeFromInsert methods, depending on your needs. Please read the relevant documentation on “Object life cycle initialization and deallocation” and modify your code accordingly.