Permalink
Browse files

Modernized to iOS 6.1 SDK.

Refactored to ARC, NSJSONSerialization that is built into the system,
and modern API.
  • Loading branch information...
xcvista committed Mar 7, 2013
1 parent 92ad9fc commit 62d4281b4578d8975e53a4a12e0b6ff4d08e2657
Showing with 479 additions and 279 deletions.
  1. +65 −50 ApplicationError.xib
  2. +1 −1 Classes/ApplicationErrorViewController.h
  3. +0 −5 Classes/ApplicationErrorViewController.m
  4. +5 −5 Classes/Commit.h
  5. +4 −11 Classes/Commit.m
  6. +0 −8 Classes/Config.m
  7. +6 −5 Classes/Connector.m
  8. +6 −6 Classes/LoginViewController.h
  9. +2 −10 Classes/LoginViewController.m
  10. +4 −4 Classes/Reachability.h
  11. +9 −12 Classes/Reachability.m
  12. +1 −1 Classes/RepoCommitsViewController.h
  13. +1 −5 Classes/RepoCommitsViewController.m
  14. +2 −2 Classes/RepositoriesViewController.h
  15. +4 −9 Classes/RepositoriesViewController.m
  16. +4 −4 Classes/Repository.h
  17. +8 −15 Classes/Repository.m
  18. +4 −7 Classes/RootViewController.m
  19. +2 −2 Classes/git_phoneAppDelegate.h
  20. +4 −8 Classes/git_phoneAppDelegate.m
  21. +3 −3 Info.plist
  22. +115 −92 Login.xib
  23. +15 −0 NSDictionary+JSON.h
  24. +21 −0 NSDictionary+JSON.m
  25. +15 −0 NSString+JSON.h
  26. +20 −0 NSString+JSON.m
  27. +29 −9 git-phone.xcodeproj/project.pbxproj
  28. +7 −0 git-phone.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  29. BIN ...phone.xcodeproj/project.xcworkspace/xcuserdata/technix.xcuserdatad/UserInterfaceState.xcuserstate
  30. +10 −0 git-phone.xcodeproj/project.xcworkspace/xcuserdata/technix.xcuserdatad/WorkspaceSettings.xcsettings
  31. +86 −0 git-phone.xcodeproj/xcuserdata/technix.xcuserdatad/xcschemes/GitHub GitPhone.xcscheme
  32. +22 −0 git-phone.xcodeproj/xcuserdata/technix.xcuserdatad/xcschemes/xcschememanagement.plist
  33. +0 −1 git_phone_Prefix.pch
  34. +4 −4 main.m
