• Happy Coding

Archive for the ‘Mac/iPhone/Touch Development’ Category

Google Android challenges Apple iPhone

Google is targeting the iPhone’s lack of real keyboards; inability to run simultaneous apps; inability to allow open development; and lack of interchangeable batteries.

via Google Android challenges Apple iPhone | 26 Oct 2009 | ComputerWeekly.com.

iPhone Developer Program

The iPhone Developer Program provides a complete and integrated process for developing, debugging, and distributing your free, commercial, or in-house applications for iPhone and iPod touch. Complete with development resources, real-world testing on iPhone, and distribution on the App Store, you have everything you need to go from code to customer.

see developer.apple.com/iphone/program

Developing Rails Applications on Mac OS X Leopard

This article gives you a full tour of Ruby on Rails 2.0 on Leopard—starting with building a web application using the latest Rails features with Xcode 3.0, and finishing with deploying the application to a production server running Leopard Server. Along the way we’ll explore unique features and benefits that Leopard brings to the party. In the end you’ll be better equipped to consider the advantages of powering your web application with Rails on Leopard.

(seen @ Developing Rails Applications on Mac OS X Leopard)

Leopard for developers

Interesting Podcast episode from “Late Night Cocoa” about Leopard — the new version of Mac OS X — and the advantages for developers.

Share your library with Microsoft

Daniel Jalkut wrote in his Red Sweater Blog that Microsoft will possibly use information from the iTunes-Library for their new iPod competitor.

The idea is that as a lure to switch to their service, Microsoft will offer to give you for free Windows Media versions of some number of songs from your existing iTunes library.

To get a list of the tracks you purchased, Jalkut built a little AppleScript which demonstrates the simplicity to get such informations:

tell application "iTunes"

every track of library playlist 1 whose kind is "Protected AAC audio file"

end tell

Wil Shipley’s “Pimp My Code”

Who still doesn’t know Wil Shipley’s “Pimp My Code” postings in his blog should take a look at them. Very informative for Cocoa developers. Start with Part I.

Adding an iTunes-control to the NSStatusBar

I played a little bit with Cocoa and as a little testing-project i wanted to integrate a drop-down menu to the NSStatusBar for controlling the iTunes-application. Its not finished yet and i dont know if i’ll work on it in the next time. But it works for the three functions “play/pause”, “previous song” and “next song”. And this after only some minutes of work. :)

So, thats what i did:

First step: Create the NSMenu for the statusbar using the Interface Builder

After that: Make the connections for the Menu Items

Thirdly: Create the Header File

@interface TunesControl : NSObject
{
	IBOutlet NSMenu *tunesMenu;
}
- (IBAction)nextSong:(id)sender;
- (IBAction)previousSong:(id)sender;
- (IBAction)playPause:(id)sender;
@end

Finally the Implementation File: I use NSAppleScript to control iTunes. And i created the menu in the NSStatusBar using an icon as NSStatusItem and the NSMenu from the Interface Builder.

@implementation TunesControl
- (IBAction)nextSong:(id)sender {
	NSAppleScript *script = [[NSAppleScript alloc]
	initWithSource:@"tell application \"iTunes\"nnext tracknend tell"];
	[script executeAndReturnError:nil];
}

- (IBAction)previousSong:(id)sender {
	NSAppleScript *script = [[NSAppleScript alloc]
	initWithSource:@"tell application \"iTunes\"nprevious tracknend tell"];
	[script executeAndReturnError:nil];
}

- (IBAction)playPause:(id)sender {
	NSAppleScript *script = [[NSAppleScript alloc]
	initWithSource:@"tell application \"iTunes\"nplaypausenend tell"];
	[script executeAndReturnError:nil];
}

- (void)awakeFromNib {
	NSStatusBar *statusBar = [NSStatusBar systemStatusBar];
	NSStatusItem *statusItem = [statusBar statusItemWithLength:NSVariableStatusItemLength];
	NSImage *itemImage = [[NSImage alloc]
	initWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"icon" ofType:@"png"]];
	[statusItem retain];

	[statusItem setImage: itemImage];
	[statusItem setHighlightMode:YES];
	[statusItem setMenu:tunesMenu];
}
@end