Showing posts with label XCode. Show all posts
Showing posts with label XCode. Show all posts

Friday, September 3, 2010

Back from a long absence

I've been taking a break and trying to get back into iphone development.  I decided my wall paper editor needed a navigation controller.  This turned out nastier than I thought.  XCode 4 has some problems with user interface editing, and I also forgot what I was doing.

What I had to do to retrofit a navigation controller onto my existing project.


  1. Add a navigation controller to my main window
  2. Add my main I was using as the view in the navigation controller.  You have to set both the nib and the class to your class.
  3. Add a navigation controller outlet to my application delegate.
  4. Connect my navigation controller to that outlet.
  5. Modify the main of the delegate to do the following:
[window addSubview:rootViewController.view];

where rootViewController is:
@property (nonatomic, retain) IBOutlet UINavigationController *rootViewController;

I spent more time than I care to think doing this, I would miss one step or another and things would just not work.  It was useful practice to wire the thing together, but it ate a lot of time.

Sunday, July 25, 2010

XCode 4

I'm going to honor the NDA and not discuss details, however if you are a member of the XCode development program rush and download the beta version of XCode 4.  It is a vast improvement over XCode 3 and seems to fix some of the major problems that I had with XCode 3, especially in comparison with Visual Studio and Eclipse.   It's a separate install and won't trounce your XCode 3 install, and you can use both of them on your projects depending on your needs.

I've only scratched the surface, and I already find it very nice.

-Release not found in protocol

I had some delegates defined as id in my code, and have been ignoring the 'release not found in protocol' errors that I get on release (and retain).  I finally decided to eliminate them, I added the NSObject protocol to my protocol definition.  This removed this particular warning, which is good because I want to remove all warnings (if possible) from my code.

Sunday, April 18, 2010

Xcode Fun: warning: building for deployment target '3.1.3' requires an armv6 architecture.

I just spent an hour tracking down this error, I was trying to deploy to my iPhone device after testing in the simulator, and upgrading to a universal application.  I found that I was unable to select armv6 from the active architecture window.  I kept getting the error:
warning: building for deployment target '3.1.3' requires an armv6 architecture.
and another error about needing to use 3.2 for an IPAD.

I selected project settings from xcode, and everything was set up.  What I finally figured out is that I had to select the target, and then select 'Get Info' in order to display the dialog for MY TARGET.  From there I found my Architectures was set incorrectly.  I changed it to standard, (armv6 & armv7) and then I was able to deploy to my target device.

The key concept to remember seems to be that the targets is what matters, not the project setting (which is different from Visual Studio).

Monday, November 30, 2009

Static Iphone libraries.

As I started to work with Xcode I started to get utility routines that I would like to use across multiple projects. The first 'solution' is to just copy those into the new application. From a software engineering standpoint this is not bad, it is very bad.

I found a VERY useful post at
http://blog.stormyprods.com/2008/11/using-static-libraries-with-iphone-sdk.html

This provides in great detail how to establish a static library which can then be linked into your applications. Any routine that will be used in more than one application should be in a static library.

Thursday, July 30, 2009

Step 2. Install Source Code control

If you are going to be developing professionally, you NEED to have a source control system installed. While Xcode does not come packaged with a source control system, it does integrate nicely with Subversion.

The following document outlines some of the efforts needed to use subversion with Xcode.


Note, that this is a far more complicated process for installing subversion than is available elsewhere. You can download a prepackaged subversion that integrates with XCode from:


I pretty much just downloaded that, and ran the package. I then was able to follow the second half of the Apple document to add projects to subversion for management in Xcode.

Step 1. Buy a Mac and install XCode

The very first step you should do if you really want to do development with the iPhone, is purchase a Mac. While it is possible, with a jailbroken iPhone and a Linux virtual machine to develop without a Mac, I don't recommend it. (You can even develop directly on the iPhone itself, but I really don't recommend it.

In addition if you wish to distribute through the Apple store, you need a lot of infrastructure provided by Xcode, I don't know if its possible to get around it, but IMO, it's far more effort than it's worth. Instead buy a Mac Mini, which is a pretty nice machine, and download a free copy of Xcode from Apple.