View
@@ -1,35 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.03">
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">528</int>
- <string key="IBDocument.SystemVersion">9G55</string>
- <string key="IBDocument.InterfaceBuilderVersion">677</string>
- <string key="IBDocument.AppKitVersion">949.43</string>
- <string key="IBDocument.HIToolboxVersion">353.00</string>
- <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <string key="IBDocument.SystemVersion">12C60</string>
+ <string key="IBDocument.InterfaceBuilderVersion">3084</string>
+ <string key="IBDocument.AppKitVersion">1187.34</string>
+ <string key="IBDocument.HIToolboxVersion">625.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">2083</string>
+ </object>
+ <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="33"/>
+ <string>IBProxyObject</string>
+ <string>IBUIImageView</string>
+ <string>IBUILabel</string>
+ <string>IBUITextView</string>
+ <string>IBUIView</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
- <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>
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<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"/>
@@ -45,6 +50,7 @@
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentMode">4</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">octocat_sad.png</string>
@@ -58,14 +64,24 @@
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Octocat is sad.</string>
<object class="NSColor" key="IBUITextColor" id="361346917">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
- <float key="IBUIMinimumFontSize">1.000000e+01</float>
+ <float key="IBUIMinimumFontSize">10</float>
+ <object class="IBUIFontDescription" key="IBUIFontDescription" id="955444507">
+ <int key="type">1</int>
+ <double key="pointSize">17</double>
+ </object>
+ <object class="NSFont" key="IBUIFont" id="57312039">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">17</double>
+ <int key="NSfFlags">16</int>
+ </object>
</object>
<object class="IBUITextView" id="667860017">
<reference key="NSNextResponder" ref="191373211"/>
@@ -79,6 +95,7 @@
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIBounces">NO</bool>
<bool key="IBUIScrollEnabled">NO</bool>
<bool key="IBUIShowsHorizontalScrollIndicator">NO</bool>
@@ -89,6 +106,11 @@
<string key="IBUIText">Error Message</string>
<reference key="IBUITextColor" ref="361346917"/>
<int key="IBUITextAlignment">1</int>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <reference key="IBUIFontDescription" ref="955444507"/>
+ <reference key="IBUIFont" ref="57312039"/>
</object>
</object>
<string key="NSFrameSize">{320, 480}</string>
@@ -99,6 +121,7 @@
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
@@ -136,7 +159,7 @@
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="360949347"/>
- <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
+ <string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
@@ -174,21 +197,23 @@
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMutableArray" key="dict.sortedKeys">
+ <object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
+ <string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
- <string>33.IBEditorWindowLastContentRect</string>
+ <string>-2.IBPluginDependency</string>
<string>33.IBPluginDependency</string>
<string>34.IBPluginDependency</string>
<string>35.IBPluginDependency</string>
<string>42.IBPluginDependency</string>
</object>
- <object class="NSMutableArray" key="dict.values">
+ <object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>ApplicationErrorViewController</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
- <string>{{284, 157}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -197,45 +222,35 @@
</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>
+ <reference key="dict.sortedKeys" ref="360949347"/>
+ <reference key="dict.values" ref="360949347"/>
</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>
+ <reference key="dict.sortedKeys" ref="360949347"/>
+ <reference key="dict.values" ref="360949347"/>
</object>
<nil key="sourceID"/>
<int key="maxID">43</int>
</object>
- <object class="IBClassDescriber" key="IBDocument.Classes">
- <object class="NSMutableArray" key="referencedPartialClassDescriptions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBPartialClassDescription">
- <string key="className">ApplicationErrorViewController</string>
- <string key="superclassName">UIViewController</string>
- <object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">errorMessageTextView</string>
- <string key="NS.object.0">UITextView</string>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">Classes/ApplicationErrorViewController.h</string>
- </object>
- </object>
- </object>
- </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
- <string key="IBDocument.LastKnownRelativeProjectPath">git-phone.xcodeproj</string>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
+ <integer value="528" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+ <string key="NS.key.0">octocat_sad.png</string>
+ <string key="NS.object.0">{264, 201}</string>
+ </object>
+ <string key="IBCocoaTouchPluginVersion">2083</string>
</data>
</archive>
@@ -11,7 +11,7 @@
UITextView *errorMessageTextView;
}
-@property (nonatomic, retain) IBOutlet UITextView *errorMessageTextView;
+@property (nonatomic, strong) IBOutlet UITextView *errorMessageTextView;
- (void) setErrorMessage:(NSString *)error;
@@ -24,10 +24,5 @@ - (void) setErrorMessage:(NSString *)error {
errorMessage = [error copy];
}
-- (void)dealloc {
- [errorMessage release];
- [errorMessageTextView release];
- [super dealloc];
-}
@end
View
@@ -40,11 +40,11 @@
NSString *authorEmail;
}
-@property (nonatomic, retain) NSString *commitID;
-@property (nonatomic, retain) NSString *message;
-@property (nonatomic, retain) NSString *url;
-@property (nonatomic, retain) NSString *authorName;
-@property (nonatomic, retain) NSString *authorEmail;
+@property (nonatomic, strong) NSString *commitID;
+@property (nonatomic, strong) NSString *message;
+@property (nonatomic, strong) NSString *url;
+@property (nonatomic, strong) NSString *authorName;
+@property (nonatomic, strong) NSString *authorEmail;
@end
View
@@ -7,6 +7,7 @@
//
#import "Commit.h"
+#import "NSString+JSON.h"
@implementation Commit
@@ -27,15 +28,15 @@ + (NSString *)indexURLwithRepository:(NSString *)repository {
//TODO: this needs to be thought out better. Maybe loaded on the repo.
+ (NSArray *)loadAllfromRepository:(NSString *)repository {
- NSMutableArray *commitsArray = [[[NSMutableArray alloc] init] autorelease];
+ NSMutableArray *commitsArray = [[NSMutableArray alloc] init];
NSString *resultJSON = [Connector postToURL:[self indexURLwithRepository:repository]];
- NSMutableArray *commits = [[[NSMutableArray alloc] init] autorelease];
+ NSMutableArray *commits = [[NSMutableArray alloc] init];
commits = [[resultJSON JSONValue] valueForKey:@"commits"];
for (NSDictionary *commit in commits) {
- Commit *tempCommit = [[[Commit alloc] init] autorelease];
+ Commit *tempCommit = [[Commit alloc] init];
[tempCommit setCommitID:[commit valueForKey:@"id"]];
[tempCommit setMessage:[commit valueForKey:@"message"]];
@@ -50,14 +51,6 @@ + (NSArray *)loadAllfromRepository:(NSString *)repository {
return commitsArray;
}
-- (void) dealloc {
- [commitID release];
- [message release];
- [url release];
- [authorName release];
- [authorEmail release];
- [super dealloc];
-}
@end
View
@@ -49,13 +49,5 @@ - (void)forgetCredentials {
}
-- (void) dealloc {
- [gitHubUserName release];
- [gitHubToken release];
- [baseURL release];
- [publicRepositories release];
- [privateRepositories release];
- [super dealloc];
-}
@end
View
@@ -10,6 +10,7 @@
// on the data.
#import "Connector.h"
+#import "NSDictionary+JSON.h"
@implementation Connector
@@ -56,7 +57,7 @@ + (NSString *) getJSONFromURL:(NSString *)url {
urlData = [NSURLConnection sendSynchronousRequest:req returningResponse:&response error:&error];
- NSString *str = [[[NSString alloc] initWithData:urlData encoding:NSUTF8StringEncoding] autorelease];
+ NSString *str = [[NSString alloc] initWithData:urlData encoding:NSUTF8StringEncoding];
DevLog3(@"Retrieved JSON from URL: %@ \n%@", url, str);
@@ -76,7 +77,7 @@ + (NSString *) getJSONFromURL:(NSString *)url withDictionary:(NSDictionary *)dic
urlData = [NSURLConnection sendSynchronousRequest:req returningResponse:&response error:&error];
- NSString *resp = [[[NSString alloc] initWithData:urlData encoding:NSUTF8StringEncoding] autorelease];
+ NSString *resp = [[NSString alloc] initWithData:urlData encoding:NSUTF8StringEncoding];
DevLog3(@"Received JSON from URL: %@\n%@", url, resp);
return resp;
@@ -90,7 +91,7 @@ + (NSString *)postToURL:(NSString *)url {
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
- NSMutableURLRequest *postRequest = [[[NSMutableURLRequest alloc] init] autorelease];
+ NSMutableURLRequest *postRequest = [[NSMutableURLRequest alloc] init];
[postRequest setURL:[NSURL URLWithString:url]];
[postRequest setHTTPMethod:@"POST"];
[postRequest setValue:postLength forHTTPHeaderField:@"Content-Length"];
@@ -105,7 +106,7 @@ + (NSString *)postToURL:(NSString *)url {
urlData = [NSURLConnection sendSynchronousRequest:postRequest returningResponse:&response error:&error];
- NSString *resp = [[[NSString alloc] initWithData:urlData encoding:NSUTF8StringEncoding] autorelease];
+ NSString *resp = [[NSString alloc] initWithData:urlData encoding:NSUTF8StringEncoding];
DevLog3(@"Received JSON from URL via POST: %@\n%@", url, resp);
@@ -118,7 +119,7 @@ + (BOOL)didAuthenticateUser:(NSString *)user withToken:(NSString *)token {
NSString *post = [NSString stringWithFormat:@"login=%@&token=%@", user, token];
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
- NSMutableURLRequest *postRequest = [[[NSMutableURLRequest alloc] init] autorelease];
+ NSMutableURLRequest *postRequest = [[NSMutableURLRequest alloc] init];
[postRequest setURL:[NSURL URLWithString:@"http://github.com"]];
[postRequest setHTTPMethod:@"POST"];
[postRequest setValue:postLength forHTTPHeaderField:@"Content-Length"];
@@ -13,15 +13,15 @@
IBOutlet UITextField *userName;
IBOutlet UITextField *apiToken;
IBOutlet UILabel *systemPrefs;
- IBOutlet UILabel *copyRight;
+ IBOutlet UILabel *makeRight;
IBOutlet UISwitch *rememberMe;
}
-@property(nonatomic, retain) UITextField *userName;
-@property(nonatomic, retain) UITextField *apiToken;
-@property(nonatomic, retain) UILabel *systemPrefs;
-@property(nonatomic, retain) UILabel *copyRight;
-@property(nonatomic, retain) UISwitch *rememberMe;
+@property(nonatomic, strong) UITextField *userName;
+@property(nonatomic, strong) UITextField *apiToken;
+@property(nonatomic, strong) UILabel *systemPrefs;
+@property(nonatomic, strong) UILabel *makeRight;
+@property(nonatomic, strong) UISwitch *rememberMe;
- (void)showAlert:(NSString *)message withTitle:(NSString *)title;
Oops, something went wrong.

0 comments on commit 62d4281

Please sign in to comment.