This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Imports System.Web | |
| Imports System.Web.UI | |
| Imports System.Web.UI.WebControls | |
| Imports System.Web.UI.HtmlControls | |
| Imports System.IO | |
| Imports System.Data | |
| Imports Newtonsoft.Json | |
| Namespace UploadFile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://cocoawithlove.com/2009/10/ugly-side-of-blocks-explicit.html has a nice breakdown of the syntax--it helps to think of the ^ as similar to a pointer dereference symbol * | |
| // block typedef: | |
| typedef void(^Block)(); | |
| typedef void(^ConditionalBlock)(BOOL); | |
| typedef NSString*(^BlockThatReturnsString)(); | |
| typedef NSString*(^ConditionalBlockThatReturnsString)(BOOL); | |
| // block property with typedef: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import "UIDevice+Identifier.h" | |
| - (NSString *) identifierForVendor1 | |
| { | |
| if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)]) { | |
| return [[[UIDevice currentDevice] identifierForVendor] UUIDString]; | |
| } | |
| return @""; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) | |
| #define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) | |
| #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) | |
| #define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) | |
| #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSURLRequest * urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://fireoneone.com"]]; | |
| NSURLResponse * response = nil; | |
| NSError * error = nil; | |
| NSData * data = [NSURLConnection sendSynchronousRequest:urlRequest | |
| returningResponse:&response | |
| error:&error]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)logInWithUsername:(NSString *)username password:(NSString *)password | |
| { | |
| NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://fireoneone.com/dummy_login.php"]]; | |
| request = [ASIFormDataRequest requestWithURL:url]; | |
| [request setRequestMethod:@"POST"]; | |
| [request setPostValue:usernameInput forKey:@"username"]; | |
| [request setPostValue:passwordOutput forKey:@"password"]; | |
| [request setDelegate:self]; | |
| [request startAsynchronous]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSDictionary *params = @{@"username": usernameInput, | |
| @"password": passwordOutput, | |
| @"uuid": deviceID, | |
| @"device_name": [[UIDevice currentDevice] name], | |
| @"version": [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]}; | |
| NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/authentication_revised.php",host]]; | |
| request = [ASIFormDataRequest requestWithURL:url]; | |
| [request setRequestMethod:@"POST"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Initialize Array | |
| NSMutableArray *dumbArray = [NSMutableArray new]; | |
| // Basically addObject | |
| [dumbArray addObject:@"A"]; | |
| [dumbArray addObject:@"B"]; | |
| [dumbArray addObject:@"C"]; | |
| [dumbArray addObject:@"D"]; | |
| // Insert Object at the top array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| YourProject-Info.plist | |
| View controller-based status bar appearance => NO (BOOLEAN) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
| }); |