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.


Aug 20 2006

Busy like an undead bee

Another pseudo busy weekend in the ciy, although Stacy would say I have it easy.

We went and saw Accepted on friday which was a great movie. It’s packed with a tonne of good jokes and, scary enough, has a bit of a point to it.

I’d highly recomend it to anyone that wants to go and have a good laugh.

When we were at the movie theater there is a big sign that reads ‘There are two lines‘ so, we join the second line, which has no-one in it (there are about 10-20 people in the first line). We walk to the front and this lady leans over to Stacy and says ‘Honey, there’s only one line’. I kinda wish I had of heard so I could have made fun of her lemming based lifestyle. Stacy hadn’t seen the sign, although I’d told her what it says, so we left the line and just used the automated machine. But next time, oh, next time she’ll be armed with the knowledge of the great and glorious sign.

I spent most of Saturday either cleaning shit, or reading about Cocoa programming. It looks like Cocoa can let you do some really swank things easily so I’m thinking of going out and buying a book on it. Give it a read over and see how it goes.

I also dumped Gentoo off of my main box. I tried the Nexenta livecd and it drove me up the wall. The first problem I ran into was logging into the livecd. Now you’re probably saying, the info is on the bottom of that page. Well, Nexenta has two websites the other being gnusolaris.org. gnusolaris.org is where I downloaded and got all my info from. It also dosen’t mention the username/password for the damn livecd. Of course once I get in, shit just starts to crash then it locked up. So, out the door with you.

I switched to Ubuntu 6.06 instead. I’d installed it at work the other day to play with it and decided to install it here as well. I had some problems installing things at work but everything seems to have gone smoothly. I’ve got E17 running on there and it all looks good.

Anyway, I’ve got to decide if I want to go down to the Worlds Biggest Bookstore and look at OSX programming books, or if I feel like trying to hack Ctrl-[vxc] support into Ewl_Entry and Ewl_Text along with Home and End and maybe word/line click selection.


« Previous Page