From bce84a5f4c90a46b211b2fb9bcc2a1002cc8b7ca Mon Sep 17 00:00:00 2001 From: Jason Agostoni Date: Sun, 22 Jan 2012 12:15:51 -0500 Subject: [PATCH] Create Repo --- .DS_Store | Bin 0 -> 6148 bytes .gitignore | 16 + BigBallOfMud/.DS_Store | Bin 0 -> 6148 bytes .../BigBallOfMud.xcodeproj/project.pbxproj | 288 +++++++++++++++ BigBallOfMud/BigBallOfMud/AppDelegate.h | 24 ++ BigBallOfMud/BigBallOfMud/AppDelegate.m | 67 ++++ .../BigBallOfMud/BigBallOfMud-Info.plist | 38 ++ .../BigBallOfMud/BigBallOfMud-Prefix.pch | 14 + BigBallOfMud/BigBallOfMud/SingletonSample.h | 32 ++ BigBallOfMud/BigBallOfMud/SingletonSample.m | 73 ++++ BigBallOfMud/BigBallOfMud/ViewController.h | 18 + BigBallOfMud/BigBallOfMud/ViewController.m | 79 ++++ .../BigBallOfMud/en.lproj/InfoPlist.strings | 2 + .../BigBallOfMud/en.lproj/ViewController.xib | 345 ++++++++++++++++++ BigBallOfMud/BigBallOfMud/main.m | 18 + 15 files changed, 1014 insertions(+) create mode 100644 .DS_Store create mode 100644 .gitignore create mode 100644 BigBallOfMud/.DS_Store create mode 100644 BigBallOfMud/BigBallOfMud.xcodeproj/project.pbxproj create mode 100644 BigBallOfMud/BigBallOfMud/AppDelegate.h create mode 100644 BigBallOfMud/BigBallOfMud/AppDelegate.m create mode 100644 BigBallOfMud/BigBallOfMud/BigBallOfMud-Info.plist create mode 100644 BigBallOfMud/BigBallOfMud/BigBallOfMud-Prefix.pch create mode 100644 BigBallOfMud/BigBallOfMud/SingletonSample.h create mode 100644 BigBallOfMud/BigBallOfMud/SingletonSample.m create mode 100644 BigBallOfMud/BigBallOfMud/ViewController.h create mode 100644 BigBallOfMud/BigBallOfMud/ViewController.m create mode 100644 BigBallOfMud/BigBallOfMud/en.lproj/InfoPlist.strings create mode 100644 BigBallOfMud/BigBallOfMud/en.lproj/ViewController.xib create mode 100644 BigBallOfMud/BigBallOfMud/main.m diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..aa57cadf30bbcdd5f4f285baedebda4789df651d GIT binary patch literal 6148 zcmeHK%}T>S5T3PFQ?1a8(BtB{NVJ7`@DM@;FQU*w4^}iGY6GDuO-c_n8hjyN!Kd(f zoY`HAtvQRxOxXEm=Vy2GL3XnMAiP<41keBg3mc&zqeRGE8rm?)0udXI;X{niB|N}I z$v}V6MQg8v2N67?{=WVhguy(W1aT5z&RZ~vqcpSa53y0HZfduXx;QJ9Tx8_mVy*mhd7ebUKW za^X03OLp2$p4Vztt?_Q{9~_>Z_x-2*`K8cY3R*tNo`$7n>w5T7=4}1(dUV!GY8XNuK)l5 literal 0 HcmV?d00001 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..64c8108 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +# Xcode +build/* +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +*.xcworkspace +!default.xcworkspace +xcuserdata +profile +*.moved-aside + diff --git a/BigBallOfMud/.DS_Store b/BigBallOfMud/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..aa57cadf30bbcdd5f4f285baedebda4789df651d GIT binary patch literal 6148 zcmeHK%}T>S5T3PFQ?1a8(BtB{NVJ7`@DM@;FQU*w4^}iGY6GDuO-c_n8hjyN!Kd(f zoY`HAtvQRxOxXEm=Vy2GL3XnMAiP<41keBg3mc&zqeRGE8rm?)0udXI;X{niB|N}I z$v}V6MQg8v2N67?{=WVhguy(W1aT5z&RZ~vqcpSa53y0HZfduXx;QJ9Tx8_mVy*mhd7ebUKW za^X03OLp2$p4Vztt?_Q{9~_>Z_x-2*`K8cY3R*tNo`$7n>w5T7=4}1(dUV!GY8XNuK)l5 literal 0 HcmV?d00001 diff --git a/BigBallOfMud/BigBallOfMud.xcodeproj/project.pbxproj b/BigBallOfMud/BigBallOfMud.xcodeproj/project.pbxproj new file mode 100644 index 0000000..db381c1 --- /dev/null +++ b/BigBallOfMud/BigBallOfMud.xcodeproj/project.pbxproj @@ -0,0 +1,288 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + F25A139B14CC4E3E00DE48A5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F25A139A14CC4E3E00DE48A5 /* UIKit.framework */; }; + F25A139D14CC4E3E00DE48A5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F25A139C14CC4E3E00DE48A5 /* Foundation.framework */; }; + F25A139F14CC4E3E00DE48A5 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F25A139E14CC4E3E00DE48A5 /* CoreGraphics.framework */; }; + F25A13A514CC4E3E00DE48A5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F25A13A314CC4E3E00DE48A5 /* InfoPlist.strings */; }; + F25A13A714CC4E3E00DE48A5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F25A13A614CC4E3E00DE48A5 /* main.m */; }; + F25A13AB14CC4E3E00DE48A5 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F25A13AA14CC4E3E00DE48A5 /* AppDelegate.m */; }; + F25A13AE14CC4E3E00DE48A5 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F25A13AD14CC4E3E00DE48A5 /* ViewController.m */; }; + F25A13B114CC4E3F00DE48A5 /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F25A13AF14CC4E3F00DE48A5 /* ViewController.xib */; }; + F25A13B914CC4ECD00DE48A5 /* SingletonSample.m in Sources */ = {isa = PBXBuildFile; fileRef = F25A13B814CC4ECD00DE48A5 /* SingletonSample.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + F25A139614CC4E3E00DE48A5 /* BigBallOfMud.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BigBallOfMud.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F25A139A14CC4E3E00DE48A5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + F25A139C14CC4E3E00DE48A5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + F25A139E14CC4E3E00DE48A5 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + F25A13A214CC4E3E00DE48A5 /* BigBallOfMud-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BigBallOfMud-Info.plist"; sourceTree = ""; }; + F25A13A414CC4E3E00DE48A5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + F25A13A614CC4E3E00DE48A5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + F25A13A814CC4E3E00DE48A5 /* BigBallOfMud-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BigBallOfMud-Prefix.pch"; sourceTree = ""; }; + F25A13A914CC4E3E00DE48A5 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + F25A13AA14CC4E3E00DE48A5 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + F25A13AC14CC4E3E00DE48A5 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + F25A13AD14CC4E3E00DE48A5 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + F25A13B014CC4E3F00DE48A5 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController.xib; sourceTree = ""; }; + F25A13B714CC4ECD00DE48A5 /* SingletonSample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SingletonSample.h; sourceTree = ""; }; + F25A13B814CC4ECD00DE48A5 /* SingletonSample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SingletonSample.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F25A139314CC4E3E00DE48A5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F25A139B14CC4E3E00DE48A5 /* UIKit.framework in Frameworks */, + F25A139D14CC4E3E00DE48A5 /* Foundation.framework in Frameworks */, + F25A139F14CC4E3E00DE48A5 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + F25A138B14CC4E3C00DE48A5 = { + isa = PBXGroup; + children = ( + F25A13A014CC4E3E00DE48A5 /* BigBallOfMud */, + F25A139914CC4E3E00DE48A5 /* Frameworks */, + F25A139714CC4E3E00DE48A5 /* Products */, + ); + sourceTree = ""; + }; + F25A139714CC4E3E00DE48A5 /* Products */ = { + isa = PBXGroup; + children = ( + F25A139614CC4E3E00DE48A5 /* BigBallOfMud.app */, + ); + name = Products; + sourceTree = ""; + }; + F25A139914CC4E3E00DE48A5 /* Frameworks */ = { + isa = PBXGroup; + children = ( + F25A139A14CC4E3E00DE48A5 /* UIKit.framework */, + F25A139C14CC4E3E00DE48A5 /* Foundation.framework */, + F25A139E14CC4E3E00DE48A5 /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + F25A13A014CC4E3E00DE48A5 /* BigBallOfMud */ = { + isa = PBXGroup; + children = ( + F25A13A914CC4E3E00DE48A5 /* AppDelegate.h */, + F25A13AA14CC4E3E00DE48A5 /* AppDelegate.m */, + F25A13AC14CC4E3E00DE48A5 /* ViewController.h */, + F25A13AD14CC4E3E00DE48A5 /* ViewController.m */, + F25A13AF14CC4E3F00DE48A5 /* ViewController.xib */, + F25A13A114CC4E3E00DE48A5 /* Supporting Files */, + F25A13B714CC4ECD00DE48A5 /* SingletonSample.h */, + F25A13B814CC4ECD00DE48A5 /* SingletonSample.m */, + ); + path = BigBallOfMud; + sourceTree = ""; + }; + F25A13A114CC4E3E00DE48A5 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + F25A13A214CC4E3E00DE48A5 /* BigBallOfMud-Info.plist */, + F25A13A314CC4E3E00DE48A5 /* InfoPlist.strings */, + F25A13A614CC4E3E00DE48A5 /* main.m */, + F25A13A814CC4E3E00DE48A5 /* BigBallOfMud-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + F25A139514CC4E3E00DE48A5 /* BigBallOfMud */ = { + isa = PBXNativeTarget; + buildConfigurationList = F25A13B414CC4E3F00DE48A5 /* Build configuration list for PBXNativeTarget "BigBallOfMud" */; + buildPhases = ( + F25A139214CC4E3E00DE48A5 /* Sources */, + F25A139314CC4E3E00DE48A5 /* Frameworks */, + F25A139414CC4E3E00DE48A5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BigBallOfMud; + productName = BigBallOfMud; + productReference = F25A139614CC4E3E00DE48A5 /* BigBallOfMud.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F25A138D14CC4E3C00DE48A5 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + ORGANIZATIONNAME = CEI; + }; + buildConfigurationList = F25A139014CC4E3C00DE48A5 /* Build configuration list for PBXProject "BigBallOfMud" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = F25A138B14CC4E3C00DE48A5; + productRefGroup = F25A139714CC4E3E00DE48A5 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + F25A139514CC4E3E00DE48A5 /* BigBallOfMud */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + F25A139414CC4E3E00DE48A5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F25A13A514CC4E3E00DE48A5 /* InfoPlist.strings in Resources */, + F25A13B114CC4E3F00DE48A5 /* ViewController.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + F25A139214CC4E3E00DE48A5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F25A13A714CC4E3E00DE48A5 /* main.m in Sources */, + F25A13AB14CC4E3E00DE48A5 /* AppDelegate.m in Sources */, + F25A13AE14CC4E3E00DE48A5 /* ViewController.m in Sources */, + F25A13B914CC4ECD00DE48A5 /* SingletonSample.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + F25A13A314CC4E3E00DE48A5 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + F25A13A414CC4E3E00DE48A5 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + F25A13AF14CC4E3F00DE48A5 /* ViewController.xib */ = { + isa = PBXVariantGroup; + children = ( + F25A13B014CC4E3F00DE48A5 /* en */, + ); + name = ViewController.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + F25A13B214CC4E3F00DE48A5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + "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 = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + SDKROOT = iphoneos; + }; + name = Debug; + }; + F25A13B314CC4E3F00DE48A5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + F25A13B514CC4E3F00DE48A5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BigBallOfMud/BigBallOfMud-Prefix.pch"; + INFOPLIST_FILE = "BigBallOfMud/BigBallOfMud-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + F25A13B614CC4E3F00DE48A5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "BigBallOfMud/BigBallOfMud-Prefix.pch"; + INFOPLIST_FILE = "BigBallOfMud/BigBallOfMud-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F25A139014CC4E3C00DE48A5 /* Build configuration list for PBXProject "BigBallOfMud" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F25A13B214CC4E3F00DE48A5 /* Debug */, + F25A13B314CC4E3F00DE48A5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F25A13B414CC4E3F00DE48A5 /* Build configuration list for PBXNativeTarget "BigBallOfMud" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F25A13B514CC4E3F00DE48A5 /* Debug */, + F25A13B614CC4E3F00DE48A5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = F25A138D14CC4E3C00DE48A5 /* Project object */; +} diff --git a/BigBallOfMud/BigBallOfMud/AppDelegate.h b/BigBallOfMud/BigBallOfMud/AppDelegate.h new file mode 100644 index 0000000..63045ae --- /dev/null +++ b/BigBallOfMud/BigBallOfMud/AppDelegate.h @@ -0,0 +1,24 @@ +// +// AppDelegate.h +// BigBallOfMud +// +// Created by Jason Agostoni on 1/22/12. +// + +#import + +@class ViewController; + +@interface AppDelegate : UIResponder { + // Old way: Instance storage on the app delegate + NSString* someData; +} + +// Old way: Instance property on the app delegate +@property(strong, nonatomic) NSString *someData; + +@property (strong, nonatomic) UIWindow *window; + +@property (strong, nonatomic) ViewController *viewController; + +@end diff --git a/BigBallOfMud/BigBallOfMud/AppDelegate.m b/BigBallOfMud/BigBallOfMud/AppDelegate.m new file mode 100644 index 0000000..cb233b5 --- /dev/null +++ b/BigBallOfMud/BigBallOfMud/AppDelegate.m @@ -0,0 +1,67 @@ +// +// AppDelegate.m +// BigBallOfMud +// +// Created by Jason Agostoni on 1/22/12. +// + +#import "AppDelegate.h" + +#import "ViewController.h" + +@implementation AppDelegate + +@synthesize window = _window; +@synthesize viewController = _viewController; +@synthesize someData; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + // Override point for customization after application launch. + self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; + self.window.rootViewController = self.viewController; + [self.window makeKeyAndVisible]; + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + /* + Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + */ +} + +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + /* + Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + */ +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + /* + Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + */ +} + +- (void)applicationDidBecomeActive:(UIApplication *)application +{ + /* + Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + */ +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + /* + Called when the application is about to terminate. + Save data if appropriate. + See also applicationDidEnterBackground:. + */ +} + +@end diff --git a/BigBallOfMud/BigBallOfMud/BigBallOfMud-Info.plist b/BigBallOfMud/BigBallOfMud/BigBallOfMud-Info.plist new file mode 100644 index 0000000..8879bd7 --- /dev/null +++ b/BigBallOfMud/BigBallOfMud/BigBallOfMud-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + com.jasonagostoni.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/BigBallOfMud/BigBallOfMud/BigBallOfMud-Prefix.pch b/BigBallOfMud/BigBallOfMud/BigBallOfMud-Prefix.pch new file mode 100644 index 0000000..afd5dbb --- /dev/null +++ b/BigBallOfMud/BigBallOfMud/BigBallOfMud-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'BigBallOfMud' target in the 'BigBallOfMud' project +// + +#import + +#ifndef __IPHONE_4_0 +#warning "This project uses features only available in iOS SDK 4.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/BigBallOfMud/BigBallOfMud/SingletonSample.h b/BigBallOfMud/BigBallOfMud/SingletonSample.h new file mode 100644 index 0000000..0f69435 --- /dev/null +++ b/BigBallOfMud/BigBallOfMud/SingletonSample.h @@ -0,0 +1,32 @@ +// +// SingletonSample.h +// BigBallOfMud +// +// Created by Jason Agostoni on 1/22/12. +// + +#import + +@interface SingletonSample : NSObject { + // Instance variables: + // - Declare as usual. The alloc/sharedIntance. + NSString *someData; +} + +// Properties as usual +@property (nonatomic, retain) NSString *someData; + + +// Required: A method to retrieve the shared instance ++(SingletonSample *) sharedInstance; + + +// Shared Public Methods: +// - Using static methods for opertations is a nice convenience +// - Each method should ensure it is using the above sharedInstance ++(NSString *) getSomeData; ++(void) setSomeData:(NSString *)someData; + + +// Instance Methods: Declare and implement as usual +@end diff --git a/BigBallOfMud/BigBallOfMud/SingletonSample.m b/BigBallOfMud/BigBallOfMud/SingletonSample.m new file mode 100644 index 0000000..7a31c11 --- /dev/null +++ b/BigBallOfMud/BigBallOfMud/SingletonSample.m @@ -0,0 +1,73 @@ +// +// SingletonSample.m +// BigBallOfMud +// +// Created by Jason Agostoni on 1/22/12. +// + +#import "SingletonSample.h" + + + +@implementation SingletonSample + +@synthesize someData; + +#pragma mark Singleton Implementation +static SingletonSample *sharedObject; ++ (SingletonSample*)sharedInstance +{ + if (sharedObject == nil) { + sharedObject = [[super allocWithZone:NULL] init]; + } + return sharedObject; +} + + + +/* Pre iOS 5 ARC - Implement for iOS 4 and earlier ++ (id)allocWithZone:(NSZone *)zone +{ + return [[self sharedInstance] retain]; +} + +- (id)copyWithZone:(NSZone *)zone +{ + return self; +} + +- (id)retain +{ + return self; +} + +- (NSUInteger)retainCount +{ + return NSUIntegerMax; //denotes an object that cannot be released +} + +- (void)release +{ + //do nothing +} + +- (id)autorelease +{ + return self; +} +*/ + + +#pragma mark Shared Public Methods ++(NSString *) getSomeData { + // Ensure we are using the shared instance + SingletonSample *shared = [SingletonSample sharedInstance]; + return shared.someData; +} + ++(void) setSomeData:(NSString *)someData { + // Ensure we are using the shared instance + SingletonSample *shared = [SingletonSample sharedInstance]; + shared.someData = someData; +} +@end diff --git a/BigBallOfMud/BigBallOfMud/ViewController.h b/BigBallOfMud/BigBallOfMud/ViewController.h new file mode 100644 index 0000000..e39edbf --- /dev/null +++ b/BigBallOfMud/BigBallOfMud/ViewController.h @@ -0,0 +1,18 @@ +// +// ViewController.h +// BigBallOfMud +// +// Created by Jason Agostoni on 1/22/12. +// + +#import + +@interface ViewController : UIViewController + +- (IBAction)oldWayTouched:(id)sender; +- (IBAction)singletonTouched:(id)sender; + +@property (weak, nonatomic) IBOutlet UILabel *oldWayLabel; +@property (weak, nonatomic) IBOutlet UILabel *singletonLabel; + +@end diff --git a/BigBallOfMud/BigBallOfMud/ViewController.m b/BigBallOfMud/BigBallOfMud/ViewController.m new file mode 100644 index 0000000..dd2499b --- /dev/null +++ b/BigBallOfMud/BigBallOfMud/ViewController.m @@ -0,0 +1,79 @@ +// +// ViewController.m +// BigBallOfMud +// +// Created by Jason Agostoni on 1/22/12. +// + +#import "ViewController.h" +#import "AppDelegate.h" // Required for "old way" +#import "SingletonSample.h" // Required for "singleton way" + +@implementation ViewController +@synthesize oldWayLabel; +@synthesize singletonLabel; + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Release any cached data, images, etc that aren't in use. +} + +#pragma mark - View lifecycle + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Just set some sample data ... + [SingletonSample setSomeData:@"Good Way!"]; + AppDelegate *app = [[UIApplication sharedApplication] delegate]; + app.someData = @"Bad Way :("; +} + +- (void)viewDidUnload +{ + [self setOldWayLabel:nil]; + [self setSingletonLabel:nil]; + [super viewDidUnload]; + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; +} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; +} + +- (void)viewDidAppear:(BOOL)animated +{ + [super viewDidAppear:animated]; +} + +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; +} + +- (void)viewDidDisappear:(BOOL)animated +{ + [super viewDidDisappear:animated]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + // Return YES for supported orientations + return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); +} + +#pragma mark Button Actions +- (IBAction)oldWayTouched:(id)sender { + // Need to get to the app delegate (which is a singleton, by the way) + AppDelegate *app = [[UIApplication sharedApplication] delegate]; + self.oldWayLabel.text = app.someData; +} + +- (IBAction)singletonTouched:(id)sender { + // Using the convenience method simplifies the code even more + self.singletonLabel.text = [SingletonSample getSomeData]; +} +@end diff --git a/BigBallOfMud/BigBallOfMud/en.lproj/InfoPlist.strings b/BigBallOfMud/BigBallOfMud/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/BigBallOfMud/BigBallOfMud/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/BigBallOfMud/BigBallOfMud/en.lproj/ViewController.xib b/BigBallOfMud/BigBallOfMud/en.lproj/ViewController.xib new file mode 100644 index 0000000..484a883 --- /dev/null +++ b/BigBallOfMud/BigBallOfMud/en.lproj/ViewController.xib @@ -0,0 +1,345 @@ + + + + 1280 + 10K549 + 1938 + 1038.36 + 461.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 933 + + + IBUIButton + IBUIView + IBUILabel + IBProxyObject + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 292 + {{5, 38}, {93, 37}} + + + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Old Way + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + + 292 + {{5, 83}, {93, 37}} + + + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Singleton + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + + + 292 + {{5, 9}, {98, 21}} + + + NO + YES + 7 + NO + IBCocoaTouchFramework + Singleton: + + 1 + MCAwIDAAA + + + 1 + 10 + + 1 + 17 + + + Helvetica + 17 + 16 + + + + + 292 + {{106, 46}, {124, 21}} + + + NO + YES + 7 + NO + IBCocoaTouchFramework + Click to execute + + + 1 + 10 + + + + + + 292 + {{106, 91}, {124, 21}} + + + NO + YES + 7 + NO + IBCocoaTouchFramework + Click to execute + + + 1 + 10 + + + + + {{0, 20}, {320, 460}} + + + + + 3 + MC43NQA + + 2 + + + NO + + IBCocoaTouchFramework + + + + + + + view + + + + 7 + + + + oldWayLabel + + + + 16 + + + + singletonLabel + + + + 17 + + + + oldWayTouched: + + + 1 + + 14 + + + + singletonTouched: + + + 1 + + 15 + + + + + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 6 + + + + + + + + + + + + 8 + + + + + 10 + + + + + 11 + + + + + 12 + + + + + 13 + + + + + + + ViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 17 + + + + + ViewController + UIViewController + + id + id + + + + oldWayTouched: + id + + + singletonTouched: + id + + + + UILabel + UILabel + + + + oldWayLabel + UILabel + + + singletonLabel + UILabel + + + + IBProjectSource + ./Classes/ViewController.h + + + + + 0 + IBCocoaTouchFramework + YES + 3 + 933 + + diff --git a/BigBallOfMud/BigBallOfMud/main.m b/BigBallOfMud/BigBallOfMud/main.m new file mode 100644 index 0000000..8cbde9d --- /dev/null +++ b/BigBallOfMud/BigBallOfMud/main.m @@ -0,0 +1,18 @@ +// +// main.m +// BigBallOfMud +// +// Created by Jason Agostoni on 1/22/12. +// Copyright (c) 2012 CEI. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +}