Thursday, February 16, 2012

Dear Apple, Please Bring Free Updates from iOS "Back to the Mac" with OS X 10.8 Mountain Lion

I'm not cheap. I pay for all my software. Suggesting to Apple that OS X 10.8 Mountain Lion be a free update isn't about saving $30 bucks. I've gladly paid for every OS X update and will continue to do so if that's the direction Apple takes.


But I think the best idea from iOS, free updates, should come "Back to the Mac". This policy would allow developers to use the latest APIs as quickly as possible and help developers & Apple reduce support cost for older OS X versions more quickly. Any kind of monetary transaction is going to slow down OS X update adoption. Any iOS developer with access to analytics can see how quickly iOS 5 adoption has taken off (I've seen 60-75% already). Lion has sold 17 million copies, Apple's best selling release ever. The last reported install base was 58M Macs. Lion is on roughly 29% of all Macs. Pretty good, not nearly free iOS 5 adoption good. 


17 million Lion copies is a $510M gross, no small stash of cash to throw away. Except Apple has nearly $100B (or more by now) in cash, and making up that revenue is only 398k Macs at an average selling price of $1281. 


Imagine the ad Apple could deliver promising free software updates for 2 years on all their devices! Contrast that with the Android 4.0 upgrade schedule from Motorola or the confusing array of costly and confusing Windows upgrades, the comedy gold practically writes itself.


I think Apple replaces the revenue easy with a combination of Apple's cut of increased Mac App Store sales, decreased support costs, but more importantly new users. They could really amp up the expectation that when you buy a Mac, Apple "takes care of you" unlike with all those razor thin margin PCs. More importantly, it hits Microsoft where it really hurts, their wallet.

Tuesday, February 07, 2012

Easily Localize Custom NSDateFormatter Date Format Strings in iOS 4+

Apple ships a lot of new APIs with every major iOS release. They claimed iOS 4 had over 1,500 new APIs, and the same claim is repeated for iOS 5!
Any way you slice it, a lot of new code
It's easy for a new API that is developerlife altering to slip through a release undetected.

Which is exactly what happened to me for new in iOS 4 API [NSDateFormatter dateFormatFromTemplate:options:locale:]

Why is this API such a big? It gives developers an easy way to generate a custom date or time string for display to the user. Cocoa Touch (and Cocoa before it) have had predefined NSDateFormatterStyle that correlated to specific date or time display representations. For example, NSDateFormatterShortStyle used for dates would be 11/23/37 and for time 3:30pm. But the really big deal was that if you use these predefined styles they would get localized based on the NSLocale of the device. Meaning the short date format in the U.K. would output 23/11/37 and 15:30 respectively.

If you wanted a custom format and localization, like just month and day, you were out of luck without writing it yourself, which means you usually just used the pre-defined styles. Until iOS 4 that is!
Starting in iOS 4, you could not do stuff like this (straight from the documentation):
NSString *formatString = [NSDateFormatter dateFormatFromTemplate:@"EdMMM" options:0
locale:[NSLocale currentLocale]];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:formatString];
NSString *todayString = [dateFormatter stringFromDate:[NSDate date]];
NSLog(@"todayString: %@", todayString);

Which results in this output formatted for the US like this:
2012-02-07 09:32:16.725 Untitled 2[1803:707] todayString: Tue, Feb 7

And when the locale is, for example, Great Britain, the output is this with the same code:
2012-02-07 09:36:32.439 Untitled 2[1839:707] todayString: Tue 7 Feb

Notice this even puts a comma in or not as required by the locale!

BTW, the excellent CodeRunner (available on the Mac App Store) is perfect for quickly running these kinds of code snippets to see the output.

Friday, February 03, 2012

A Lack of Sandboxing Leadership: Apple's AirPort Utility 6.0 for Mac OS X 10.7 Lion is NOT Sandboxed

AirPort Utility 6.0, the iOSified and Lion only update to Apple's excellent WiFi network and base station management app released on January 30, 2012, is not sandboxed.
All Shall Sandbox


