Monday, June 21, 2010

Presentation Hosting

What's the best way to share a PowerPoint presentation online? Several services are available; almost all have basic features available for free and premium features for a modest monthly fee.

Cons: Animation support is very spotty. Not all embedded images were rendered. Some fonts ended up being difficult to read. Hidden slides were incorporated into the presentation.

Pros: Voice annotation support. Control over slide and animation timings.
Cons: Animations only work with annotated presentations, or if you manually set timings for each animation through a cumbersome interface. No privacy controls in free version.

Pros: Animations are reproduced almost flawlessly.
Cons: It gets confused by presentations with hidden slides. There's no option to suppress presenter notes from being displayed.

As soon as I realized there was no free option -- only a free 30-day trial -- I moved on.

SlideShare
Pros: It's integrated with LinkedIn. It supports Apple Keynote and multiple video formats.
Cons: It doesn't support presentation animations.

Thanks to MasterNewMedia for getting me started.

Thursday, June 03, 2010

iPhone App Ad-Hoc Distribution

Turns out there's an Apple-sanctioned way to distribute your application without using the App Store. It's called Ad-hoc Distribution. The catch: you can only distribute 100 copies, and you have to know the ID of each of those devices.

It sounds like there are two intended use cases for ad-hoc distribution: getting your app in the hands of beta testers and allowing organizations to create apps for internal use. Of course, with only 100 copies of an app, ad-hoc distribution is not well-suited for enterprise apps with wide appeal. (For organizations with 500 or more employees, Apple offers the iPhone Developer Enterprise Program, which appears to allow for unlimited ad-hoc distributions, but there are more hoops to jump through).

A useful resource for the ad-hoc distribution process is Publishing Applications for Testing in the iPhone Development Guide; it provides an overview but is light on detail. The best step-by-step instructions for ad-hoc distribution are on the iPhone Provisioning Portal. These instructions leave you hanging, however, at the point where you've generated your app files.

Both the provisioning file (the file with the .mobileprovision extension created when following the instructions on the portal) and the app need to be sent out to testers. Note that the app is actually a folder containing many files; before it can be attached to an email it either needs to be compressed or included in a compressed file along with the provisioning file. If you're sending your testers Apple's Instructions For Application Testers, use a single archive file to be consistent with the instructions.

Thursday, May 27, 2010

iPhone App Icon

Each app gets an icon for the home screen that's 57 x 57 pixels. Note that the iPhone automatically creates a beveled edge and adds a glossy finish (unless you specify otherwise; see below). Create the file as a PNG and add it the project. Next, add a line in the plist file for "Icon file", specifying the file name (less the extension) as the value. To disable the automatic border and gloss, add an additional line for "Icon already includes gloss and bevel effects", checking the box.

To get the finished icon to appear, you might need to clean the targets (Build > Clean All Targets).

Adding Music to an iPhone App

The instructions for using the AVAudioPlayer in the iPhone Application Programming Guide are pretty solid. There are a few required steps, however, that are not made explicit:
  • A player instance variable needs to be added to your class, e.g. AVAudioPlayer *player.
  • The AVAudioPlayer class needs to be imported in the header file, i.e. add this line to the top of the class's header file: #import
  • Make your class a AVAudioPlayerDelegate. In your class's @interface declaration, add AVAudioPlayerDelegate to the list of implemented protocols.
  • Add the AVFoundation framework to your app's link libraries. In XCode's "Group & Files" pane, expand Targets > [your app name]. Right-click on Link Binary With Libraries and select Add > Existing Frameworks. Select AVFoundation.framework and click Add.
Also worth noting: here's a good tip on making the music fade out.

Tuesday, May 25, 2010

Merging Windows XP Partitions

The C: drive on the old ThinkPad T41 has been close to full for a while, and I suspect this has been contributing to the increasingly awful performance. I received the laptop with 2 partitions on the 32GB hard drive: half of the space for the C: drive and half for the E: drive. Nobody really uses the E: drive so I decided to merge the two partitions.

I started with the GParted Live CD but quickly discovered that it didn't really support merging partitions. Because there was only junk on the E: drive, I used GParted to delete that partition and then tried to expand the C: partition. Unfortunately, GParted then detected a bad sector, and I couldn't get by that without retooling the partitions by hand. Lacking the confidence for that procedure, I downloaded the freeware version of EASEUS Partition Master. Within a minute of launching the program, I had successfully resized the partition to the full size of the disk.

Tuesday, April 27, 2010

iPhone App Unit Testing in Xcode

I think I have the basics of an automated unit test set up using the delivered unit testing functionality in Xcode. The instructions in the iPhone Development Guide are actually pretty good, provided you pay very close attention to the screenshots.

I followed the instructions for setting up an application test, which tests the running application as a whole as opposed to testing a particular method on a particular class. For reasons I don't understand, this type of test only can be run on the device itself, not the simulator.

Where I get myself into trouble was at step 2, "Add an iPhone OS unit-test bundle target to the project." This task is accomplished by right-clicking on Targets and selecting Add > New Target... > iPhone OS > Cocoa Touch > Unit Test Bundle.

The instructions do not mention the important next step: you have to set the identifier of the test bundle to the identifier of your app or you'll get a "code sign" error when you try to run the test. Right-click your app's icon under Targets, select Get Info > Properties, and copy the text in the Identifier field. Now right-click on the test bundle's icon under Targets, select Get Info > Properties, and paste the copied text over the contents of the Identifier field.

That should at least get you to the Writing Tests section, which is where I am now.

Friday, February 19, 2010

NSUnknownKeyException

Ran into this when I was trying to clean out unused properties from my class. The problem: I was still referencing a deleted property in the xib. Whoops. Props to Bill Dudney.

Forward Declarations in Objective C

Wow. Somehow I missed this.

Forward declarations in Objective C are implemented via the @class directive. In general, #import shouldn't be used in header files to bring in other classes in the application; import these only in the implementation file. In header files, use @class instead, which merely tells the compiler that the listed names are names of classes declared elsewhere. Not following this advice can lead to an assortment of maddening error messages, most of which have to do with cyclical class dependencies (the error message "expected specifier-qualifier-list before", for example.

Wednesday, February 17, 2010

Suppressing the iPhone Status Bar

If you want to run your app using all 320 x 480 pixels, you'll need to do two things:
  1. Set your views to 320 x 480. Your main view (the one in "MainWindow.xib"), as well as any other views you create that you want to take up the full screen area must be set to a size of W: 320 and H: 480. As noted previously, these values can only be edited if the Simulated Interface Elements are all set to "None".
  2. Suppress the status bar. The status bar is the area at the top of the display that shows battery life, signal strength, etc. In order to turn it off, you'll need to change a setting in your app's Info.plist file. In Xcode, it's typically in the Resources folder with the naming convention appname-Info.plist. Double-click the file, and look for the row labeled "Status bar is initially hidden". If you don't see it, click one of the existing values, click the "+" icon on the right, and select "Status bar is initially hidden" from the dropdown list. Make sure this value is true (has a checkmark next to it).
Enjoy running your app in fullscreen glory!