Blog

Headnix — Clip It!

Wednesday, Feb 03, 2010 Wondering how to find the frame of status item?

There’s no public API to get the frame of NSStatusItem. So… google around and found a great post at The Synapse Project – NSStatusItem’s position

Thursday, Jan 28, 2010 iPad - I don't know what the heck i have to do with it...

The iPad… Steve Jobs calls it a revolutionary device.

Hm… I watched the keynote of the event. I am not convinced it’s revolutionary. I mean, compare with the launch of iPhone, it’s not revolutionary at all. People’ve been using crappy symbian and win-mobile devices for years. The iPhone is the first smart phone which is usable! Multi-touch, maps, the safari browser… everything is unprecedented.

This iPad thing… there’s not much “soft” innovation there. It’s mainly a content consumption device. I want new hand gestures, new ways to use word processor, new ways to read books… Now, it’s more a super-size iPod Touch to normal people. By normal people, I mean people who don’t care it’s IPS LCD, Apple’s own silicon or if there’s multitasking.

Ha… maybe it’s Steve’s plot. He purposely leaves rooms for us to innovate on those areas. Maybe, later, there will be a super cool NYTimes reader by NYTimes, super cool graphing and data analysis app and a super-sized Finger?

Haha… I don’t know what I will do with Finger for iPad…. That’s worth some brainstorming session this weekend :)

Apple’s presentation is definitely focusing on contents and entertainment. These are, well, straight forward innovation. This hugh multitouch screen + App Store offers golden opportunity for the publishing industry to innovate their contents for this new media. But, what’s other killer usage? Should an indie like me who won’t be writing my own memoir nor interested in gaming be excited?

Without multitasking and a hardware keyboard, I don’t think it’s possible to directly port traditional desktop app to this thing. I can almost certainly say it won’t be a pleasure to type simply because you can’t rest your fingers on the on-screen keyboard. Another bumper, user can no longer reach the whole screen with one thumb.

Hm… a large screen where there’s no multi-window support and multi-task support… should I layout my app with more data? Just layout tiered data on the layout instead of the drill down paradigm in iPhone?

That’s the challenge… I don’t know what what heck I will do yet…

Monday, Jan 25, 2010 Livescribe Pen SDK

The magic livescribe pen has released its first Mac supported SDK!

It’s not too interesting to me for now cause you can only run apps in the pen. You can send data between the pen and the desktop app yet.

Hope they will get the desktop SDK done soon!! (roadmap here)

Livescribe pen SDK

Monday, Dec 28, 2009 Happy 2010

happy new year 2010

We wish you a happy new year! 2010 will be an exciting year to Headnix.

Sunday, Nov 29, 2009 The Ultimate Beginner’s Guide To AppleScript

The Ultimate Beginner’s Guide To AppleScript is a short and well written guide to no-voice people like me :P

Right… been doing Cocoa for some years but I am still pretty ignorant to AppleScript.

Saturday, Nov 28, 2009 Replace your Macbook / Macbook Pro superdrive with hard disk

I’ve been thinking about removing the superdrive in my Macbook Pro (non-unibody) to reduce weight. Honestly, I don’t use my superdrive that often. Guess I used it less than 10 times ever since I bought the it. My friend – Folkert suggested to get the MCE OptiBay instead.

That’s a brilliant idea! Replace the superdrive bay with a hard drive. Then, I can get a small SSD (128 GB) as boot drive and put a 500 GB hard disk to that extra claimed bay!!

But, hm…, guess that will void AppleCare warranty

Thursday, Oct 29, 2009 Intercepting multi-touch event in UIView

Intercepting events from being delivered to subviews of a UIView appears to be a straightforward problem. Well, at least, the solution should be straightforward, right? Tape into the event delivery queue and intercept events that we don’t want to be delivered to subviews.

This is actually not that straightforward actually.

Apple provides detail documentation on how events are handled and processed in iPhone OS.

Quotes from the documentation:

  • “Restricting event delivery to subviews. A custom UIView class can override hitTest:withEvent: to restrict the delivery of multi-touch events to its subviews. See “Hit-Testing” for a discussion of this technique.” – from Regulating Event Delivery
  • “Override sendEvent: in a custom subclass of UIWindow, analyze touches, and forward them to the appropriate responders. In your implementation you should always invoke the superclass implementation of sendEvent:.” – from Forwarding Touch Events

In my particular case, there’s a UIView which contains a bunch of UIButton views inside it. The UIView should intercept all events and forward only single touch event to subviews.

In the code, I subclass the UIView and override the hitTest method. However, I found that the “event” object passed by hitTest method contains no touch object at all. [event allTouches] returns an empty set. Google around and found that I am not alone to this problem

I did some more research and found a few forum discussions in Apple’s official developer forum where some Apple engineers explain why it is not simply overriding hitTest nor other event handling methods in UIResponder class (touchesBegan, touchesMoved, touchesEnded, touchesCancelled).

In one sentence, it is not possible to forward touches to UIKit object by overriding UIResponder methods. For detail explanation, please read through these links:

The solution? As suggested in by Ryan (first link in above list), override sendEvent: method in UIWindow. Check out his post for detail explanation to the solution.

Someone, in the comment section, pointed another page with sample code to the problem.

I’ll post sample code of my solution in a bit.

Older

If you are looking for Finger iPhone app, please go to Finger's site.

Copyright © 2007 Headnix. All rights reserved. Design by BeansBox.