Just wanted to remind everyone that the $10.00 off sale for Picture Switcher ends tomorrow at 11:59 PM EDT. Grab it before it’s too late!
Archive for the 'Cocoa' Category
A month ago, Paul Kim over at Noodlesoft made a post about a proposal for a new way to install. In it, he described how it might be advantageous to display a dialog to the user asking them if they’d like to install the application if it were running from a disk image (or some other unwritable media).
As it so happens, I had already intended to write some code that checked that very thing, to fix a problem with Picture Switcher. I hesitate to call it a bug — it’s more like an unintended side effect. The problem was that in my last version, I decided to add in a dialog asking the user if they would like PS to run when they logged in. All fairly standard. What I hadn’t taken into account (and this would be a bug), was users running PS from the disk image. I should have put in a check for that. The unintended side effect is that, after having said yes to that dialog, every time they logged in the disk image would be mounted and run PS from there. I hadn’t even known the login items would do such a thing. Suffice to say, I’ve gotten some support emails about this issue.
For all of you developers who are using my code (all 3 of you), I’ve updated my DSClickableURLTextField and DSGeneralOutlineView classes, and added a new class, DSGeneralTableView. I’ve also written up some class references for these classes, so things are a little more documented now.
Jens Miltner emailed me some fixes to some subtle bugs with DSClickableURLTextField, and I added some functionality. Here’s the change list for it:
Changes by Jens Miltner:
- Fixed a problem with the text storage and the text field’s attributed string value having different lengths, causing range exceptions.
- Added a delegate method allowing custom handling of URLs.
- Tracks initially clicked URL at -mouseDown: to avoid situations where dragging would end up in a different URL at -mouseUp:, opening that URL. This includes situations where the user clicks on an empty area of the text field, drags the mouse, and ends up on top of a link, which would then erroneously open that link.
- Fixed to allow string links to work as well as URL links.
Changes by me:
- Overrode -initWithCoder:, -initWithFrame:, and -awakeFromNib to explicitly set the text field to non-editable and non-selectable. Now you don’t need to remember to set this up, and the class will work correctly regardless.
Hey all, sorry for the lack of posts. I hadn’t intended to go two months without posting. I suppose this makes it more of a rocky start than a bumpy one.
I thought I’d give a status update on where I am with things:
An update to Picture Switcher is about 88% done.
An update to Web Control is about 60% done.
An update to Desktop Log is about 40% done.
An update to Pref Setter is about 10% done.
As you may guess from the above, I’m spending most of my time with Picture Switcher. It’s keeping me rather busy, which has contributed to the lack of posts (though I’ll be honest and say not totally).
If it helps any, my friends are all wondering where I’ve disappeared to as well.
Kqueues are a great thing. They let you keep an eye on files, sockets — anything that has a file descriptor. It takes very little code, and you don’t have to worry about manually polling or the like. Awesome stuff.
There is one thing you do have to worry about, though. Your app’s number of open files. I ran into this problem in a spectacularly bad way. When I first released my application Picture Switcher (it’s a status menu item, which you can use to switch your desktop picture(s)), I had it going through the file system and checking the modification dates of the folders containing the pictures Picture Switcher knows about — when the user clicked on the status menu. This was a Really Bad Way to do things — it made the menu take a while to actually show (and if the user had a lot of folders, it could show the SPOD). So, when I was working on version 1.1 I decided to use kqueues to watch the folders instead of going through them when the user opened the menu. It was great, I didn’t need to worry about manually looking through all the folders anymore.