summary refs log tree commit diff stats
path: root/examples/cross_calculator/ios
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cross_calculator/ios')
-rw-r--r--examples/cross_calculator/ios/cross-calculator.xcodeproj/project.pbxproj345
-rw-r--r--examples/cross_calculator/ios/readme.txt17
-rw-r--r--examples/cross_calculator/ios/resources/plist/cross-calculator-Info.plist30
-rw-r--r--examples/cross_calculator/ios/resources/ui/NRViewController.xib479
-rwxr-xr-xexamples/cross_calculator/ios/scripts/tags.sh13
-rwxr-xr-xexamples/cross_calculator/ios/scripts/xcode_prebuild.sh36
-rw-r--r--examples/cross_calculator/ios/src/AppDelegate.h7
-rw-r--r--examples/cross_calculator/ios/src/AppDelegate.m39
-rw-r--r--examples/cross_calculator/ios/src/NRViewController.h11
-rw-r--r--examples/cross_calculator/ios/src/NRViewController.m210
-rw-r--r--examples/cross_calculator/ios/src/cross-calculator-Prefix.pch10
-rw-r--r--examples/cross_calculator/ios/src/main.m13
12 files changed, 1210 insertions, 0 deletions
diff --git a/examples/cross_calculator/ios/cross-calculator.xcodeproj/project.pbxproj b/examples/cross_calculator/ios/cross-calculator.xcodeproj/project.pbxproj
new file mode 100644
index 000000000..36b43d31b
--- /dev/null
+++ b/examples/cross_calculator/ios/cross-calculator.xcodeproj/project.pbxproj
@@ -0,0 +1,345 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 46;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		D531422A15BC8611005EFF20 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D531422915BC8611005EFF20 /* UIKit.framework */; };
+		D531422C15BC8611005EFF20 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D531422B15BC8611005EFF20 /* Foundation.framework */; };
+		D531422E15BC8611005EFF20 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D531422D15BC8611005EFF20 /* CoreGraphics.framework */; };
+		D531424D15BC87B6005EFF20 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D531424A15BC87B6005EFF20 /* AppDelegate.m */; };
+		D531424E15BC87B6005EFF20 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D531424B15BC87B6005EFF20 /* main.m */; };
+		D531427215BC94B1005EFF20 /* backend.m in Sources */ = {isa = PBXBuildFile; fileRef = D531426F15BC94B1005EFF20 /* backend.m */; };
+		D531427415BC94B1005EFF20 /* system.m in Sources */ = {isa = PBXBuildFile; fileRef = D531427115BC94B1005EFF20 /* system.m */; };
+		D5B6F94815FA8D4C0084A85B /* NRViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D5B6F94615FA8D4C0084A85B /* NRViewController.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+		D531422515BC8611005EFF20 /* cross-calculator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "cross-calculator.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+		D531422915BC8611005EFF20 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+		D531422B15BC8611005EFF20 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+		D531422D15BC8611005EFF20 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+		D531424715BC87A5005EFF20 /* cross-calculator-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "cross-calculator-Info.plist"; path = "resources/plist/cross-calculator-Info.plist"; sourceTree = "<group>"; };
+		D531424915BC87B6005EFF20 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = src/AppDelegate.h; sourceTree = "<group>"; };
+		D531424A15BC87B6005EFF20 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = src/AppDelegate.m; sourceTree = "<group>"; };
+		D531424B15BC87B6005EFF20 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/main.m; sourceTree = "<group>"; };
+		D531424C15BC87B6005EFF20 /* cross-calculator-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "cross-calculator-Prefix.pch"; path = "src/cross-calculator-Prefix.pch"; sourceTree = "<group>"; };
+		D531426715BC91EF005EFF20 /* tags.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = tags.sh; path = scripts/tags.sh; sourceTree = "<group>"; };
+		D531426815BC91EF005EFF20 /* xcode_prebuild.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = xcode_prebuild.sh; path = scripts/xcode_prebuild.sh; sourceTree = "<group>"; };
+		D531426F15BC94B1005EFF20 /* backend.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = backend.m; path = build/nimcache/backend.m; sourceTree = "<group>"; };
+		D531427115BC94B1005EFF20 /* system.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = system.m; path = build/nimcache/system.m; sourceTree = "<group>"; };
+		D592E19015C7120F005258EA /* backend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = backend.h; path = build/nimcache/backend.h; sourceTree = "<group>"; };
+		D592E19115C71415005258EA /* nimbase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = nimbase.h; path = build/nimcache/nimbase.h; sourceTree = "<group>"; };
+		D5B6F94515FA8D4C0084A85B /* NRViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NRViewController.h; path = src/NRViewController.h; sourceTree = "<group>"; };
+		D5B6F94615FA8D4C0084A85B /* NRViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NRViewController.m; path = src/NRViewController.m; sourceTree = "<group>"; };
+		D5B6F96315FB448D0084A85B /* NRViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = NRViewController.xib; path = resources/ui/NRViewController.xib; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		D531422215BC8610005EFF20 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D531422A15BC8611005EFF20 /* UIKit.framework in Frameworks */,
+				D531422C15BC8611005EFF20 /* Foundation.framework in Frameworks */,
+				D531422E15BC8611005EFF20 /* CoreGraphics.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		D531421A15BC8610005EFF20 = {
+			isa = PBXGroup;
+			children = (
+				D531426A15BC93D5005EFF20 /* build */,
+				D531424515BC874E005EFF20 /* resources */,
+				D531426615BC91E1005EFF20 /* scripts */,
+				D531424815BC87AD005EFF20 /* src */,
+				D531422815BC8611005EFF20 /* Frameworks */,
+				D531422615BC8611005EFF20 /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		D531422615BC8611005EFF20 /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				D531422515BC8611005EFF20 /* cross-calculator.app */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		D531422815BC8611005EFF20 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				D531422915BC8611005EFF20 /* UIKit.framework */,
+				D531422B15BC8611005EFF20 /* Foundation.framework */,
+				D531422D15BC8611005EFF20 /* CoreGraphics.framework */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
+		D531424515BC874E005EFF20 /* resources */ = {
+			isa = PBXGroup;
+			children = (
+				D531424615BC8756005EFF20 /* plist */,
+				D5B6F96115FB447C0084A85B /* ui */,
+			);
+			name = resources;
+			sourceTree = "<group>";
+		};
+		D531424615BC8756005EFF20 /* plist */ = {
+			isa = PBXGroup;
+			children = (
+				D531424715BC87A5005EFF20 /* cross-calculator-Info.plist */,
+			);
+			name = plist;
+			sourceTree = "<group>";
+		};
+		D531424815BC87AD005EFF20 /* src */ = {
+			isa = PBXGroup;
+			children = (
+				D531424915BC87B6005EFF20 /* AppDelegate.h */,
+				D531424A15BC87B6005EFF20 /* AppDelegate.m */,
+				D531424C15BC87B6005EFF20 /* cross-calculator-Prefix.pch */,
+				D531424B15BC87B6005EFF20 /* main.m */,
+				D5B6F94515FA8D4C0084A85B /* NRViewController.h */,
+				D5B6F94615FA8D4C0084A85B /* NRViewController.m */,
+			);
+			name = src;
+			sourceTree = "<group>";
+		};
+		D531426615BC91E1005EFF20 /* scripts */ = {
+			isa = PBXGroup;
+			children = (
+				D531426715BC91EF005EFF20 /* tags.sh */,
+				D531426815BC91EF005EFF20 /* xcode_prebuild.sh */,
+			);
+			name = scripts;
+			sourceTree = "<group>";
+		};
+		D531426A15BC93D5005EFF20 /* build */ = {
+			isa = PBXGroup;
+			children = (
+				D531426E15BC94A6005EFF20 /* nimrod */,
+			);
+			name = build;
+			sourceTree = "<group>";
+		};
+		D531426E15BC94A6005EFF20 /* nimrod */ = {
+			isa = PBXGroup;
+			children = (
+				D592E19015C7120F005258EA /* backend.h */,
+				D531426F15BC94B1005EFF20 /* backend.m */,
+				D592E19115C71415005258EA /* nimbase.h */,
+				D531427115BC94B1005EFF20 /* system.m */,
+			);
+			name = nimrod;
+			sourceTree = "<group>";
+		};
+		D5B6F96115FB447C0084A85B /* ui */ = {
+			isa = PBXGroup;
+			children = (
+				D5B6F96315FB448D0084A85B /* NRViewController.xib */,
+			);
+			name = ui;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		D531422415BC8610005EFF20 /* cross-calculator */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = D531423D15BC8611005EFF20 /* Build configuration list for PBXNativeTarget "cross-calculator" */;
+			buildPhases = (
+				D531426915BC926C005EFF20 /* ShellScript */,
+				D531422115BC8610005EFF20 /* Sources */,
+				D531422215BC8610005EFF20 /* Frameworks */,
+				D531422315BC8610005EFF20 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = "cross-calculator";
+			productName = "cross-calculator";
+			productReference = D531422515BC8611005EFF20 /* cross-calculator.app */;
+			productType = "com.apple.product-type.application";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		D531421C15BC8610005EFF20 /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				LastUpgradeCheck = 0420;
+				ORGANIZATIONNAME = "Electric Hands Software";
+			};
+			buildConfigurationList = D531421F15BC8610005EFF20 /* Build configuration list for PBXProject "cross-calculator" */;
+			compatibilityVersion = "Xcode 3.2";
+			developmentRegion = English;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+			);
+			mainGroup = D531421A15BC8610005EFF20;
+			productRefGroup = D531422615BC8611005EFF20 /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				D531422415BC8610005EFF20 /* cross-calculator */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		D531422315BC8610005EFF20 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+		D531426915BC926C005EFF20 /* ShellScript */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+			);
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = scripts/xcode_prebuild.sh;
+		};
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		D531422115BC8610005EFF20 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				D531424D15BC87B6005EFF20 /* AppDelegate.m in Sources */,
+				D531424E15BC87B6005EFF20 /* main.m in Sources */,
+				D531427215BC94B1005EFF20 /* backend.m in Sources */,
+				D531427415BC94B1005EFF20 /* system.m in Sources */,
+				D5B6F94815FA8D4C0084A85B /* NRViewController.m in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+		D531423B15BC8611005EFF20 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ARCHS = (
+					armv7,
+					armv6,
+				);
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				COPY_PHASE_STRIP = NO;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+				GCC_VERSION = "";
+				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
+				OTHER_LDFLAGS = (
+					"-weak_library",
+					/usr/lib/libSystem.B.dylib,
+				);
+				SDKROOT = iphoneos;
+				TARGETED_DEVICE_FAMILY = "1,2";
+			};
+			name = Debug;
+		};
+		D531423C15BC8611005EFF20 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				ARCHS = (
+					armv7,
+					armv6,
+				);
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				COPY_PHASE_STRIP = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_VERSION = "";
+				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
+				OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+				OTHER_LDFLAGS = (
+					"-weak_library",
+					/usr/lib/libSystem.B.dylib,
+				);
+				SDKROOT = iphoneos;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				VALIDATE_PRODUCT = YES;
+			};
+			name = Release;
+		};
+		D531423E15BC8611005EFF20 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = "src/cross-calculator-Prefix.pch";
+				INFOPLIST_FILE = "resources/plist/cross-calculator-Info.plist";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				WRAPPER_EXTENSION = app;
+			};
+			name = Debug;
+		};
+		D531423F15BC8611005EFF20 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = "src/cross-calculator-Prefix.pch";
+				INFOPLIST_FILE = "resources/plist/cross-calculator-Info.plist";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				WRAPPER_EXTENSION = app;
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		D531421F15BC8610005EFF20 /* Build configuration list for PBXProject "cross-calculator" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				D531423B15BC8611005EFF20 /* Debug */,
+				D531423C15BC8611005EFF20 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		D531423D15BC8611005EFF20 /* Build configuration list for PBXNativeTarget "cross-calculator" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				D531423E15BC8611005EFF20 /* Debug */,
+				D531423F15BC8611005EFF20 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = D531421C15BC8610005EFF20 /* Project object */;
+}
diff --git a/examples/cross_calculator/ios/readme.txt b/examples/cross_calculator/ios/readme.txt
new file mode 100644
index 000000000..e75db72bf
--- /dev/null
+++ b/examples/cross_calculator/ios/readme.txt
@@ -0,0 +1,17 @@
+In this directory you will find the iOS platform cross-calculator sample.
+
+The iOS version of the code builds a view controller in charge of displaying
+the interface to the user. The nimrod backend code is compiled into C code and
+put into build/nimrod as a pre-build phase of the project.
+
+When the calculate button is used the view controller calls the nimrod code to
+delegate the logic of the operation and puts the result in a label for display.
+All interface error checks are implemented in the view controller.
+
+You can use this as a starting point for your project or look at the history of
+the github project at https://github.com/gradha/nimrod-on-ios. That repository
+documents the individual integration steps you would take for any iOS project.
+
+This version of the iOS project is known to work with Xcode 4.2 and Xcode
+4.4.1. The final binary can be deployed on iOS 3.x to 5.x supporting all iOS
+platforms and versions available at the moment.
diff --git a/examples/cross_calculator/ios/resources/plist/cross-calculator-Info.plist b/examples/cross_calculator/ios/resources/plist/cross-calculator-Info.plist
new file mode 100644
index 000000000..758f20e38
--- /dev/null
+++ b/examples/cross_calculator/ios/resources/plist/cross-calculator-Info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleDisplayName</key>
+	<string>${PRODUCT_NAME}</string>
+	<key>CFBundleExecutable</key>
+	<string>${EXECUTABLE_NAME}</string>
+	<key>CFBundleIconFiles</key>
+	<array/>
+	<key>CFBundleIdentifier</key>
+	<string>com.github.nimrod.${PRODUCT_NAME:rfc1034identifier}</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>${PRODUCT_NAME}</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>1.0</string>
+	<key>UIApplicationExitsOnSuspend</key>
+	<true/>
+</dict>
+</plist>
diff --git a/examples/cross_calculator/ios/resources/ui/NRViewController.xib b/examples/cross_calculator/ios/resources/ui/NRViewController.xib
new file mode 100644
index 000000000..b260db2af
--- /dev/null
+++ b/examples/cross_calculator/ios/resources/ui/NRViewController.xib
@@ -0,0 +1,479 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
+	<data>
+		<int key="IBDocument.SystemTarget">0</int>
+		<string key="IBDocument.SystemVersion">11E53</string>
+		<string key="IBDocument.InterfaceBuilderVersion">2549</string>
+		<string key="IBDocument.AppKitVersion">1138.47</string>
+		<string key="IBDocument.HIToolboxVersion">569.00</string>
+		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+			<string key="NS.object.0">1498</string>
+		</object>
+		<array key="IBDocument.IntegratedClassDependencies">
+			<string>IBProxyObject</string>
+			<string>IBUIButton</string>
+			<string>IBUILabel</string>
+			<string>IBUITextField</string>
+			<string>IBUIView</string>
+		</array>
+		<array key="IBDocument.PluginDependencies">
+			<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+		</array>
+		<object class="NSMutableDictionary" key="IBDocument.Metadata">
+			<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+			<integer value="1" key="NS.object.0"/>
+		</object>
+		<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+			<object class="IBProxyObject" id="372490531">
+				<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+			</object>
+			<object class="IBProxyObject" id="975951072">
+				<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+			</object>
+			<object class="IBUIView" id="191373211">
+				<reference key="NSNextResponder"/>
+				<int key="NSvFlags">274</int>
+				<array class="NSMutableArray" key="NSSubviews">
+					<object class="IBUIButton" id="467453084">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">292</int>
+						<string key="NSFrame">{{0, -10}, {320, 480}}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<reference key="NSWindow"/>
+						<string key="NSReuseIdentifierKey">_NS:9</string>
+						<bool key="IBUIOpaque">NO</bool>
+						<int key="IBUITag">1</int>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<int key="IBUIContentHorizontalAlignment">0</int>
+						<int key="IBUIContentVerticalAlignment">0</int>
+						<object class="NSColor" key="IBUIHighlightedTitleColor" id="95215378">
+							<int key="NSColorSpace">3</int>
+							<bytes key="NSWhite">MQA</bytes>
+						</object>
+						<object class="NSColor" key="IBUINormalTitleColor">
+							<int key="NSColorSpace">1</int>
+							<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+						</object>
+						<object class="NSColor" key="IBUINormalTitleShadowColor" id="1056499111">
+							<int key="NSColorSpace">3</int>
+							<bytes key="NSWhite">MC41AA</bytes>
+						</object>
+						<object class="IBUIFontDescription" key="IBUIFontDescription" id="686052398">
+							<int key="type">2</int>
+							<double key="pointSize">15</double>
+						</object>
+						<object class="NSFont" key="IBUIFont" id="594372787">
+							<string key="NSName">Helvetica-Bold</string>
+							<double key="NSSize">15</double>
+							<int key="NSfFlags">16</int>
+						</object>
+					</object>
+					<object class="IBUILabel" id="353054360">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">306</int>
+						<string key="NSFrameSize">{320, 34}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<reference key="NSWindow"/>
+						<reference key="NSNextKeyView" ref="525225214"/>
+						<string key="NSReuseIdentifierKey">_NS:9</string>
+						<bool key="IBUIOpaque">NO</bool>
+						<bool key="IBUIClipsSubviews">YES</bool>
+						<int key="IBUIContentMode">7</int>
+						<int key="IBUITag">2</int>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<string key="IBUIText">Nimrod Crossplatform Calculator</string>
+						<object class="NSColor" key="IBUITextColor" id="128895179">
+							<int key="NSColorSpace">1</int>
+							<bytes key="NSRGB">MCAwIDAAA</bytes>
+						</object>
+						<nil key="IBUIHighlightedColor"/>
+						<int key="IBUIBaselineAdjustment">0</int>
+						<float key="IBUIMinimumFontSize">10</float>
+						<int key="IBUITextAlignment">1</int>
+						<object class="IBUIFontDescription" key="IBUIFontDescription">
+							<int key="type">2</int>
+							<double key="pointSize">18</double>
+						</object>
+						<object class="NSFont" key="IBUIFont">
+							<string key="NSName">Helvetica-Bold</string>
+							<double key="NSSize">18</double>
+							<int key="NSfFlags">16</int>
+						</object>
+					</object>
+					<object class="IBUILabel" id="525225214">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">294</int>
+						<string key="NSFrame">{{20, 42}, {165, 31}}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<reference key="NSWindow"/>
+						<reference key="NSNextKeyView" ref="1040444341"/>
+						<string key="NSReuseIdentifierKey">_NS:9</string>
+						<bool key="IBUIOpaque">NO</bool>
+						<bool key="IBUIClipsSubviews">YES</bool>
+						<int key="IBUIContentMode">7</int>
+						<int key="IBUITag">3</int>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<string key="IBUIText">Value A:</string>
+						<reference key="IBUITextColor" ref="128895179"/>
+						<nil key="IBUIHighlightedColor"/>
+						<int key="IBUIBaselineAdjustment">0</int>
+						<float key="IBUIMinimumFontSize">10</float>
+						<object class="IBUIFontDescription" key="IBUIFontDescription" id="768572949">
+							<int key="type">1</int>
+							<double key="pointSize">17</double>
+						</object>
+						<object class="NSFont" key="IBUIFont" id="972319481">
+							<string key="NSName">Helvetica</string>
+							<double key="NSSize">17</double>
+							<int key="NSfFlags">16</int>
+						</object>
+					</object>
+					<object class="IBUILabel" id="904781109">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">294</int>
+						<string key="NSFrame">{{20, 81}, {165, 31}}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<reference key="NSWindow"/>
+						<reference key="NSNextKeyView" ref="1041721572"/>
+						<string key="NSReuseIdentifierKey">_NS:9</string>
+						<bool key="IBUIOpaque">NO</bool>
+						<bool key="IBUIClipsSubviews">YES</bool>
+						<int key="IBUIContentMode">7</int>
+						<int key="IBUITag">4</int>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<string key="IBUIText">Value B:</string>
+						<reference key="IBUITextColor" ref="128895179"/>
+						<nil key="IBUIHighlightedColor"/>
+						<int key="IBUIBaselineAdjustment">0</int>
+						<float key="IBUIMinimumFontSize">10</float>
+						<reference key="IBUIFontDescription" ref="768572949"/>
+						<reference key="IBUIFont" ref="972319481"/>
+					</object>
+					<object class="IBUIButton" id="557594991">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">291</int>
+						<string key="NSFrame">{{193, 124}, {107, 37}}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<reference key="NSWindow"/>
+						<reference key="NSNextKeyView"/>
+						<string key="NSReuseIdentifierKey">_NS:9</string>
+						<bool key="IBUIOpaque">NO</bool>
+						<int key="IBUITag">5</int>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<int key="IBUIContentHorizontalAlignment">0</int>
+						<int key="IBUIContentVerticalAlignment">0</int>
+						<int key="IBUIButtonType">1</int>
+						<string key="IBUINormalTitle">Add!</string>
+						<reference key="IBUIHighlightedTitleColor" ref="95215378"/>
+						<object class="NSColor" key="IBUINormalTitleColor">
+							<int key="NSColorSpace">1</int>
+							<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+						</object>
+						<reference key="IBUINormalTitleShadowColor" ref="1056499111"/>
+						<reference key="IBUIFontDescription" ref="686052398"/>
+						<reference key="IBUIFont" ref="594372787"/>
+					</object>
+					<object class="IBUILabel" id="360864196">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">292</int>
+						<string key="NSFrame">{{20, 124}, {60, 37}}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<reference key="NSWindow"/>
+						<reference key="NSNextKeyView" ref="521073831"/>
+						<string key="NSReuseIdentifierKey">_NS:9</string>
+						<bool key="IBUIOpaque">NO</bool>
+						<bool key="IBUIClipsSubviews">YES</bool>
+						<int key="IBUIContentMode">7</int>
+						<int key="IBUITag">6</int>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<string key="IBUIText">Result:</string>
+						<reference key="IBUITextColor" ref="128895179"/>
+						<nil key="IBUIHighlightedColor"/>
+						<int key="IBUIBaselineAdjustment">0</int>
+						<float key="IBUIMinimumFontSize">10</float>
+						<reference key="IBUIFontDescription" ref="768572949"/>
+						<reference key="IBUIFont" ref="972319481"/>
+					</object>
+					<object class="IBUILabel" id="521073831">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">294</int>
+						<string key="NSFrame">{{88, 124}, {97, 37}}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<reference key="NSWindow"/>
+						<reference key="NSNextKeyView" ref="557594991"/>
+						<string key="NSReuseIdentifierKey">_NS:9</string>
+						<bool key="IBUIOpaque">NO</bool>
+						<bool key="IBUIClipsSubviews">YES</bool>
+						<int key="IBUIContentMode">7</int>
+						<int key="IBUITag">7</int>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<string key="IBUIText"/>
+						<reference key="IBUITextColor" ref="128895179"/>
+						<nil key="IBUIHighlightedColor"/>
+						<int key="IBUIBaselineAdjustment">0</int>
+						<float key="IBUIMinimumFontSize">10</float>
+						<reference key="IBUIFontDescription" ref="768572949"/>
+						<reference key="IBUIFont" ref="972319481"/>
+					</object>
+					<object class="IBUITextField" id="1040444341">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">291</int>
+						<string key="NSFrame">{{193, 42}, {107, 31}}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<reference key="NSWindow"/>
+						<reference key="NSNextKeyView" ref="904781109"/>
+						<string key="NSReuseIdentifierKey">_NS:9</string>
+						<bool key="IBUIOpaque">NO</bool>
+						<bool key="IBUIClipsSubviews">YES</bool>
+						<int key="IBUITag">8</int>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<int key="IBUIContentVerticalAlignment">0</int>
+						<string key="IBUIText"/>
+						<int key="IBUIBorderStyle">3</int>
+						<string key="IBUIPlaceholder">Integer</string>
+						<object class="NSColor" key="IBUITextColor">
+							<int key="NSColorSpace">3</int>
+							<bytes key="NSWhite">MAA</bytes>
+							<object class="NSColorSpace" key="NSCustomColorSpace" id="433120901">
+								<int key="NSID">2</int>
+							</object>
+						</object>
+						<int key="IBUITextAlignment">1</int>
+						<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+						<float key="IBUIMinimumFontSize">17</float>
+						<object class="IBUITextInputTraits" key="IBUITextInputTraits">
+							<int key="IBUIKeyboardType">4</int>
+							<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						</object>
+						<int key="IBUIClearButtonMode">1</int>
+						<object class="IBUIFontDescription" key="IBUIFontDescription" id="836805198">
+							<int key="type">1</int>
+							<double key="pointSize">14</double>
+						</object>
+						<object class="NSFont" key="IBUIFont" id="700927782">
+							<string key="NSName">Helvetica</string>
+							<double key="NSSize">14</double>
+							<int key="NSfFlags">16</int>
+						</object>
+					</object>
+					<object class="IBUITextField" id="1041721572">
+						<reference key="NSNextResponder" ref="191373211"/>
+						<int key="NSvFlags">291</int>
+						<string key="NSFrame">{{193, 81}, {107, 31}}</string>
+						<reference key="NSSuperview" ref="191373211"/>
+						<reference key="NSWindow"/>
+						<reference key="NSNextKeyView" ref="360864196"/>
+						<string key="NSReuseIdentifierKey">_NS:9</string>
+						<bool key="IBUIOpaque">NO</bool>
+						<bool key="IBUIClipsSubviews">YES</bool>
+						<int key="IBUITag">9</int>
+						<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						<int key="IBUIContentVerticalAlignment">0</int>
+						<string key="IBUIText"/>
+						<int key="IBUIBorderStyle">3</int>
+						<string key="IBUIPlaceholder">Integer</string>
+						<object class="NSColor" key="IBUITextColor">
+							<int key="NSColorSpace">3</int>
+							<bytes key="NSWhite">MAA</bytes>
+							<reference key="NSCustomColorSpace" ref="433120901"/>
+						</object>
+						<int key="IBUITextAlignment">1</int>
+						<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+						<float key="IBUIMinimumFontSize">17</float>
+						<object class="IBUITextInputTraits" key="IBUITextInputTraits">
+							<int key="IBUIKeyboardType">4</int>
+							<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+						</object>
+						<int key="IBUIClearButtonMode">1</int>
+						<reference key="IBUIFontDescription" ref="836805198"/>
+						<reference key="IBUIFont" ref="700927782"/>
+					</object>
+				</array>
+				<string key="NSFrame">{{0, 20}, {320, 460}}</string>
+				<reference key="NSSuperview"/>
+				<reference key="NSWindow"/>
+				<reference key="NSNextKeyView" ref="353054360"/>
+				<object class="NSColor" key="IBUIBackgroundColor">
+					<int key="NSColorSpace">3</int>
+					<bytes key="NSWhite">MQA</bytes>
+					<reference key="NSCustomColorSpace" ref="433120901"/>
+				</object>
+				<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+				<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+			</object>
+		</array>
+		<object class="IBObjectContainer" key="IBDocument.Objects">
+			<array class="NSMutableArray" key="connectionRecords"/>
+			<object class="IBMutableOrderedSet" key="objectRecords">
+				<array key="orderedObjects">
+					<object class="IBObjectRecord">
+						<int key="objectID">0</int>
+						<array key="object" id="0"/>
+						<reference key="children" ref="1000"/>
+						<nil key="parent"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">1</int>
+						<reference key="object" ref="191373211"/>
+						<array class="NSMutableArray" key="children">
+							<reference ref="353054360"/>
+							<reference ref="525225214"/>
+							<reference ref="904781109"/>
+							<reference ref="557594991"/>
+							<reference ref="360864196"/>
+							<reference ref="521073831"/>
+							<reference ref="1040444341"/>
+							<reference ref="1041721572"/>
+							<reference ref="467453084"/>
+						</array>
+						<reference key="parent" ref="0"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-1</int>
+						<reference key="object" ref="372490531"/>
+						<reference key="parent" ref="0"/>
+						<string key="objectName">File's Owner</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-2</int>
+						<reference key="object" ref="975951072"/>
+						<reference key="parent" ref="0"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">14</int>
+						<reference key="object" ref="1041721572"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">13</int>
+						<reference key="object" ref="1040444341"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">12</int>
+						<reference key="object" ref="521073831"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">11</int>
+						<reference key="object" ref="360864196"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">10</int>
+						<reference key="object" ref="557594991"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">8</int>
+						<reference key="object" ref="904781109"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">7</int>
+						<reference key="object" ref="525225214"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">4</int>
+						<reference key="object" ref="353054360"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">22</int>
+						<reference key="object" ref="467453084"/>
+						<reference key="parent" ref="191373211"/>
+					</object>
+				</array>
+			</object>
+			<dictionary class="NSMutableDictionary" key="flattenedProperties">
+				<string key="-1.CustomClassName">NRViewController</string>
+				<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="-2.CustomClassName">UIResponder</string>
+				<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="10.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="11.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="12.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="13.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="14.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="22.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+				<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+			</dictionary>
+			<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+			<nil key="activeLocalization"/>
+			<dictionary class="NSMutableDictionary" key="localizations"/>
+			<nil key="sourceID"/>
+			<int key="maxID">22</int>
+		</object>
+		<object class="IBClassDescriber" key="IBDocument.Classes">
+			<array class="NSMutableArray" key="referencedPartialClassDescriptions">
+				<object class="IBPartialClassDescription">
+					<string key="className">NRViewController</string>
+					<string key="superclassName">UIViewController</string>
+					<dictionary class="NSMutableDictionary" key="actions">
+						<string key="backgroundTouched">id</string>
+						<string key="calculateButtonTouched">id</string>
+					</dictionary>
+					<dictionary class="NSMutableDictionary" key="actionInfosByName">
+						<object class="IBActionInfo" key="backgroundTouched">
+							<string key="name">backgroundTouched</string>
+							<string key="candidateClassName">id</string>
+						</object>
+						<object class="IBActionInfo" key="calculateButtonTouched">
+							<string key="name">calculateButtonTouched</string>
+							<string key="candidateClassName">id</string>
+						</object>
+					</dictionary>
+					<dictionary class="NSMutableDictionary" key="outlets">
+						<string key="aText">UITextField</string>
+						<string key="bText">UITextField</string>
+						<string key="calculateButton">UIButton</string>
+						<string key="resultLabel">UILabel</string>
+					</dictionary>
+					<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+						<object class="IBToOneOutletInfo" key="aText">
+							<string key="name">aText</string>
+							<string key="candidateClassName">UITextField</string>
+						</object>
+						<object class="IBToOneOutletInfo" key="bText">
+							<string key="name">bText</string>
+							<string key="candidateClassName">UITextField</string>
+						</object>
+						<object class="IBToOneOutletInfo" key="calculateButton">
+							<string key="name">calculateButton</string>
+							<string key="candidateClassName">UIButton</string>
+						</object>
+						<object class="IBToOneOutletInfo" key="resultLabel">
+							<string key="name">resultLabel</string>
+							<string key="candidateClassName">UILabel</string>
+						</object>
+					</dictionary>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">./Classes/NRViewController.h</string>
+					</object>
+				</object>
+			</array>
+		</object>
+		<int key="IBDocument.localizationMode">0</int>
+		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+		<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
+			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
+			<real value="0.0" key="NS.object.0"/>
+		</object>
+		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+		<int key="IBDocument.defaultPropertyAccessControl">3</int>
+		<string key="IBCocoaTouchPluginVersion">1498</string>
+	</data>
+</archive>
diff --git a/examples/cross_calculator/ios/scripts/tags.sh b/examples/cross_calculator/ios/scripts/tags.sh
new file mode 100755
index 000000000..111e7a1c0
--- /dev/null
+++ b/examples/cross_calculator/ios/scripts/tags.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ ! -d src ]
+then
+	cd ..
+fi
+
+if [ -d src ]
+then
+	~/bin/objctags -R \
+		build/nimcache \
+		src
+fi
diff --git a/examples/cross_calculator/ios/scripts/xcode_prebuild.sh b/examples/cross_calculator/ios/scripts/xcode_prebuild.sh
new file mode 100755
index 000000000..7626ba0b9
--- /dev/null
+++ b/examples/cross_calculator/ios/scripts/xcode_prebuild.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# Set this to the full path of your nimrod compiler
+# since Xcode doesn't inherit your user environment.
+PATH_TO_NIMROD=~/project/nimrod/bin/nimrod
+# Set this to the location of the nimbase.h file so
+# the script can update it if it changes.
+PATH_TO_NIMBASE=~/project/nimrod/lib/nimbase.h
+
+# Force errors to fail script.
+set -e
+
+# If we are running from inside the scripts subdir, get out.
+if [ ! -d src ]
+then
+	cd ..
+fi
+
+DEST_NIMBASE=build/nimcache/nimbase.h
+
+# Ok, are we out now?
+if [ -d src ]
+then
+	# You may want to use a wildcard here to compile all nimrod files.
+	$PATH_TO_NIMROD objc --noMain  --app:lib \
+		--nimcache:build/nimcache --compileOnly \
+		--header --cpu:i386 ../nimrod_backend/backend.nim
+	if [ "${PATH_TO_NIMBASE}" -nt "${DEST_NIMBASE}" ]
+	then
+		echo "Updating nimbase.h"
+		cp "${PATH_TO_NIMBASE}" "${DEST_NIMBASE}"
+	fi
+else
+	echo "Uh oh, src directory not found?"
+	exit 1
+fi
diff --git a/examples/cross_calculator/ios/src/AppDelegate.h b/examples/cross_calculator/ios/src/AppDelegate.h
new file mode 100644
index 000000000..a5a8b3852
--- /dev/null
+++ b/examples/cross_calculator/ios/src/AppDelegate.h
@@ -0,0 +1,7 @@
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
diff --git a/examples/cross_calculator/ios/src/AppDelegate.m b/examples/cross_calculator/ios/src/AppDelegate.m
new file mode 100644
index 000000000..53e7f6188
--- /dev/null
+++ b/examples/cross_calculator/ios/src/AppDelegate.m
@@ -0,0 +1,39 @@
+#import "AppDelegate.h"
+
+#import "NRViewController.h"
+
+
+@interface AppDelegate ()
+@property (nonatomic, retain) NRViewController *viewController;
+@end
+
+
+@implementation AppDelegate
+
+@synthesize viewController = _viewController;
+@synthesize window = _window;
+
+- (BOOL)application:(UIApplication *)application
+	didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+	self.window = [[[UIWindow alloc]
+		initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
+
+	self.viewController = [[NRViewController new] autorelease];
+	if ([self.window respondsToSelector:@selector(setRootViewController:)])
+		self.window.rootViewController = self.viewController;
+	else
+		[self.window addSubview:self.viewController.view];
+	[self.window makeKeyAndVisible];
+
+	return YES;
+}
+
+- (void)dealloc
+{
+	[_window release];
+	[_viewController release];
+	[super dealloc];
+}
+
+@end
diff --git a/examples/cross_calculator/ios/src/NRViewController.h b/examples/cross_calculator/ios/src/NRViewController.h
new file mode 100644
index 000000000..36ba37758
--- /dev/null
+++ b/examples/cross_calculator/ios/src/NRViewController.h
@@ -0,0 +1,11 @@
+@interface NRViewController : UIViewController
+
+@property (nonatomic, retain) IBOutlet UIButton *calculateButton;
+@property (nonatomic, retain) IBOutlet UITextField *aText;
+@property (nonatomic, retain) IBOutlet UITextField *bText;
+@property (nonatomic, retain) IBOutlet UILabel *resultLabel;
+
+- (IBAction)calculateButtonTouched;
+- (IBAction)backgroundTouched;
+
+@end
\ No newline at end of file
diff --git a/examples/cross_calculator/ios/src/NRViewController.m b/examples/cross_calculator/ios/src/NRViewController.m
new file mode 100644
index 000000000..bd0df7d6b
--- /dev/null
+++ b/examples/cross_calculator/ios/src/NRViewController.m
@@ -0,0 +1,210 @@
+#import "NRViewController.h"
+
+#import "backend.h"
+
+
+@implementation NRViewController
+
+@synthesize aText = _aText;
+@synthesize bText = _bText;
+@synthesize calculateButton = _calculateButton;
+@synthesize resultLabel = _resultLabel;
+
+- (void)dealloc
+{
+	[_aText release];
+	[_bText release];
+	[_calculateButton release];
+	[_resultLabel release];
+	[super dealloc];
+}
+
+- (void)viewDidUnload
+{
+	self.calculateButton = nil;
+	self.aText = nil;
+	self.bText = nil;
+	self.resultLabel = nil;
+	[super viewDidUnload];
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:
+	(UIInterfaceOrientation)interfaceOrientation
+{
+	return YES;
+}
+
+/// User wants to calculate the inputs. Well, do it!
+- (IBAction)calculateButtonTouched
+{
+	// Dismiss all keyboards.
+	[self backgroundTouched];
+
+	// Call nimrod code, store the result and display it.
+	const int a = [self.aText.text intValue];
+	const int b = [self.bText.text intValue];
+	const int c = myAdd(a, b);
+	self.resultLabel.text = [NSString stringWithFormat:@"%d + %d = %d",
+		a, b, c];
+}
+
+/// If the user touches the background, dismiss any visible keyboard.
+- (IBAction)backgroundTouched
+{
+	[self.aText resignFirstResponder];
+	[self.bText resignFirstResponder];
+}
+
+/** Custom loadView method for backwards compatiblity.
+ * Unfortunately I've been unable to coerce Xcode 4.4 to generate nib files
+ * which are compatible with my trusty iOS 3.0 ipod touch so in order to be
+ * fully compatible for all devices we have to build the interface manually in
+ * code rather than through the keyed archivers provided by the interface
+ * builder.
+ *
+ * Rather than recreating the user interface manually in code the tool nib2obj
+ * was used on the xib file and slightly modified to fit the original property
+ * names. Which means here is a lot of garbage you would never write in real
+ * life. Please ignore the following "wall of code" for the purposes of
+ * learning Nimrod, this is all just because Apple can't be bothered to
+ * maintain backwards compatibility properly.
+ */
+- (void)loadView
+{
+	[super loadView];
+
+	self.calculateButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+	self.calculateButton.autoresizesSubviews = YES;
+	self.calculateButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
+	self.calculateButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
+	self.calculateButton.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
+	self.calculateButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
+	self.calculateButton.frame = CGRectMake(193.0, 124.0, 107.0, 37.0);
+	self.calculateButton.tag = 5;
+	[self.calculateButton setTitle:@"Add!" forState:UIControlStateNormal];
+	[self.calculateButton addTarget:self
+		action:@selector(calculateButtonTouched)
+		forControlEvents:UIControlEventTouchUpInside];
+
+	UILabel *label11 = [[UILabel alloc] initWithFrame:CGRectMake(20.0, 124.0, 60.0, 37.0)];
+	label11.adjustsFontSizeToFitWidth = YES;
+	label11.autoresizesSubviews = YES;
+	label11.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
+	label11.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
+	label11.frame = CGRectMake(20.0, 124.0, 60.0, 37.0);
+	label11.tag = 6;
+	label11.text = @"Result:";
+
+	UILabel *label4 = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 34.0)];
+	label4.adjustsFontSizeToFitWidth = YES;
+	label4.autoresizesSubviews = YES;
+	label4.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin;
+	label4.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
+	label4.frame = CGRectMake(0.0, 0.0, 320.0, 34.0);
+	label4.tag = 2;
+	label4.text = @"Nimrod Crossplatform Calculator";
+	label4.textAlignment = UITextAlignmentCenter;
+
+	UIButton *background_button = [UIButton buttonWithType:UIButtonTypeCustom];
+	background_button.autoresizesSubviews = YES;
+	background_button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
+	background_button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
+	background_button.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
+	background_button.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
+	background_button.frame = CGRectMake(0.0, -10.0, 320.0, 480.0);
+	background_button.tag = 1;
+	[background_button addTarget:self action:@selector(backgroundTouched)
+		forControlEvents:UIControlEventTouchDown];
+
+	self.resultLabel = [[[UILabel alloc] initWithFrame:CGRectMake(88.0, 124.0, 97.0, 37.0)] autorelease];
+	self.resultLabel.adjustsFontSizeToFitWidth = YES;
+	self.resultLabel.autoresizesSubviews = YES;
+	self.resultLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
+	self.resultLabel.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
+	self.resultLabel.frame = CGRectMake(88.0, 124.0, 97.0, 37.0);
+	self.resultLabel.tag = 7;
+	self.resultLabel.text = @"";
+
+	self.aText = [[[UITextField alloc] initWithFrame:CGRectMake(193.0, 42.0, 107.0, 31.0)] autorelease];
+	self.aText.adjustsFontSizeToFitWidth = YES;
+	self.aText.autocapitalizationType = UITextAutocapitalizationTypeNone;
+	self.aText.autocorrectionType = UITextAutocorrectionTypeDefault;
+	self.aText.autoresizesSubviews = YES;
+	self.aText.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
+	self.aText.borderStyle = UITextBorderStyleRoundedRect;
+	self.aText.clearButtonMode = UITextFieldViewModeWhileEditing;
+	self.aText.clearsOnBeginEditing = NO;
+	self.aText.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
+	self.aText.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
+	self.aText.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
+	self.aText.enablesReturnKeyAutomatically = NO;
+	self.aText.frame = CGRectMake(193.0, 42.0, 107.0, 31.0);
+	self.aText.keyboardAppearance = UIKeyboardAppearanceDefault;
+	self.aText.keyboardType = UIKeyboardTypeNumberPad;
+	self.aText.placeholder = @"Integer";
+	self.aText.returnKeyType = UIReturnKeyDefault;
+	self.aText.tag = 8;
+	self.aText.text = @"";
+	self.aText.textAlignment = UITextAlignmentCenter;
+
+	UILabel *label7 = [[UILabel alloc] initWithFrame:CGRectMake(20.0, 42.0, 165.0, 31.0)];
+	label7.adjustsFontSizeToFitWidth = YES;
+	label7.autoresizesSubviews = YES;
+	label7.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
+	label7.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
+	label7.frame = CGRectMake(20.0, 42.0, 165.0, 31.0);
+	label7.tag = 3;
+	label7.text = @"Value A:";
+
+	UILabel *label8 = [[UILabel alloc] initWithFrame:CGRectMake(20.0, 81.0, 165.0, 31.0)];
+	label8.adjustsFontSizeToFitWidth = YES;
+	label8.autoresizesSubviews = YES;
+	label8.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
+	label8.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
+	label8.frame = CGRectMake(20.0, 81.0, 165.0, 31.0);
+	label8.tag = 4;
+	label8.text = @"Value B:";
+
+	self.bText = [[[UITextField alloc]
+		initWithFrame:CGRectMake(193.0, 81.0, 107.0, 31.0)] autorelease];
+	self.bText.adjustsFontSizeToFitWidth = YES;
+	self.bText.autocapitalizationType = UITextAutocapitalizationTypeNone;
+	self.bText.autocorrectionType = UITextAutocorrectionTypeDefault;
+	self.bText.autoresizesSubviews = YES;
+	self.bText.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
+	self.bText.borderStyle = UITextBorderStyleRoundedRect;
+	self.bText.clearButtonMode = UITextFieldViewModeWhileEditing;
+	self.bText.clearsOnBeginEditing = NO;
+	self.bText.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
+	self.bText.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
+	self.bText.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
+	self.bText.enablesReturnKeyAutomatically = NO;
+	self.bText.frame = CGRectMake(193.0, 81.0, 107.0, 31.0);
+	self.bText.keyboardAppearance = UIKeyboardAppearanceDefault;
+	self.bText.keyboardType = UIKeyboardTypeNumberPad;
+	self.bText.placeholder = @"Integer";
+	self.bText.returnKeyType = UIReturnKeyDefault;
+	self.bText.tag = 9;
+	self.bText.text = @"";
+	self.bText.textAlignment = UITextAlignmentCenter;
+
+	self.view.frame = CGRectMake(0.0, 20.0, 320.0, 460.0);
+	self.view.autoresizesSubviews = YES;
+	self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+	self.view.backgroundColor = [UIColor colorWithWhite:1.000 alpha:1.000];
+	self.view.contentStretch = CGRectFromString(@"{{0, 0}, {1, 1}}");
+	self.view.frame = CGRectMake(0.0, 20.0, 320.0, 460.0);
+	self.view.tag = 0;
+
+	[self.view addSubview:background_button];
+	[self.view addSubview:label4];
+	[self.view addSubview:label7];
+	[self.view addSubview:label8];
+	[self.view addSubview:self.calculateButton];
+	[self.view addSubview:label11];
+	[self.view addSubview:self.resultLabel];
+	[self.view addSubview:self.aText];
+	[self.view addSubview:self.bText];
+}
+
+@end
diff --git a/examples/cross_calculator/ios/src/cross-calculator-Prefix.pch b/examples/cross_calculator/ios/src/cross-calculator-Prefix.pch
new file mode 100644
index 000000000..2f331ed43
--- /dev/null
+++ b/examples/cross_calculator/ios/src/cross-calculator-Prefix.pch
@@ -0,0 +1,10 @@
+#import <Availability.h>
+
+#ifndef __IPHONE_3_0
+#warning "This project uses features only available in iOS SDK 3.0 and later."
+#endif
+
+#ifdef __OBJC__
+	#import <UIKit/UIKit.h>
+	#import <Foundation/Foundation.h>
+#endif
diff --git a/examples/cross_calculator/ios/src/main.m b/examples/cross_calculator/ios/src/main.m
new file mode 100644
index 000000000..7866684fe
--- /dev/null
+++ b/examples/cross_calculator/ios/src/main.m
@@ -0,0 +1,13 @@
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+#import "backend.h"
+
+int main(int argc, char *argv[])
+{
+	@autoreleasepool {
+		NimMain();
+		return UIApplicationMain(argc, argv, nil,
+			NSStringFromClass([AppDelegate class]));
+	}
+}