Archive for Cocoa

The Greatest Bugs

Wil Shipley posted a great article on handling a really really nasty bug reported by a customer. Under an extremely heavy, spiking support load, a customer reports an extreme case which reliably locks up his machine.

One of the nastiest bugs I had to deal with was when working on OS/2. During OS/2 Warp’s development, the window manager and related code had to be ported from a 16-bit mixed assembly & C source base to 32-bit pure C. A friend had done most of the conversion of the kernel-level mouse code, which is responsible for actually moving your pointer around on the screen and telling the application world about mouse movement. If memory serves, I finished up that conversion. Somehow there was a tiny error where if you left the mouse in the correct position (on one of every 8th row or something) then moved it up at just the right velocity, your mouse would go forever haywire.

It was common enough that everyone would hit this after a few minutes. But uncommon enough to be really hard to reproduce, even if somehow you knew how to reproduce it. The entire OS/2 development group was suffering from this nasty bug and it was up to me to figure out what was going wrong. At that time debugging was limited to stepping through assembly, no matter what high-level language your code was written in. And debugging a kernel mode mouse driver? Forget breakpoints. It took about two days of staring at the code, dreaming up all the possible code paths before I found the tiny logic hole responsible.

Leave a Comment

One big reason not to develop for the iPhone

Reasons TO develop for the iPhone:

  1. Potentially huge market.
  2. Apple handles all the sales and marketing. They’re good at that.
  3. Turn your Cocoa skills, currently maxed out at 5% of the market, onto the soon-to-be-larger iPhone and iPod Touch markets. $$$!
  4. FUN!

Reasons not to develop for the iPhone:

  1. 100,000 SDK downloads already, plus more torrented and copied. Even if not all of them produce something, it means there are 100 other people writing exactly the same application as you. Yours had better be something very special to stand out from the crowd.
  2. In my case, it’s a good thing Apple will do the marketing: I’d have a hard time marketing myself if I were the last man on Earth. It’s been said Apple likes to control the whole chain of their business, because when you’re reliant on someone else, you get burnt. And Apple has your business by the balls. They control access to the most important aspect of your business – your customers. Apple doesn’t like you or your app? You’re gone from the Store, with no other means of distribution.

Those start-ups getting VC money to do iPhone development? The VCs don’t own those companies. Apple owns every one of them. Utterly pwned.

Leave a Comment

Guest post from Rob "reliable as a weatherman" Enderle

Fake Rob (“and you can quote me on that”) Enderle and Fake John Dvorak make special guest appearances on the Single Pixel blog today. Fake Rob has a revelation concerning the iPhone’s origins, and Fake John makes his big prediction for 2008. Over to you, Rob:

FRE: Thanks, Graham. I have some amazing news about how the iPhone came to be. After some serious thinking, I have discovered the group inside Apple in which the iPhone originated. Think about it – which existing Apple device most closely resembles the iPhone in both size and weight? That’s right, the Apple Mouse. It makes perfect sense – the one button and everything! Last year even Apple abandoned the single button mouse, and the mouse group, fearing for their very existence, produced the first prototype of what would become the iPhone. They squashed the mouse flat, added some clear plastic left over from an old iMac, turned the laser tracking device upside down and – copying Microsoft’s breakthrough Surface here – used the infra-red laser to track the user’s touch. The same crazy designer who insisted on one button mice is now in charge of iPhone hardware design!

FJD: That’s amazing, Rob. Apple’s making the same mistake again – the one button mouse was never a success and it won’t work for phones either! People often scoff at me for saying that people weren’t interested in mice. I was right – until they added a second button! That’s when the mouse took off – everyone wants a second button. Consumers know a monopoly when they see one, and having only one button is hugely off-putting to those who demand choice. Someone (I doubt it will be Apple) will make a 2-button phone and it will sell in droves. That’s my prediction for 2008 – a two-button phone eclipsing the iPhone, and spawning a new era in phone usability.

FRE: After figuring out how the iPhone hardware came to be, I next had to figure out the software. There used to be a video on YouTube showing the iPhone UI running on Windows Mobile. That video has been removed due to a copyright claim by Apple Inc. Why? Because, like nearly all mice, that’s the answer – the iPhone actually runs Windows Mobile!

FJD: Holy xxx!

