Browsing articles from "March, 2010"
Mar
22

iTunes Connect Screenshots the Fast Way

Taking iPhone screenshots for iTunes Connect app submission can be a painful and tedious job. I used to take them on the real device and transfer them over to my Mac using iPhoto. I knew there MUST be an easier way than this!

read more

Mar
21

Mac Tip: Exposé Active Screen Corners

One of the first things I show my mates who have recently made the move to Mac, is Exposé Active Screen Corners (Hot Corners). read more

Mar
18

Building for Multiple Targets in XCode

Some months ago, I needed to create new versions of my app’s. I wanted to do this without duplicating any code or projects. read more

Mar
18

Accessing Cocoa Frameworks from Java

For a long time, I searched for a way to access the Mac OS X Address Book framework from Java. This can be easily done by importing a few of the com.apple Java libraries, however, this will break the cross platform nature of your code as those libraries are not available on Windows and Linux platforms.

Recently I stumbled upon an alternative solution.

Enter, the ‘Rococoa‘ framework, which magically uses JNI to allow access to underlying Cocoa libraries.

Rococoa is a generic Java binding to the Mac Objective-C object system. It allows the creation and use of Objective-C objects in Java, and the implementation of Objective-C interfaces in Java.

For example, for class ABPerson, we can simply create the following Java class:

You can see from above, any methods that I need from this class are declared as public abstract methods.

Do the same for class ABAddressBook. Now we can start to access contacts!

First we load the native library ‘AddressBook’

Then we get a handle on the Address Book shared instance, and end up with an array of people objects.

Now we loop through all the contacts

Cast the ABPerson object

Now we can get the properties of the record!

Overall, this fantastic tool gives allows Java developers to access virtually anything that you can access from a native Objective-C XCode project. And although it may not be the most elegant solution, it works quite well for most of us!

Let me know what you think in the comments below.

Cheers,

Finbarr

Mar
18

Hello!

I’m very excited to finally getting around to setting up my own personal website and blog.

I am hoping to use this space to post and share helpful developer tips and tricks relating to iPhone OS and also Java development and general tips and tricks. I also want to learn from you, the reader and your experiences…

I have been developing on the Mac for some years now and on the iPhone for almost 2. I am self thought at Objective-C and Cocoa, so am happy to share what I’ve learn’t along the way.

I also have to mention the folks over at 3essentials.com who were absolutely fantastic help in migrating all of my sites to a new server, providing great support all along.

Cheers,

Finbarr