Well, for one you can only do it one handed! Also you have to be ready for sudden lunges towards the keyboard. Bang bang bang go the keys. Oops a wrong click or an inopportune Enter and say goodbye to all that work. Still it is nice for the little one to see what Daddy does all […]
Category Archives: Programming
Cocoa bindings
I have to say that Cocoa bindings are one of the coolest things to some to Cocoa in a long time. It takes a bit of getting used to however, and the documentation isn’t the greatest. One of the things that had me stumped for a bit was how to have a button‘s enabled flag depend […]
The cocoa rendering system is really nice
For a secret project I’m currently working on I needed to make a NSTextView that resized its contents so that it was always fully visible regardless of how many lines of text were in there. Coding something like that under Windows would have been pretty awful (especially since the text needs to still be editable), […]
Blog APIs
It can be quite annoying when an application claims to support an API and actually doesn’t 🙁 I’ve been working on BlogThing off an on for about a week or so. Originally I used a bit of the metaWeblog API and a bit of the MovableType API. I’ve since standardized on metaWeblog and removed the references […]
Accessing the string and attribute data in a NSTextView
NSTextView stores its data in a NSTextStorage object. NSTextStorage descends from NSMutableAttributed string, so that gives us a clue. The easiest thing to do is to make a category on the NSAttributedString class to do whatever it is you want containing something like the following.      NSRange range;     int i;     int L = [self length];                  i = 0;     while(i<L) […]