Browse files

Fix api POST bug with newer versions of ASIHTTPRequest

  • Loading branch information...
1 parent 5591a36 commit 2241450036e39877b674c76a12865f97f36ed707 @dmpatierno dmpatierno committed Nov 23, 2011
View
1 .gitignore
@@ -5,3 +5,4 @@ iFixit.xcodeproj/project.xcworkspace
iFixit.xcodeproj/xcuserdata
.svn
.gitignore
+*.bak
View
8 Classes/GuideIntroView~ipad.xib
@@ -140,7 +140,7 @@
<object class="IBUIImageView" id="284432824">
<reference key="NSNextResponder" ref="766721923"/>
<int key="NSvFlags">-2147483356</int>
- <string key="NSFrame">{{68, 40}, {329, 71}}</string>
+ <string key="NSFrame">{{38, 40}, {329, 71}}</string>
<reference key="NSSuperview" ref="766721923"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="860367058"/>
@@ -149,7 +149,7 @@
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
- <string key="NSResourceName">logo_make.png</string>
+ <string key="NSResourceName">make_logo_transparent.png</string>
</object>
</object>
</object>
@@ -441,12 +441,12 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>logo_ifixit.png</string>
- <string>logo_make.png</string>
+ <string>make_logo_transparent.png</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>{327, 113}</string>
- <string>{329, 71}</string>
+ <string>{455, 97}</string>
</object>
</object>
<string key="IBCocoaTouchPluginVersion">933</string>
View
7 Classes/GuideViewController.m
@@ -62,12 +62,7 @@ - (void)viewDidLoad {
self.view.backgroundColor = bgColor;
- if ([[Config currentConfig].backgroundColor isEqual:[UIColor whiteColor]] && [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
- navBar.tintColor = nil;
- }
- else {
- navBar.tintColor = [Config currentConfig].toolbarColor;
- }
+ navBar.tintColor = [Config currentConfig].toolbarColor;
if (self.guide) {
[self gotGuide:self.guide];
View
16 Classes/iFixitAPI.m
@@ -69,7 +69,7 @@ + (iFixitAPI *)sharedInstance {
- (void)getSitesWithLimit:(NSUInteger)limit andOffset:(NSUInteger)offset forObject:(id)object withSelector:(SEL)selector {
NSString *url = [NSString stringWithFormat:@"http://%@/api/0.1/sites?limit=%d&offset=%d", [Config host], limit, offset];
- __block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:url]];
+ __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]];
[request setCompletionBlock:^{
NSArray *results = [[request responseString] JSONValue];
[object performSelector:selector withObject:results];
@@ -83,7 +83,7 @@ - (void)getSitesWithLimit:(NSUInteger)limit andOffset:(NSUInteger)offset forObje
- (void)getCollectionsWithLimit:(NSUInteger)limit andOffset:(NSUInteger)offset forObject:(id)object withSelector:(SEL)selector {
NSString *url = [NSString stringWithFormat:@"http://%@/api/0.1/collections?limit=%d&offset=%d", [Config host], limit, offset];
- __block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:url]];
+ __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]];
[request setCompletionBlock:^{
NSArray *results = [[request responseString] JSONValue];
[object performSelector:selector withObject:results];
@@ -97,7 +97,7 @@ - (void)getCollectionsWithLimit:(NSUInteger)limit andOffset:(NSUInteger)offset f
- (void)getGuide:(NSInteger)guideid forObject:(id)object withSelector:(SEL)selector {
NSString *url = [NSString stringWithFormat:@"http://%@/api/0.1/guide/%d", [Config host], guideid];
- __block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:url]];
+ __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]];
[request setCompletionBlock:^{
NSDictionary *result = [[request responseString] JSONValue];
Guide *guide = result ? [Guide guideWithDictionary:result] : nil;
@@ -120,7 +120,7 @@ - (void)getAreas:(NSString *)parent forObject:(id)object withSelector:(SEL)selec
NSString *url = [NSString stringWithFormat:@"http://%@/api/0.1/areas/%@%@", [Config host], parent, requireGuides];
- __block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:url]];
+ __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]];
[request setCompletionBlock:^{
NSDictionary *results = [[request responseString] JSONValue];
[object performSelector:selector withObject:results];
@@ -135,7 +135,7 @@ - (void)getDevice:(NSString *)device forObject:(id)object withSelector:(SEL)sele
device = [device stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSString *url = [NSString stringWithFormat:@"http://%@/api/0.1/device/%@", [Config host], device];
- __block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:url]];
+ __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]];
[request setCompletionBlock:^{
NSDictionary *results = [[request responseString] JSONValue];
[object performSelector:selector withObject:results];
@@ -151,7 +151,7 @@ - (void)getGuides:(NSString *)type forObject:(id)object withSelector:(SEL)select
NSString *url = [NSString stringWithFormat:@"http://%@/api/0.1/guides/%@?limit=%d", [Config host], type, limit];
- __block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:url]];
+ __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]];
[request setCompletionBlock:^{
NSArray *results = [[request responseString] JSONValue];
[object performSelector:selector withObject:results];
@@ -166,7 +166,7 @@ - (void)getGuidesByIds:(NSArray *)guideids forObject:(id)object withSelector:(SE
NSString *guideidsString = [guideids componentsJoinedByString:@","];
NSString *url = [NSString stringWithFormat:@"http://%@/api/0.1/guides?guideids=%@", [Config host], guideidsString];
- __block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:url]];
+ __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]];
[request setCompletionBlock:^{
NSArray *results = [[request responseString] JSONValue];
[object performSelector:selector withObject:results];
@@ -184,7 +184,7 @@ - (void)getSearchResults:(NSString *)search forObject:(id)object withSelector:(S
NSString *url = [NSString stringWithFormat:@"http://%@/api/0.1/search/%@?filter=device&limit=50", [Config host], search];
- __block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:url]];
+ __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]];
[request setCompletionBlock:^{
NSDictionary *results = [[request responseString] JSONValue];
[object performSelector:selector withObject:results];
View
BIN Graphics/make_logo_transparent.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
12 dozuki.sh
@@ -2,15 +2,21 @@
if [ "$1" == "off" ]; then
echo "iFixit"
- cp /Users/dmpatierno/Code/iOS/iFixit/Graphics/Sites/iFixit/*png /Users/dmpatierno/Code/iOS/iFixit/
+ cp Graphics/Sites/iFixit/*png .
sed -i '.bak' -e 's/com.ifixit.dozuki/com.ifixit.ifixit/g' iFixit-Info.plist
sed -i '.bak' -e 's/Dozuki/iFixit/g' iFixit-Info.plist
+ sed -i '.bak' -e 's/>dozuki</>ifixit</g' iFixit-Info.plist
+ sed -i '.bak' -e 's/\[Config currentConfig\].dozuki = YES;/\[Config currentConfig\].dozuki = NO;/' Classes/iFixitAppDelegate.m
elif [ "$1" == "make" ]; then
echo "Make"
- cp /Users/dmpatierno/Code/iOS/iFixit/Graphics/Sites/Make/*png /Users/dmpatierno/Code/iOS/iFixit/
+ cp Graphics/Sites/Make/*png .
+# Need to manually fix up iFixit-Info.plist
+ sed -i '.bak' -e 's/\[Config currentConfig\].dozuki = YES;/\[Config currentConfig\].dozuki = NO;/' Classes/iFixitAppDelegate.m
else
echo "Dozuki"
- cp /Users/dmpatierno/Code/iOS/iFixit/Graphics/Sites/Dozuki/*png /Users/dmpatierno/Code/iOS/iFixit/
+ cp Graphics/Sites/Dozuki/*png .
sed -i '.bak' -e 's/com.ifixit.ifixit/com.ifixit.dozuki/g' iFixit-Info.plist
sed -i '.bak' -e 's/iFixit/Dozuki/g' iFixit-Info.plist
+ sed -i '.bak' -e 's/>ifixit</>dozuki</g' iFixit-Info.plist
+ sed -i '.bak' -e 's/\[Config currentConfig\].dozuki = NO;/\[Config currentConfig\].dozuki = YES;/' Classes/iFixitAppDelegate.m
fi
View
69 iFixit-Info.plist.bak
@@ -1,69 +0,0 @@
-<?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>English</string>
- <key>CFBundleDisplayName</key>
- <string>Dozuki</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFiles</key>
- <array>
- <string>icon57.png</string>
- <string>icon72.png</string>
- <string>icon114.png</string>
- <string>icon512.png</string>
- </array>
- <key>CFBundleIdentifier</key>
- <string>com.ifixit.ifixit</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>26</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleURLTypes</key>
- <array>
- <dict>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- <key>CFBundleURLName</key>
- <string>com.ifixit.ifixit</string>
- <key>CFBundleURLSchemes</key>
- <array>
- <string>dozuki</string>
- </array>
- </dict>
- </array>
- <key>CFBundleVersion</key>
- <string>1.2</string>
- <key>LSRequiresIPhoneOS</key>
- <true/>
- <key>NSMainNibFile</key>
- <string>MainWindow</string>
- <key>UIAppFonts</key>
- <array>
- <string>Lobster.ttf</string>
- <string>Ubuntu-Italic.ttf</string>
- <string>Ubuntu-BoldItalic.ttf</string>
- </array>
- <key>UIInterfaceOrientation</key>
- <string>UIInterfaceOrientationPortrait</string>
- <key>UIPrerenderedIcon</key>
- <true/>
- <key>UIStatusBarStyle</key>
- <string>UIStatusBarStyleBlackOpaque</string>
- <key>UISupportedInterfaceOrientations</key>
- <array>
- <string>UIInterfaceOrientationPortrait</string>
- <string>UIInterfaceOrientationLandscapeRight</string>
- <string>UIInterfaceOrientationLandscapeLeft</string>
- <string>UIInterfaceOrientationPortraitUpsideDown</string>
- </array>
-</dict>
-</plist>

0 comments on commit 2241450

Please sign in to comment.