When I submitted an update to Detective, I discovered a few tricky things related to sandboxing and embedded helper apps.

In order to support ‘start at login’ in a sandboxed app, you need to embed a helper app that launches the main app (the entire process is described here). What I didn’t realize is that the helper app also has to be signed, or it will fail to let you start it at login. However, when you sign the helper app, it will include its own embedded provisioning profile, so when you try to submit your app, it will be rejected with the following message:

Invalid Provisioning Profile Location – The provisioning profile for your Mac OS X app must be located in the Contents directory of the main app bundle. A provisioning profile is optional, but you cannot submit more than one.

One of the suggestions in Apple’s developer forum is to remove the embedded profile from the helper app. Note that deleting the embedded profile doesn’t affect the actual code signing. After some experimentation, I found that the easiest way to do it is to add a Run Script build phase to the main application that deletes the profile from the helper app:

It’s been two months since my last blog post and a lot has happened. I’m now living in San Francisco and working for Bionic Panda Games. I’ve spent the last two months getting settled in my new apartment, working at my new job, and exploring the city. I also released a new Mac application called Detective (more in another post coming soon).

I love San Francisco. My favorite thing about the city is the rich history and mix of old and new. I love seeing buildings from the early 1900s next to modern structures.

Living here has inspired me to take many more photos. I enjoy just walking around the city with my camera. I’ve been experimenting with using only a prime lens instead of the 18-200mm zoom lens for my walks. I found that I prefer the 35mm f/1.8 to the 50mm as a general purpose lens. I’ll probably continue to use that lens for my next photo walk.

Unfortunately Midnight hasn’t adjusted well to my new home. He spends most of the time hiding and has been refusing to eat. As a result he got very sick and has been at the vet for several days. Cody, on the other hand, seems happy here.

I’m finally moving to San Francisco. I have a new job there which starts in less than 2 weeks, and I found a great apartment while I was there for Macworld|iWorld Expo last week. I wanted to do this for a long time, but I had a hard time overcoming my inertia. My POD arrives tomorrow and I’m flying to San Francisco to stay on Monday Feb. 6.

Much as I love San Francisco & dislike Florida, I’m going to miss my good friends here. My condo is a very close-knit community and we’re like family here. We all look out for each other. I doubt if it’ll be like that where I’m moving, especially since it’s a rental community. On the other hand, I really look forward to being part of San Francisco’s exciting tech startup community, which doesn’t exist in Florida.

In other news, I’m getting ready to release a new application for Notion called Detective, which shows your new Twitter followers and unfollows in the menu bar. We’re still waiting for the final artwork, so I might not be able to submit it before I move.

Apple will soon require all Mac apps submitted to the app store to be sandboxed for heightened security, which means it needs to request permission for doing even basic things like accessing files or connecting to the internet. A lot of things like disk burning aren’t allowed at all in the sandbox, and some things like sending AppleEvents require temporary exemptions which will be phased out.

One common task that’s complicated by the sandbox is adding a login item. A good tutorial on creating login items is available at delite studio, although some changes to the code are needed. That code follows Apple’s earlier guideline of using LSRegisterURL to register your helper app. However, I found that it always fails with error -10819. According to an Apple engineer in Apple’s developer forum, you should not call LSRegisterURL in a sandboxed app.

Note that your application can’t add itself as a login item. You need to write a simple helper app that launches your main app and it must be included in the main application bundle in the relative path /Contents/Library/LoginItems/.

The method for adding & removing a login item turned out to be very simple:

Although this method works and seems to be the preferred way to do it in the sandbox, it’s less optimal than the old non-sandbox method, since your login item won’t appear in the users & groups preference panel’s login items list and can only be turned on & off from your own application.

Tinariwen – Tassili
I’m addicted to their music, which has an almost hypnotic trance-inducing effect. Their latest album enhances their Desert Blues sounds with some English lyrics and guest artists like Nels Cline, The Dirty Dozen Brass Band, and members of TV On The Radio.

Sugar Rush 1.2.5 and the new Christmas bonus pack is now available. The Christmas pack adds a new theme with new candies and high-scoring new bonus items. In addition, special bonus power items and premium items such as donuts will appear more frequently, making it easier than ever to get new high scores. Sugar Rush is still free. The Christmas pack is available as an in-app purchase for $0.99.