Feb 28 2007

That sweet smelling Cocoa

Categories: Programming
Tags:

So, I sat down and played with Cocoa a bit more last night. I’ve previously read through Cocoa Programming for Mac OS X which was a really good introduction to Cocoa programming. The problem being, it’s been about six months since I read it. I’m a bit sketchy on the details. May need to go back and review some of the fundamentals.

Anyway, I was trying to work with Core Data to define a model that would have two entities. A spell list and a list of schools. Yea, I’m a geek. I’m looking into gaming software. Finish yer laughing. Now that you’re done, each spell can have an associated school and each school can have many associated spells. Nothing fancy.

When creating new entries we’d have a box to enter the spell name and a drop down to select the school. The drop down should do auto-complete if you type in it and if you enter something that isn’t already in the list it should be added.

This is all well and good. The NSComboBox gives me the features I want for the drop down easy enough. It has the auto-complete and it has the add if missing. The part that tripped me up was that while the add if missing works normally it doesn’t appear to work if you’re using Core Data as the backend. When it tries to add the item to the list it passes an NSString when it should be passing an NSManagedObject which causes an exception to be thrown and nothing happens.

After a bit of hunting I stumbled across some emails where other people were having the same issue. As far as I can tell you just can’t do this with Core Data without a lot of fiddly behind the scenes work. So, looks like Core Data isn’t going to give me the love I was hoping for.

I’ll have to look into another way to save my data. Either using something like YAML or doing the SQLite work myself. We’ll see. But, I’ve got to get better at the basic Cocoa before then anyway.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Feb 27 2007

Is there anybody out there

Categories: Life

Hm, almost two months since my last post. I seem to be getting pretty lax again. I’m not dead, just haven’t had a burning desire to post any news.

Lets see, in the last two months I’ve spent a week in Bohemia, New York. A week in Stockholm, Sweden. Quite a few hours playing Xbox360, asked “Do you have any Wii’s” a countless number of times and, actually got to play a Wii when we went and visited Adam and Mel.

I’ve gotten a bit burnt out on the politics and personalities around the Enlightenment project lately. I’ve been re-directing my time to looking at Cocoa. Playing with some examples, checked out the Ruby-Cocoa bridge and a few other things. I think I’m going to try to write a couple apps to make keeping track of gaming things a bit simpler.

It’s a little disconcerting to go from having a widget toolkit that you know pretty close to backwards (that being Ewl of course) to Cocoa where I don’t know the first thing about it. It’s hard to go back to first principles and start figuring out how you’re supost to open a window or make a label. Hard, but fun.

In other news, Stacy has taken to updating her blog again. Yea.

This post brought to you by the fact that Nathan pointed out he’s posted twice since I last updated and if you look at his posting frequency, that’s pretty bad.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]