|Dec 9, 2012, 04:13 AM||#1|
Any ideas why my controller's arrangedObjects is modified so many times?
Hello. I have a tableview whose content is bound to an NSArrayController's arrangedObjects (nothing fancy here). The objects populating the table are entities with many attributes. The controllers is bound to a managed object context.
I want to observe changes in the controller's arrangedObjects property.
Every time I interact with the table in a way that should alter the property (filtering rows, sorting), it appears that this property is changed many times in a row. Like 13 to 20 times when I sort the view by clicking on a column header or when I add a new object to the controller's content. I cannot predict the number of time the property is going to be changed. It doesn't appear to be related with the number of objects populating the view. Note that the app behaves normally. In fact, I haven't noticed anything special before I decided to observe the property.
It doesn't happen to other views that are populated by "simpler" entities with fewer attributes, and bound to other controllers. The arrangedObjects property is changed just once.
|Dec 11, 2012, 10:22 PM||#2|
Without any code, interface files, or core data files, it's rather difficult for me to say why it's behaving that way... honestly, I've only just started my first Core Data Mac app, and I only had a tiny bit of experience with it on iOS... but I suspect if you share any of those files (or even your entire project... or a sampler of the project that exhibits the same behavior...) you'll get some helpful responses.
I would guess you might have some kind of race conditions occurring. IE, maybe different bindings are criss crossing each other and so when one value changes, it sets off a cascade of other changes? Just a guess based off of your description.
Don't tell me Macs don't last: 2007 iMac, 2007 Mac Mini, 2008 MacBook Air, all Vintage.
(iMac obsoletion: April 28, 2015, MBA: October 14, 2015, Mac Mini: March 9, 2016)
|Dec 15, 2012, 07:37 AM||#3|
I don't think my code should modify the arrangedObject property, when sorting the table for instance. My entities do not react to that. Anyway, this isn't a big issue, I was just wondering.
|Dec 15, 2012, 12:13 PM||#4|
You also seem to have another case with fewer calls. So use the debugger on that one, too. Same thing: set a breakpoint, trace who calls it, and work backwards. The goal is to see what a "normal" one looks like, then you can compare and contrast with the "abnormal" one.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|OS X: I wrote an app that enables DualShock controller mapping - pricing ideas?||Starfox||Mac and PC Games||44||Mar 24, 2015 08:07 AM|
|EX Hybrid Controller for iPhone 5 - Keyboard and Gaming Controller||v3rn||iPhone Accessories||3||Jan 3, 2013 06:47 PM|
|About push view controller into a navigation controller stack.||cthesky||iPhone/iPad Programming||5||Nov 9, 2012 08:36 AM|
|Segue from Normal View controller to navigation controller||daproject85||iPhone/iPad Programming||0||Sep 29, 2012 03:26 PM|
|push to a specific view controller regardless of which controller is active||johnmerlino||iPhone/iPad Programming||2||Jun 19, 2012 02:24 PM|
All times are GMT -5. The time now is 06:01 PM.