Mathieu Tozer's Dev Blog

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





Yaaaaahoooo!

I've integrated subproject Groups into the main pproject Words.

Had one hiccup, and I spent WAY too much time on it before going to google, where I found this apple documentation, right in the Core Data trouble shooting section. I had the intuition to know it was something to do with the Model.

Anyway, I found the following:
-_-_-_-
Cannot create new objects with array controller
Problem: You cannot create new objects using an NSArrayController. For example, when you click the button assigned to the add: action, you get an error similar to the following:
2005-05-05 12:00:)).000 MyApp[1234] *** NSRunLoop

ignoring exception 'Failed to create new object' that raised

during posting of delayed perform with target 123456

and selector 'invokeWithTarget:'

Cause: In your managed object model, you have probably specified a custom class for the entity, but you have not implemented the class.
Remedy: Implement the custom class, or specify that the entity is represented by NSManagedObject.

-_-_-_-

Which was exactly my problem.
I read it carefully, but already knew what my problem was. Since I had tested and could create Languages and groups if the array controllers managed NSManagedObjects, I could tell there was something up with the custom classes. They weren't being included in the target or something... turns out I wasn't even COMPILING them. So of course I was getting stupid errors.

Anyway the good news is that it seems to work pretty well. Every thing has slotted together and I can import lots of words at once, and see them in my library, and divvey them up in manual groups and.

Standby for some delicious screenshots :-)
Piq_060818_111236_83_Words.jpg
This is a screen with a perfectly pedestrian list of words containted within the manual group called "Word of the Day".

Piq_060818_111253_86_Words.jpg
And by setting a simple predicate to the smartgroup, we can automagically specify whichever words we want to see!

Still left to do is write my weekly reports, which the blog should make relatively painless, but that still is something that remains to be seen.

I am going to try out use case, test driven development as a means to creating healthier code which breaks less, and when it does, I know why.

There are still things to implement with regard to smart groups. Right now it's hard to tell which is smart and which is dumb in the list, so it would be nice to have an icon. It would also be sweet if the list was ordered nicely. But that's all UI stuff. The model works! The model works! Yippeee!!

Uh, of course I KNEW it would word, just for the record :D


Is Done, Is Groups

0 comments

Right now the SmartGroups object is trying to do some optimisation schwisseling to determine whether things need updating or not.

It works by setting wordSet to nil if the refresh function determines that the wordset needs updating, if it doesn't then it leaves the current wordset attached to the wordSet variable, and the 'words' function that is called by the bindings is simply returned this old, unrefreshed set.

What seems to be happening in my program is that the refresh function isn't setting wordSet to an appropriate setting.

Ok, so there are a few issues with the groups system. Adding words aren't updating themselves without a restart, which is pretty bad, considering delete works. For some reason they won't fetch. But I am sick of trying to find out why for the moment. So I'm going to leave it and move on.

I seem to be able to type predicates into the predicate box, and they set themselves fine, and the view resets itself to show a nice list of the words that match the predicate in that language.

Features associated with this system that I would like to implement are
1) Drag and drop from manual group to manual group, which adds the receiving manual group object to the set of manualGroups that the word object maintains.

2)User Friendly, graphical user interface for the predicate editor. This would only be able to be built after the groups sub project is incorporated into the main project.
This is because the predicates would have to be set to a more diverse set of object attributes than in the example. It's only once you have interesting meta data that predicates can really show their power.

Along the way i have had some issues with the SVN repository. I have made several project ressurective rollbacks, so I greatly value and ,make use of it's benifits, but I still have some way to go before I can use it seamlessly.

The next task before me is to incorporate the groups sub project into the words project.
I don't think it really makes sense to import it as a framework, because the code is pretty application specific, and while the underlying idea beneath it is useable, I don't think it warrants factoring it out as a framework.


Grroooooooooups

0 comments

Languages will be set via the preferences menu, where the user can set the various settings for the language.

I need to be able to set the predicate to find WORDS that have their language relationship set to

language.name LIKE[c] "English"

language.name like[c] 'Japanese' AND word like[c] 'テスト*'

Will give me a nice smart list of all the words in my Japanese language that have テスト and anything after that (wildcard *).

I'm thinking that if I hard code the first part of the predicate into all smart groups then this would be better design.

So when a smart group is created, it is automatically bound to that language.

If all Language editing is done via the preferences menu, then we might have a model in which to implement this.

Ultimately, what we want to be able to do is simply tell a smart group via a predicate what to display, and have it do that. It's not going to do it automatically (the setting of it) but once it knows what it needs to display, then it's up to us to keep on displaying it without error.

I just committed to SVN probably the most stable version of the system yet.


Weekly Review: 08-13

0 comments

- Continued development of the smart group system.
- Specified more requirements for the grouping system.
- Achieved a milestone implementation of 'the most stable' group system yet.
- Completed the group system, understanding exactly how the Apple sample code worked, and accepting some faults of the system as implemented, because of the constraints of time.
- Documented the features that still need to be implemented.
- Completed the integration of groups into the main words project.
- Words can be seen in manual and smart groups in the main window, and the predicate for the smart groups can be set manually.
- Decided to try to begin use case driven development.


+RSS | dev blog | Portfolio

About me

My status

Last posts

  • my del.icio.us
  • my flickr