diff options
| author | mo khan <mo@mokhan.ca> | 2013-05-14 18:37:30 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2013-05-14 18:37:30 -0600 |
| commit | aab3efb23854c80ee230bb8e3d3e957c3d05cc7f (patch) | |
| tree | 0f5d2fd095f17b45ae4fef96d939820685694d91 | |
| parent | a6def661856bc8f0c0a51519fc50a37a3cbf5bf3 (diff) | |
finish the first ui example
11 files changed, 278 insertions, 19 deletions
diff --git a/2013-05-07/People/People.xcodeproj/project.xcworkspace/xcuserdata/mo.xcuserdatad/UserInterfaceState.xcuserstate b/2013-05-07/People/People.xcodeproj/project.xcworkspace/xcuserdata/mo.xcuserdatad/UserInterfaceState.xcuserstate Binary files differindex df374bf..06fbe4c 100644 --- a/2013-05-07/People/People.xcodeproj/project.xcworkspace/xcuserdata/mo.xcuserdatad/UserInterfaceState.xcuserstate +++ b/2013-05-07/People/People.xcodeproj/project.xcworkspace/xcuserdata/mo.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/2013-05-09/My First UI/My First UI.xcodeproj/project.pbxproj b/2013-05-09/My First UI/My First UI.xcodeproj/project.pbxproj index df8b15c..408be3c 100644 --- a/2013-05-09/My First UI/My First UI.xcodeproj/project.pbxproj +++ b/2013-05-09/My First UI/My First UI.xcodeproj/project.pbxproj @@ -17,7 +17,8 @@ CDDEBBED173C949100412299 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CDDEBBEC173C949100412299 /* Default@2x.png */; }; CDDEBBEF173C949100412299 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CDDEBBEE173C949100412299 /* Default-568h@2x.png */; }; CDDEBBF2173C949100412299 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CDDEBBF1173C949100412299 /* ViewController.m */; }; - CDDEBBF5173C949100412299 /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CDDEBBF3173C949100412299 /* ViewController.xib */; }; + CDDEBBF5173C949100412299 /* View.xib in Resources */ = {isa = PBXBuildFile; fileRef = CDDEBBF3173C949100412299 /* View.xib */; }; + CDDEBBFD173C972900412299 /* Data.m in Sources */ = {isa = PBXBuildFile; fileRef = CDDEBBFC173C972900412299 /* Data.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -36,7 +37,9 @@ CDDEBBEE173C949100412299 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; }; CDDEBBF0173C949100412299 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; }; CDDEBBF1173C949100412299 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; }; - CDDEBBF4173C949100412299 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController.xib; sourceTree = "<group>"; }; + CDDEBBF4173C949100412299 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/View.xib; sourceTree = "<group>"; }; + CDDEBBFB173C972900412299 /* Data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Data.h; sourceTree = "<group>"; }; + CDDEBBFC173C972900412299 /* Data.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Data.m; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -87,7 +90,9 @@ CDDEBBE8173C949100412299 /* AppDelegate.m */, CDDEBBF0173C949100412299 /* ViewController.h */, CDDEBBF1173C949100412299 /* ViewController.m */, - CDDEBBF3173C949100412299 /* ViewController.xib */, + CDDEBBF3173C949100412299 /* View.xib */, + CDDEBBFB173C972900412299 /* Data.h */, + CDDEBBFC173C972900412299 /* Data.m */, CDDEBBDF173C949100412299 /* Supporting Files */, ); path = "My First UI"; @@ -162,7 +167,7 @@ CDDEBBEB173C949100412299 /* Default.png in Resources */, CDDEBBED173C949100412299 /* Default@2x.png in Resources */, CDDEBBEF173C949100412299 /* Default-568h@2x.png in Resources */, - CDDEBBF5173C949100412299 /* ViewController.xib in Resources */, + CDDEBBF5173C949100412299 /* View.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -176,6 +181,7 @@ CDDEBBE5173C949100412299 /* main.m in Sources */, CDDEBBE9173C949100412299 /* AppDelegate.m in Sources */, CDDEBBF2173C949100412299 /* ViewController.m in Sources */, + CDDEBBFD173C972900412299 /* Data.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -190,12 +196,12 @@ name = InfoPlist.strings; sourceTree = "<group>"; }; - CDDEBBF3173C949100412299 /* ViewController.xib */ = { + CDDEBBF3173C949100412299 /* View.xib */ = { isa = PBXVariantGroup; children = ( CDDEBBF4173C949100412299 /* en */, ); - name = ViewController.xib; + name = View.xib; sourceTree = "<group>"; }; /* End PBXVariantGroup section */ diff --git a/2013-05-09/My First UI/My First UI.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/2013-05-09/My First UI/My First UI.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6e85e11 --- /dev/null +++ b/2013-05-09/My First UI/My First UI.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Workspace + version = "1.0"> + <FileRef + location = "self:My First UI.xcodeproj"> + </FileRef> +</Workspace> diff --git a/2013-05-09/My First UI/My First UI.xcodeproj/project.xcworkspace/xcuserdata/mo.xcuserdatad/UserInterfaceState.xcuserstate b/2013-05-09/My First UI/My First UI.xcodeproj/project.xcworkspace/xcuserdata/mo.xcuserdatad/UserInterfaceState.xcuserstate Binary files differnew file mode 100644 index 0000000..c0135a4 --- /dev/null +++ b/2013-05-09/My First UI/My First UI.xcodeproj/project.xcworkspace/xcuserdata/mo.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/2013-05-09/My First UI/My First UI.xcodeproj/xcuserdata/mo.xcuserdatad/xcschemes/My First UI.xcscheme b/2013-05-09/My First UI/My First UI.xcodeproj/xcuserdata/mo.xcuserdatad/xcschemes/My First UI.xcscheme new file mode 100644 index 0000000..b33528c --- /dev/null +++ b/2013-05-09/My First UI/My First UI.xcodeproj/xcuserdata/mo.xcuserdatad/xcschemes/My First UI.xcscheme @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "0460" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "CDDEBBD4173C949100412299" + BuildableName = "My First UI.app" + BlueprintName = "My First UI" + ReferencedContainer = "container:My First UI.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> + <Testables> + </Testables> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "CDDEBBD4173C949100412299" + BuildableName = "My First UI.app" + BlueprintName = "My First UI" + ReferencedContainer = "container:My First UI.xcodeproj"> + </BuildableReference> + </MacroExpansion> + </TestAction> + <LaunchAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Debug" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + allowLocationSimulation = "YES"> + <BuildableProductRunnable> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "CDDEBBD4173C949100412299" + BuildableName = "My First UI.app" + BlueprintName = "My First UI" + ReferencedContainer = "container:My First UI.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Release" + debugDocumentVersioning = "YES"> + <BuildableProductRunnable> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "CDDEBBD4173C949100412299" + BuildableName = "My First UI.app" + BlueprintName = "My First UI" + ReferencedContainer = "container:My First UI.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/2013-05-09/My First UI/My First UI.xcodeproj/xcuserdata/mo.xcuserdatad/xcschemes/xcschememanagement.plist b/2013-05-09/My First UI/My First UI.xcodeproj/xcuserdata/mo.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..cef1a3f --- /dev/null +++ b/2013-05-09/My First UI/My First UI.xcodeproj/xcuserdata/mo.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ +<?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>SchemeUserState</key> + <dict> + <key>My First UI.xcscheme</key> + <dict> + <key>orderHint</key> + <integer>0</integer> + </dict> + </dict> + <key>SuppressBuildableAutocreation</key> + <dict> + <key>CDDEBBD4173C949100412299</key> + <dict> + <key>primary</key> + <true/> + </dict> + </dict> +</dict> +</plist> diff --git a/2013-05-09/My First UI/My First UI/AppDelegate.m b/2013-05-09/My First UI/My First UI/AppDelegate.m index c6c70eb..86c3ab5 100644 --- a/2013-05-09/My First UI/My First UI/AppDelegate.m +++ b/2013-05-09/My First UI/My First UI/AppDelegate.m @@ -16,7 +16,7 @@ { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. - self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; + self.viewController = [[ViewController alloc] initWithNibName:@"View" bundle:nil]; self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; return YES; diff --git a/2013-05-09/My First UI/My First UI/Data.h b/2013-05-09/My First UI/My First UI/Data.h index 1e367d6..ba573a2 100644 --- a/2013-05-09/My First UI/My First UI/Data.h +++ b/2013-05-09/My First UI/My First UI/Data.h @@ -10,4 +10,6 @@ @interface Data : NSObject +@property (strong, nonatomic) NSString * strData; +@property int clickCount; @end diff --git a/2013-05-09/My First UI/My First UI/ViewController.h b/2013-05-09/My First UI/My First UI/ViewController.h index 6184c51..75ba05b 100644 --- a/2013-05-09/My First UI/My First UI/ViewController.h +++ b/2013-05-09/My First UI/My First UI/ViewController.h @@ -7,7 +7,10 @@ // #import <UIKit/UIKit.h> +#import "Data.h" @interface ViewController : UIViewController - +@property (weak, nonatomic) IBOutlet UILabel *firstLabel; +@property (strong, nonatomic) Data * myData; +- (IBAction)firstButton:(id)sender; @end diff --git a/2013-05-09/My First UI/My First UI/ViewController.m b/2013-05-09/My First UI/My First UI/ViewController.m index ebad6ab..06ce0b6 100644 --- a/2013-05-09/My First UI/My First UI/ViewController.m +++ b/2013-05-09/My First UI/My First UI/ViewController.m @@ -17,7 +17,10 @@ - (void)viewDidLoad { [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. + self.myData = [[Data alloc] init]; + self.myData.strData = @"Button has been clicked"; + self.myData.clickCount = 0; + self.firstLabel.text = @""; } - (void)didReceiveMemoryWarning @@ -26,4 +29,8 @@ // Dispose of any resources that can be recreated. } +- (IBAction)firstButton:(id)sender { + self.myData.clickCount++; + self.firstLabel.text = [[self.myData.strData stringByAppendingFormat:@"%d", self.myData.clickCount] stringByAppendingFormat:@" times"]; +} @end diff --git a/2013-05-09/My First UI/My First UI/en.lproj/View.xib b/2013-05-09/My First UI/My First UI/en.lproj/View.xib index 18825b5..3f1cd8a 100644 --- a/2013-05-09/My First UI/My First UI/en.lproj/View.xib +++ b/2013-05-09/My First UI/My First UI/en.lproj/View.xib @@ -1,17 +1,19 @@ <?xml version="1.0" encoding="UTF-8"?> <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00"> <data> - <int key="IBDocument.SystemTarget">1536</int> - <string key="IBDocument.SystemVersion">12A269</string> - <string key="IBDocument.InterfaceBuilderVersion">2835</string> - <string key="IBDocument.AppKitVersion">1187</string> - <string key="IBDocument.HIToolboxVersion">624.00</string> + <int key="IBDocument.SystemTarget">1552</int> + <string key="IBDocument.SystemVersion">12D78</string> + <string key="IBDocument.InterfaceBuilderVersion">3084</string> + <string key="IBDocument.AppKitVersion">1187.37</string> + <string key="IBDocument.HIToolboxVersion">626.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> - <string key="NS.object.0">1919</string> + <string key="NS.object.0">2083</string> </object> <array key="IBDocument.IntegratedClassDependencies"> <string>IBProxyObject</string> + <string>IBUIButton</string> + <string>IBUILabel</string> <string>IBUIView</string> </array> <array key="IBDocument.PluginDependencies"> @@ -33,10 +35,79 @@ <object class="IBUIView" id="774585933"> <reference key="NSNextResponder"/> <int key="NSvFlags">274</int> + <array class="NSMutableArray" key="NSSubviews"> + <object class="IBUILabel" id="589356169"> + <reference key="NSNextResponder" ref="774585933"/> + <int key="NSvFlags">292</int> + <string key="NSFrame">{{64, 20}, {194, 21}}</string> + <reference key="NSSuperview" ref="774585933"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView" ref="608531724"/> + <string key="NSReuseIdentifierKey">_NS:9</string> + <bool key="IBUIOpaque">NO</bool> + <bool key="IBUIClipsSubviews">YES</bool> + <int key="IBUIContentMode">7</int> + <bool key="IBUIUserInteractionEnabled">NO</bool> + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> + <string key="IBUIText">My First Label</string> + <object class="NSColor" key="IBUITextColor"> + <int key="NSColorSpace">1</int> + <bytes key="NSRGB">MCAwIDAAA</bytes> + <string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string> + </object> + <nil key="IBUIHighlightedColor"/> + <int key="IBUIBaselineAdjustment">0</int> + <object class="IBUIFontDescription" key="IBUIFontDescription"> + <int key="type">1</int> + <double key="pointSize">17</double> + </object> + <object class="NSFont" key="IBUIFont"> + <string key="NSName">Helvetica</string> + <double key="NSSize">17</double> + <int key="NSfFlags">16</int> + </object> + <bool key="IBUIAdjustsFontSizeToFit">NO</bool> + </object> + <object class="IBUIButton" id="608531724"> + <reference key="NSNextResponder" ref="774585933"/> + <int key="NSvFlags">292</int> + <string key="NSFrame">{{94, 136}, {134, 44}}</string> + <reference key="NSSuperview" ref="774585933"/> + <reference key="NSWindow"/> + <string key="NSReuseIdentifierKey">_NS:9</string> + <bool key="IBUIOpaque">NO</bool> + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> + <int key="IBUIContentHorizontalAlignment">0</int> + <int key="IBUIContentVerticalAlignment">0</int> + <int key="IBUIButtonType">1</int> + <string key="IBUINormalTitle">My First Button</string> + <object class="NSColor" key="IBUIHighlightedTitleColor"> + <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"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MC41AA</bytes> + </object> + <object class="IBUIFontDescription" key="IBUIFontDescription"> + <int key="type">2</int> + <double key="pointSize">15</double> + </object> + <object class="NSFont" key="IBUIFont"> + <string key="NSName">Helvetica-Bold</string> + <double key="NSSize">15</double> + <int key="NSfFlags">16</int> + </object> + </object> + </array> <string key="NSFrame">{{0, 20}, {320, 548}}</string> <reference key="NSSuperview"/> <reference key="NSWindow"/> - <reference key="NSNextKeyView"/> + <reference key="NSNextKeyView" ref="589356169"/> <object class="NSColor" key="IBUIBackgroundColor"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MC43NQA</bytes> @@ -76,6 +147,23 @@ </object> <int key="connectionID">7</int> </object> + <object class="IBConnectionRecord"> + <object class="IBCocoaTouchOutletConnection" key="connection"> + <string key="label">firstLabel</string> + <reference key="source" ref="372490531"/> + <reference key="destination" ref="589356169"/> + </object> + <int key="connectionID">17</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBCocoaTouchEventConnection" key="connection"> + <string key="label">firstButton:</string> + <reference key="source" ref="608531724"/> + <reference key="destination" ref="372490531"/> + <int key="IBEventType">7</int> + </object> + <int key="connectionID">18</int> + </object> </array> <object class="IBMutableOrderedSet" key="objectRecords"> <array key="orderedObjects"> @@ -99,8 +187,23 @@ <object class="IBObjectRecord"> <int key="objectID">6</int> <reference key="object" ref="774585933"/> + <array class="NSMutableArray" key="children"> + <reference ref="589356169"/> + <reference ref="608531724"/> + </array> <reference key="parent" ref="0"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">8</int> + <reference key="object" ref="589356169"/> + <array class="NSMutableArray" key="children"/> + <reference key="parent" ref="774585933"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">14</int> + <reference key="object" ref="608531724"/> + <reference key="parent" ref="774585933"/> + </object> </array> </object> <dictionary class="NSMutableDictionary" key="flattenedProperties"> @@ -108,19 +211,43 @@ <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="14.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string key="6.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">7</int> + <int key="maxID">18</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <array class="NSMutableArray" key="referencedPartialClassDescriptions"> <object class="IBPartialClassDescription"> <string key="className">ViewController</string> <string key="superclassName">UIViewController</string> + <object class="NSMutableDictionary" key="actions"> + <string key="NS.key.0">firstButton:</string> + <string key="NS.object.0">id</string> + </object> + <object class="NSMutableDictionary" key="actionInfosByName"> + <string key="NS.key.0">firstButton:</string> + <object class="IBActionInfo" key="NS.object.0"> + <string key="name">firstButton:</string> + <string key="candidateClassName">id</string> + </object> + </object> + <object class="NSMutableDictionary" key="outlets"> + <string key="NS.key.0">firstLabel</string> + <string key="NS.object.0">UILabel</string> + </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <string key="NS.key.0">firstLabel</string> + <object class="IBToOneOutletInfo" key="NS.object.0"> + <string key="name">firstLabel</string> + <string key="candidateClassName">UILabel</string> + </object> + </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">./Classes/ViewController.h</string> @@ -132,7 +259,6 @@ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string> <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> <int key="IBDocument.defaultPropertyAccessControl">3</int> - <bool key="IBDocument.UseAutolayout">YES</bool> - <string key="IBCocoaTouchPluginVersion">1919</string> + <string key="IBCocoaTouchPluginVersion">2083</string> </data> </archive> |