FRE: Yes! Why else do you think there is no iPhone SDK? Because Apple is still rewriting the iPhone software to run on Mac OS X! And that’s why we don’t see key Mac software on the iPhone. It’s all Windows based – why else did Apple have to release iTunes for Windows?

FJD: That explains so much! Quicktime, Safari, and I bet all the iPhone components, they all run on Windows!

FRE: I’m starting to think that the whole NeXT purchase was just subterfuge, a ruse to distract us from what really happened. That Apple, in 1995, did actually license the NT code as rumored and THAT is what runs OS X after all. My prediction for 2008 is that Microsoft, badly burned by Vista, will approach Apple and attempt to license back Apple’s branch of the NT code – the very same code that runs Leopard. And you can quote me on that!

Leave a Comment

Subversion error after Leopard upgrade

I upgraded my SVN server to Leopard. While I could ssh to the machine without error, trying SVN resulted in an odd error:

ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory

Online, I found several people with the same error but no solution. Mine’s working now. I had an old version of Subversion in /usr/local (Leopard ships with svn in /usr/bin) – I’d already removed svn* from /usr/local, but was getting the error. I continued to remove items from /usr/local – anything to do with apr-config, apu-config, and neon. No idea what they are; I suppose they got installed with svn 1.3. Now Leopard’s svn works.

Leave a Comment

Not the only Apple investor

Turns out Daniel Jalkut agrees that “total investing” in Apple is not a bad idea at all.I blogged about AAPL investing a few days ago.I’m sure in 1996, Apple developers might have disagreed. Still, all things appear to be pointing up right now. The iPhone revolution is just getting started.

Leave a Comment

ADC "Developer DVD Series"

Speaking of ADC, for your $500 (at least) you get a set of monthly mailings. Does anyone actually use these DVDs? All the content appears to be online…

Couldn’t Apple save some DVDs and shipping and do ADC for $400 sans monthly DVDs?  I called Apple and they offered to cancel the mailing for me; I backed down in case that was going to cover any actually useful mailings like Leopard seeds. Which are just posted online. Argh.

Aren’t these DVDs a complete waste?

Leave a Comment

Still no Leopard seed for ADC members

So, according to a few sites, the final Leopard build is still not available to developers. How are we supposed to ensure our applications work properly by the 26th? We don’t know if bugs in the month-ago seed are fixed or not; do we need to work around them or not? Apple, let us do our jobs! I didn’t know we were the bad guys.What happens on the 26th? We paid $500 or more for the privilege of checking our applications work with Leopard, we reported bugs, we check interim builds (who is working for who here?). Now it seems we’d better get in line at a Store and pay up more money to see if our applications still work or not!Of course, due to NDA I cannot confirm or deny these rumors of Apple’s torturous passive-aggressiveness towards its developer community. However I’ve got a good idea where I can save $500 next year.

Leave a Comment

Investing for Cocoa Coders

Hands up, who’s making more money from AAPL than they are from their Mac software?Is investing in AAPL a reasonable business decision for Mac-based companies? On the one hand, you don’t want too many eggs in one basket. On the other hand, it’s OK as long as you watch that basket. And most of us follow Apple as closely as possible.Given that you’re writing Mac software, you are already committed to Apple and relying on Apple being successful. And if you think Apple will do well, so will AAPL. Therefore parking any spare money in AAPL is a sound business decision.Right?

Comments (2)

More on "Get"

So “stuffonfire” blogged about “get” methods, here.

Chris Hanson then covered Cocoa’s convention for get.

Just thought I’d mention that the Win16/Win32 API used Get methods all over the place. When someone (I’d love to know who) modified that to come up with the OS/2 API, they made Get mean acquire, and substituted Query when the method was a simple return-a-value type.

So you’d have things like GetMemory, GetFileHandle (I forget exact examples, there weren’t many Get APIs), and QueryWindowCount, QueryThis, QueryThat, and so on. I liked Query (it was somehow easy on my eyes), but it meant everyone had two more characters to type for 99% of API calls.

So it’s great to have property style accessors, no Query or Get required!

Leave a Comment

CoreData versioning

Time to post some code. The TimeFlyer update is out, with new data model, and so far no screams of lost data.

If you need to version your Core Data model, read on…

» Continue reading “CoreData versioning”

Leave a Comment