iOS Development Tips

Compiling Apache Portable Runtime for iOS

According to Cross-compiling the Apache Portable Runtime for the iPhone, I have updated the scripts and created the patches using Xcode 3.2.3 on iOS 4.0. I have created the scripts for APR Utility too. The principal my environment is below.

Xcode 3.2.3 (GCC 4.2.1)
iOS 4.0
Apache Portable Runtime 0.9.18
APR Utility 0.9.17

To compile APR and APR Utility for iOS, use the scripts as the following smile Thanks for Michael Safyan.

$ uname -a
Darwin macmini.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386

$ gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ tar xvfz apr-0.9.18.tar.gz 
$ cd apr-0.9.18
$ ./apr-iphone-4.0-configure
$ make
$ sudo make install
$ sudo patch -d /opt/iphone-4.0/include/apr-0/ < apr_general-dev.diff

$ tar xvfz apr-util-0.9.17.tar.gz
$ cd apr-util-0.9.17
$ ./apr-util-iphone-4.0-configure 
$ make
$ cd uri/; gcc -o gen_uri_delims gen_uri_delims.c; ./gen_uri_delims; cd ..
$ make
$ sudo make install

Creating Universal Applications from Existing iPhone Projects for iPad

  1. According to iPad Programming Guide, update an existing iPhone projects.
  2. Add the following resources for iPad. Check Technical Q&A QA1686 about the iPad resources.
    • MainWindow-iPad.xib
    • 72x72px icon
  3. If you use the MPMoviePlayerController class, change to use the MPMoviePlayerViewController class on iPhonsOS 3.2.
  4. If you use the UITabBarController class, change to use the following subclass to support Aim to Support All Orientations.
    @interface MyUITabBarController : UITabBarController
    {
    }
    @implementation MyUITabBarController
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
    {
        return YES;
    }
    @end
        
  5. Check the following documentation not to run your source codes based on iPhoneOS 3.2 on iPhoneOS 3.1.x.
Topic revision: r5 - 2010-09-08 - 22:12:34 - SatoshiKonno
 

Copyright © 2010 by Satoshi Konno Powerd by TWiki logoTWiki.