Tuesday, January 31, 2012

iOS 7.0 Development

Updated: 20130303: Don't even think about using a MacBook Pro below the top 15 ich with SSD/16g-ram/2.6 Ghz.  Also there seems to be a defect in the original iPhone 5 where continous motion updates overloads the acceleration sensor resulting in a missing gravity vector - the iPhone 5s with the M7 coprocessor works fine for the 7 hours of 100ms granularity I have tested so far.

This is a really interesting time at Apple.
I just discovered that Objective C is partially based on Smalltalk.  Since I learned Smalltalk V as part of my first 2 years in university just before Java arrived - i needed to start developing in Objective C (for the iPhone, iPad and iPodt Touch) immediately.

1) Get a Mac - goto your nearest Apple store and ask for the Mac Mini to start.
2) Connect it to any keyboard, monitor, mouse
3) Set any http, https proxies
4) Get an ITunes account
5) Enter into an IOS developer agreement
6) Download Xcode
7) Get an iTunes Connect account and sign up for iOS Free and iOS Paid
     - fill out paid app legal forms
     - fill out banking info
8) Get some iOS and Objective C books
9) Start learning or transitioning to the unique syntax of Objective C
10) Leverage your knowledge of ORM and Rest
11) get apache Cordova / PhoneGap 2.2 and repackage your HTML 5 applications



You will need a Rest backend server - preferably on  Oracle Cloud, Google AppEngine or Amazon EC2.
https://cloud.oracle.com/mycloud/f?p=service:home:0
https://console.aws.amazon.com/ec2/home?region=us-east-1#s=Instances
http://blog.restbackup.com/2011/01/how-to-use-amazon-ec2-as-your-desktop.html

101) A year later when your provisioning profile is near expiration - purchase a new one (I was not able to update it).
102) If you upgrade your device past what your iOS SDK is at (IE: iOS 6.1 on my iPhone 4s but Xcode 4.5 - not 4.6 for  6.1) you need to upgrade the XCode dev environment as well.
https://developer.apple.com/devcenter/ios/index.action#downloads
103) When you upgrade to using a proper Macbook Pro - install a new copy of XCode 4.6 and re-setup your provisioning and developer profiles.
104) fix for "valid signing identity not found" is to refresh in the provisioning profile tab of the organizer

105) renaming GUI elements - see p.54 of Beginning iOS 6 Development
ctrl drag ui element to controller.h file to name it and create a IBOutlet wrapper



My first hello world collate program in Objective C
#import 
#include 

int main(int argc, const char * argv[]) {

    @autoreleasepool {
        int64_t current = 0;
        int64_t maxValue = 0;
        int maxPath = 0;
        int path = 0;
        int64_t max; // 64 bit signed integer, like Java's long
        for (int64_t i=27; i<(1 << 30); i+=2) {
            current = i;
            path = 0;
            while (current > 1) {
                 if (current % 2 == 0) {
                    current = current >> 1;
                    
                } else {
                    current = 1 + current + (current << 1);
                }
                path++;
                if(max < current) {
                    max = current;
                }
            }
            bool maxSet = false;
            if(maxValue < max) {
                maxValue = max;
                maxSet = true;
            }
            if(maxPath < path) {
                maxPath = path;
                maxSet = true;
            }
            if(maxSet) {
                NSLog(@"%lld: %lld: %i",i, max, path);
            }
        }
    }
    return 0;
}

Total Pageviews

Followers