Mathieu Tozer's Dev Blog

Cocoa, the development of Words, and other software projects (including those dang assessment tasks).




Ahh Finally some progress!


E-mail this post



Remember me (?)



All personal information that you provide here will be governed by the Privacy Policy of Blogger.com. More...



I'm trying to think of a way to deal with the bloat in my
NSArrayController subclasses, particularly to deal with the issue of
fetching and updating... although it might not actually deal with the
issue... but it would certainly cut down on bloat in those array
controllers.

Here are the symptoms
Words are inserted into the moc
'old' smart lists don't update themselves
'new' smart lists will

So it's almost certainly an issue with the predicates save/refresh
cycle.

I think it has to do with my SmartGroup class. It's a bit of a hack
really. And it also might have something to do with the way I
identify smartgroups and tie them to languages, and how the simple
name value of the language is what is used to fetch words. I think it
would me more intelligent and better design to use the objectID as
the key across the system for language, and to get the name of the
language as needed.

I designed it this way because back then I didn't even realise the
all objects had an ID (well it's obvious NOW) that I could use to
identify the languages uniquely.

I had the idea of doing this, but I found I couldn't set an entire
entity object into a predicate field, but now I can get an object ID
string which will do the same thing as having the object itself.

So while I'm fixing this, I'm also going to try and iron out a few of
those warnings and things which also might be stuffing me around.

Nope, even forcing object directly into the ManagedObjectContext
doesn't fix the problem (it actually causes problems with updating).

What about this idea. What if all I store is a predicate string, and
then when the group is loaded, all it does is force a filter on the
words array controller, so that it filters out the words that I want.
Filtering works nicely. And I can set filter predicates programatically.
So bind the filter predicate of the words array controller to the
selected group of the group array controller. But let's test this now
with that playgroud tableview I set up.

Woah if this thing works, then I have a big lesson to learn about
chucking one's own hard earned code away. I DID have this idea
several times in the past... I hope to high heaven it works!

Tough Titties!
Bad code is bad code.

Hey, it actually feels good to delete it all! And guess what, most of
it was complicated scwisseling code from the CoreRecipesApp anyway.

It IS noticeably slower, so I won't delete that caching thing just
yet. Well it worked just then. Perhaps it's tempremental.
Nevertheless, I have fixed a major bug anyway. Now I have to hook the
other stuff up again and hope it keeps on working!


0 Responses to “Ahh Finally some progress!”

Leave a Reply

      Convert to boldConvert to italicConvert to link

 


+RSS | dev blog | Portfolio

About me

My status

Previous posts

  • my del.icio.us
  • my flickr