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
| // During startup (-viewDidLoad or in storyboard) do: | |
| self.tableView.allowsMultipleSelectionDuringEditing = NO; | |
| // Override to support conditional editing of the table view. | |
| // This only needs to be implemented if you are going to be returning NO | |
| // for some items. By default, all items are editable. | |
| - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { | |
| // Return YES if you want the specified item to be editable. | |
| return YES; |
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
| -(BOOL) IsValidPhoneNumber:(NSString*) phoneNumber | |
| { | |
| //NSString *phoneRegex = @"[235689][0-9]{6}([0-9]{3})?"; | |
| NSString *phoneRegex = @"^((\\+)|(00))[0-9]{6,14}$"; | |
| NSPredicate *test = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", phoneRegex]; | |
| return [test evaluateWithObject:phoneNumber]; | |
| } | |
| - (BOOL) NSStringIsValidEmail:(NSString *)checkString | |
| { |
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
| /*************************************************************************** | |
| UIView+Toast.h | |
| Toast | |
| Copyright (c) 2014 Charles Scalesse. | |
| Permission is hereby granted, free of charge, to any person obtaining a | |
| copy of this software and associated documentation files (the | |
| "Software"), to deal in the Software without restriction, including |
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
| - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController { | |
| return viewController != self.tabBarController.selectedViewController; | |
| } |
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
| //Setting Obejct Using NSUserDefaults | |
| NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; | |
| [defaults setValue:@"successfull" forKey:@"loggedIn"]; | |
| [defaults synchronize]; //use this method only if you cannot wait for the automatic synchronization | |
| //Getting Object using NSUserDefaults | |
| NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; | |
| NSLog(@"loggedIn is %@",[defaults objectForKey:@"loggedIn"]); | |
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
| https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/SubmittingYourApp/SubmittingYourApp.html |
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
| // | |
| // HelloWorldScene.m | |
| // animation | |
| // | |
| // Created by Muhammad Adnan on 28/04/2014. | |
| // Copyright Vizteck Solutions 2014. All rights reserved. | |
| // | |
| // ----------------------------------------------------------------------- | |
| #import "HelloWorldScene.h" |
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
| Install latest cocos version (currently v3.0 dmg file is installable) |
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
| If you want to exclude a file from being compiled with ARC you can do so by setting a flag on the .m file: | |
| Click the Project -> Build Phases Tab -> Compile Sources Section -> Double Click on the file name | |
| Then add -fno-objc-arc to the popup window. | |
| Likewise, if you want to include a file in ARC, you can use the -fobjc-arc flag. |
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
| /* | |
| * System Versioning Preprocessor Macros | |
| */ | |
| #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) |