Apple decreed all apps submitted for Mac App Store review on or after March 1, 2012 must be sandboxed (there's no direct link, screenshot captures for posterity). The previous deadline was November 1, 2011.There has been a ton of debate on whether sandboxing as currently implemented actual solves the problem it sets out to. I'm not going to re-litagate that here. Introducing App Sandbox (Apple developer account required) from WWDC 11 makes as persuasive a case as I've ever seen for sandboxing. 


There are problems with sandboxing in Lion that Apple needs to solve, and 10.7.3 implements or fixes (Apple dev forum) a number of sandbox issues. Good arguments, documentation, fixes, and mandated deadlines that have already been pushed back aren't going to conclusively prove to 3rd party app developers they must implement sandboxing now.


Leadership does. Look at a list of Apple apps, and you're just as likely to see them not sandboxed as sandboxed. A lot of Apple's high profile apps are not sandboxed:
  • Safari 5.1.3 (Apple.com)
    • Some of the parts of the app like Safari Web Content are, but the main UI app isn't
  • Pages 4.1 (Mac App Store)
  • iBooks Author 1.0 (Mac App Store)
  • AirPort Utility 6.0 (Apple.com)
  • iPhoto 9.2.1 (Mac App Store)
  • iTunes 10.5.3 (Apple.com)
  • Xcode 4.3 (Mac App Store - Released February 16, 2012)
Maybe Apple's going to drop sandboxed versions of these apps any minute. But the closer we get to the submission deadline without even Apple's brand new apps (iBooks Author I'm looking at you) being sandboxed, the harder the deadline is to take seriously.

I've already taken one shot at sandboxing SleepMute in its current development cycle on Mac OS X 10.7.2. SleepMute has a UI app to write preferences and a helper that reads preferences and mutes or unmutes sound. Sandboxing completely broke the app. Both apps read/write preferences (with CF functions) to the same file preference file. This feature works perfectly without sandboxing, has to be completely rewritten for sandboxing. Also, simply launching the helper from the UI app wasn't working. That may have been fixed by 10.7.3, so I'll probably give it another shot, but not until Apple's apps start getting sandboxed.

Thursday, February 02, 2012

Netflix is my new HBO

 When I grew up in the 80s, a particularly life changing event was when my family subscribed to HBO.

There were no parental controls in those days. If you had parents like mine that put a TV in your room with HBO on it, you could watch all sorts of stuff that you had no business seeing. HBO's always had loads of cheap crappy movies to round out the expensive good stuff and original series. HBO would play those crappy movies over and over, I'd watch'em over and over again. The later at night the better, especially if it was some horror or mind fuck flick. Past midnight, I'd watch stuff that I'd never give time during the day. Nightmare on Elm Street 4? Why not, I've got time. Swamp Thing? I've only seen it 15 times, what's one more viewing.

It hit me tonight that Netflix is my new HBO. Insomnia at 3 AM? Why not Don't Look Back, subtitled because it's French, starring The Matrix Reloaded's Monica Bellucci and The World Is Not Enough's Sophie Marceau? I've got nothing better to do.

The perfect kind of late night crappy movie is the one you:

  • Can fall asleep to if you get tired again
  • Don't mind turning off at any point because you really don't care about the story
  • Might show you a bit of skin, no matter how fleeting
  • Is unintentionally funny, so you laugh at it not with it
  • You can watch in the background while you do something else (like write this post)

Plus, Netflix has mostly crappy content and it's getting worse as movie studios refuse to cut deals for newer better streaming content in reasonable timeframes. Which makes Netflix kind of perversely perfect for my late night insomnia needs. I won't be turning it off again if it stays anywhere close to $8/month and keeps the obscure content and/or bad content. And to think, I haven't even entered the time wasteland of TV-MA rated Japanese anime yet!

Wednesday, February 01, 2012

Exhibit A. On Why iOS 5 Newstand Apps Should Always Be Universal

I've had the New York Times app on my iPad since Newstand launched alongside iOS 5. I don't read the content, it's just not part of my workflow. What I love however are the notifications of important events just for having the app installed. The editorial selection is perfect, so I downloaded the NY Times app to my iPhone to get the notifications there as well.

I didn't realize what I downloaded on the iPhone was not a universal app. Imagine my surprise when I got back to my iPad & through the magic of App Store automatic downloads it appears I now have two NY Times!

When the iPad first came out, I would've agreed it was acceptable to ship separate apps for one actual app to pay for the cost of adding iPad features. No more. A universal app is really just table stakes at this point  There's no user experience case to be made for shipping separate iPhone & iPad apps. Multiple apps for the same app just creates user confusion on the App Store, and in cases like this, on the device as well.

And it just looks really dumb in Newstand!

Why External Links Should Maybe Open in New Tabs

UX Movement posted Why External Links Should Open in New Tabs. I've never quibbled with any of Anthony Tseng's advice before, but this time I think he misses the mark somewhat.

True, for the primarily audience of this blog, I think opening external links in a new tab makes sense. I just went back to my posts this year and changed all external links. That's the key though, this decision has to be made based on the audience of the site.

Ever watch an older user or even young but not to savy user get dumped into a new browser tab? This sentence from UX Movement completely applies:

When a new window opens, it covers the user’s earlier window. The user is left confused and wondering how to get back.

Just replace window with tab and it still applies. All these users know is the back button.

So if your trying to appeal to browser savy users, go ahead and open external links in a new tab. If however you're trying to appeal to a broader audience with less browser know how, open external links in the current window or tab.

Tuesday, January 24, 2012

Apple: This Hard to Find Evidence Suggests You Should Release iBooks for Mac OS X

Top Free in the Mac App Store
Look at the image on the left of the Top Free apps in the Mac App Store. Notice anything?

Number 1 with a bullet is iBooks Author. Look further down. Number 5 is Kindle. That's like oil and water. You know what would be nice to have as Number 1 or Number 2. iBooks! iBooks Author and iBooks are two tastes that taste great together.

I can think of reasons why Apple might not release iBooks for Mac OS X, but none of them make much sense to me. If Apple wants to take on Amazon and Kindle for eBook supremacy, they have to broaden the reading platform off of just iOS.

I would have bet real money that iBooks for at least Mac OS X was going to be released at the Education event. Clearly I would have lost big.

I'd like to be able to read iBooks on Mac OS X, even if it's just for the occasional reference. Clearly the Mac App Store proves Kindle book readers aren't just reading on their Kindles.

This is What's Wrong with Hollywood: Where are the biggest box office movies (not) streaming?

Take a look at this compilation of the Top 100 movies of 2011 and where they are available (or not) to legally stream from online. This isn't even a complete list as the studios still frequently will only put the standard definition version of a movie up on iTunes when of course an HD copy is available. Also, support for iTunes Extras is nonexistent or weak.

This is why Hollywood is losing money to piracy. There will always be people that just don't want to pay for content, but the big attraction of piracy to honest people is that it feels like everything is available. It's a better service. Seems very analogous to Napster before Apple convinced the music labels to license a very high percentage of their catalogs at reasonable prices for download. Then you have the studios trying to launch their own streaming service, while continuing to cripple the established services out there.

Hollywood has crippled the legal download sites with this quagmire of availability, SD vs. HD, and little to no price break over buying a manufactured physical disc. Clearly the studios are trying to preserve buying physical discs or make at the least make it more enticing than downloading, but it's just not going to happen anymore. The tide has turned. Add to that the complicated "windowing" that studios try to enforce on home viewing rights, and a lot of consumers just check out.

This should be obvious, but don't the studios get that most people can't and won't keep track of the studios windowing schedule? Once you market a movie, if people want to watch that movie and they can't get it legally and at a fair price, at some point they are probably going to investigate pirating because it bypasses all the studio bullshit.

I'm not supporting pirating, but it's not hard to understand the appeal beyond just not paying for stuff.

Update
I tried to watch Game of Thrones and this is what happened cartoon from The Oatmeal perfectly captures the problem.

Update x2
Andy Ihnatko perfectly captures what I generally try to practice regarding the byzantine content access rules, find something else to do!

Friday, January 13, 2012

Thoughts on 44 days of uptime in Mac OS X 10.7 Lion

Decided going into the Martin Luther King, Jr. Day weekend I would actually shutdown day job MacBook Pro instead of sleeping it like I had every other day for who knows how long. I only thought of doing this to save a battery charge & discharge cycle.

I wondered: "How long have I been running this instance of OS X 10.7 Lion?"

44 days was the answer Terminal command uptime gave. The MacBook Pro hadn't booted since November 30, 2011, a whole other year ago! Probably the last time I had powered it off because of Thanksgiving break.

I was kind of shocked for two reasons. I'm usually doing every 2 week beta OS updates or standard updates that require reboots. I skipped the current round because I really wanted to run stable after the OS X 10.7 Lion, Xcode 4.x, iOS 5 beta trifecta over the summer & fall. More surprising though, rebooting OS X has been completely deprecated in my mind as a useful activity unless forced to. To be fair of course, I've quit cycled a few heavy use apps (here's looking at you Xcode) over this stretch. But the system has remained perfectly usable and stable. If not for the holiday, I would have just slept the Mac like I had done before.

What a contrast to the issue I have with Windows 7 on my iMac that would have necessitated some task killing after a few hours if I was really using the OS day to day.

What I'm really curios about is iOS device uptime. I don't ever turn off or reboot my iPhone or iPad except to install a software update.

I marvel at the software engineering!

Wednesday, January 11, 2012

iOS 5 Dev Warning: UITableView's Multiple Select During Editing Doesn't Work with Swipe to Delete

I attended Session 125 - UITableView Changes, Tips, Tricks at WWDC 2011. I also downloaded the video & slides of that session from the WWDC 2011 Session Videos site  (Apple developer account required) .

You can here it in the video, and being in the room, one of the, if not the, favorite moment for developers at the talk was when multiple select during editing was announced. The announcement starts at 16:51 in the talk video.

Jason Beaver immediately shows Apple's Mail application in edit mode. Why? Because that's what every developer and user that has spent any time in Mail want in their apps when editing lists of user content. 

You would expect, given the heavy references to the Mail app and how it works that what regular developers would now have in UITableView is exactly the functionality Mail supports.

But You Would Be Wrong Because Swipe to Delete is Disabled!
If you do this in your code:

self.tableView.allowsMultipleSelectionDuringEditing = YES;
or change the UITableView property in the XIB for Editing to use Multiple Selection During Editing you don't get swipe to delete.

I have no idea if that functionality was planned at WWDC and got dropped during development. The only hint you get swipe to delete won't work in the iOS 5 release documentation is the following on the allowsMultipleSelectionDuringEditing property (emphasis mine):
The default value of this property is NO. If you it to YES, check marks appear next to selected rows in editing mode. In addition, UITableView does not query for editing styles when it goes into editing mode. If you call indexPathsForSelectedRows, you can get the index paths that identify the selected rows.
So if you don't see the docs, or it just doesn't click on first read that this means no swipe to delete, you might do a whole bunch of work for no reason because you need both multiple select during edit and swipe to delete, just...like...Mail.app. I'm only saying this for a friend, of course.

Skeptical? I was too, went through all 7 stages of grief before conclusively proving it. I kept thinking: How could Apple play Lucy with the multiple select football to my Charlie Brown?

Prove it to yourself. Go download Apple's TableMultiSelect sample (Apple developer account required). Open MyTableViewController.m and paste the following three lines in (I pasted after the tableView:cellForRowAtIndexPath: method just to be tidy):

// Override to support conditional editing of the table view.

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    return YES;
}


- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    return UITableViewCellEditingStyleDelete;
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 
{
    NSLog(@"Commit Editing Style");
}

Run your app in the simulator and true to swipe to delete. It won't work.


Now go to line 74 and comment self.tableView.allowsMultipleSelectionDuringEditing = YES; 


BOOM, you got swipe to delete!


Next Steps
I know, file a radar or GTFO and I will, eventually. I say this not to deride Apple. UITableView is a great piece of UI programming. Whenever designing something of my own, I always ask:
What Would UITableView Do?
I wrote this to warn developers using UITableView's multiple selection functionality at the time of this writing (Xcode 4.2.1 & iOS 5.0.1) is an either or choice with swipe to delete that user's are most likely not going to be happy with. Better to stick with custom implementations unless/until Apple changes the functionality.


Update
An workaround has been found. Default your tableView to not allow multiple select during editing so you get swipe to delete. Then in your viewController's setEditing: method, enable multiple select on your tableView. When editing is done, set your tableView back to not allow multiple select during editing.


Seems like a hack, but I've had a bunch of people tell me it works!