Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
vickeryj committed Jan 28, 2009
2 parents 56998e3 + ca21595 commit b18e4a9
Show file tree
Hide file tree
Showing 54 changed files with 1,900 additions and 216 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
@@ -1,3 +1,3 @@
[submodule "Classes/lib/objective_support"]
path = Classes/lib/objective_support
url = git@github.com:yfactorial/objectivesupport.git
url = git://github.com/yfactorial/objectivesupport.git
4 changes: 3 additions & 1 deletion Classes/AddDogViewController.h
Expand Up @@ -8,13 +8,15 @@

#import <UIKit/UIKit.h>


@class Dog;
@interface AddDogViewController : UIViewController <UITextFieldDelegate> {

IBOutlet UITextField *textField;
Dog *newDog;

}

@property (nonatomic, retain) UITextField *textField;
@property (nonatomic, retain) Dog *newDog;

@end
9 changes: 5 additions & 4 deletions Classes/AddDogViewController.m
Expand Up @@ -11,7 +11,7 @@

@implementation AddDogViewController

@synthesize textField;
@synthesize textField , newDog;

#pragma mark UIViewController methods
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
Expand All @@ -27,17 +27,18 @@ - (void)viewDidAppear:(BOOL)animated {

#pragma mark UITextFieldDelegate methods
- (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
Dog *newDog = [[Dog alloc] init];
newDog.name = textField.text;

// explicitly create a new dog on the server
[newDog create];
[newDog release];
[self.navigationController popViewControllerAnimated:YES];
[self.navigationController popViewControllerAnimated:YES];
return YES;
}

#pragma mark cleanup

- (void)dealloc {
[newDog release];
[textField release];
[super dealloc];
}
Expand Down
251 changes: 251 additions & 0 deletions Classes/AddPersonView.xib
@@ -0,0 +1,251 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.02">
<data>
<int key="IBDocument.SystemTarget">528</int>
<string key="IBDocument.SystemVersion">9F33</string>
<string key="IBDocument.InterfaceBuilderVersion">672</string>
<string key="IBDocument.AppKitVersion">949.34</string>
<string key="IBDocument.HIToolboxVersion">352.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
</object>
<object class="IBProxyObject" id="711762367">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUITextField" id="373479532">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 90}, {280, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string type="base64-UTF8" key="IBUIPlaceholder">T3duZXIncyBOYW1lA</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace" id="283719763">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIClearsOnBeginEditing">YES</bool>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">1.700000e+01</float>
<object class="IBUITextInputTraits" key="IBUITextInputTraits"/>
</object>
</object>
<string key="NSFrameSize">{320, 480}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<reference key="NSCustomColorSpace" ref="283719763"/>
</object>
</object>
<object class="IBUINavigationItem" id="468716156">
<string key="IBUITitle">Add Person</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">5</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="373479532"/>
<reference key="destination" ref="372490531"/>
</object>
<int key="connectionID">6</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">aTextField</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="373479532"/>
</object>
<int key="connectionID">7</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">navigationItem</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="468716156"/>
</object>
<int key="connectionID">9</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<object class="NSArray" key="object" id="360949347">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="373479532"/>
</object>
<reference key="parent" ref="360949347"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="360949347"/>
<string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="711762367"/>
<reference key="parent" ref="360949347"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="373479532"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="468716156"/>
<reference key="parent" ref="360949347"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>1.IBEditorWindowLastContentRect</string>
<string>1.IBPluginDependency</string>
<string>3.IBPluginDependency</string>
<string>8.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>AddPersonViewController</string>
<string>UIResponder</string>
<string>{{1525, 182}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">9</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">AddPersonViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">aTextField</string>
<string key="NS.object.0">UITextField</string>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/AddPersonViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/lib/NSObject+JSONSerializableSupport.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/lib/NSObject+PropertySupport.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/lib/NSObject+Serialize.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/lib/NSObject+XMLSerializableSupport.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/lib/json-framework/NSObject+SBJSON.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">google_toolbar/UnitTesting/GTMSenTestCase.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.LastKnownRelativeProjectPath">../objective_resource.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>
23 changes: 23 additions & 0 deletions Classes/AddPersonViewController.h
@@ -0,0 +1,23 @@
//
// AddPersonViewController.h
// objective_resource
//
// Created by James Burka on 1/27/09.
// Copyright 2009 Burkaprojects. All rights reserved.
//

#import <UIKit/UIKit.h>

@class Person;
@interface AddPersonViewController : UIViewController <UITextFieldDelegate> {

IBOutlet UITextField *aTextField;
Person *person;
UITableViewController *delegate;

}

@property (nonatomic,retain) Person *person;
@property (nonatomic,retain) UITableViewController *delegate;

@end
47 changes: 47 additions & 0 deletions Classes/AddPersonViewController.m
@@ -0,0 +1,47 @@
//
// AddPersonViewController.m
// objective_resource
//
// Created by James Burka on 1/27/09.
// Copyright 2009 Burkaprojects. All rights reserved.
//

#import "AddPersonViewController.h"
#import "Person.h"




@implementation AddPersonViewController
@synthesize person , delegate;

- (void)viewWillAppear:(BOOL)animated {
if(person.personId) {
self.title = [NSString stringWithFormat:@"Edit %@",person.name,nil];
}
else {
self.title = @"Add Person";
}
aTextField.returnKeyType = UIReturnKeyDone;
[aTextField becomeFirstResponder];
[super viewWillAppear:animated];
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
person.name = textField.text;
// If the model is new then create will be called otherwise the model will be updated
[person save];
[delegate.tableView reloadData];
[self.navigationController popViewControllerAnimated:YES];
return YES;
}



- (void)dealloc {
[super dealloc];
}


@end
2 changes: 2 additions & 0 deletions Classes/Dog.h
Expand Up @@ -12,6 +12,7 @@

NSString *name;
NSString *dogId;
NSString *personId;
NSDate * updatedAt;
NSDate * createdAt;

Expand All @@ -21,4 +22,5 @@
@property (nonatomic , retain) NSDate * updatedAt;
@property (nonatomic , retain) NSString *dogId;
@property (nonatomic , retain) NSString *name;
@property (nonatomic , retain) NSString *personId;
@end

0 comments on commit b18e4a9

Please sign in to comment.