This file contains 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
NSString* systemVersion = [[UIDevice currentDevice] systemVersion]; | |
BOOL isLessThaniOS4 = ([systemVersion compare:@"4.0" options:NSNumericSearch] == NSOrderedAscending); | |
BOOL isGreaterThaniOS4 = ([systemVersion compare:@"4.0" options:NSNumericSearch] == NSOrderedDescending); | |
BOOL isLessThaniOS5 = ([systemVersion compare:@"5.0" options:NSNumericSearch] == NSOrderedAscending); | |
BOOL isGreaterThaniOS5 = ([systemVersion compare:@"5.0" options:NSNumericSearch] == NSOrderedDescending); | |
if (isLessThaniOS4 && isLessThaniOS5) | |
{ | |
//NSLog(@"isLessThaniOS4 && isLessThaniOS5 = %@",whatever); | |
} |
This file contains 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
# ANDROID / ECLIPSE | |
# built application files | |
*.apk | |
*.ap_ | |
# files for the dex VM | |
*.dex | |
# Java class files |
This file contains 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
# Ignore everything in this directory | |
* | |
# Except this file | |
!.gitignore |
This file contains 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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
*{margin:0;padding:0;} | |
body { | |
font:13.34px helvetica,arial,freesans,clean,sans-serif; | |
color:black; | |
line-height:1.4em; | |
background-color: #F8F8F8; |
This file contains 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
+ (NSString*) resolveImageResource:(NSString*)resource | |
{ | |
NSString* systemVersion = [[UIDevice currentDevice] systemVersion]; | |
BOOL isLessThaniOS4 = ([systemVersion compare:@"4.0" options:NSNumericSearch] == NSOrderedAscending); | |
// the iPad image (nor retina) differentiation code was not in 3.x, and we have to explicitly set the path | |
if (isLessThaniOS4) | |
{ | |
return [NSString stringWithFormat:@"%@.png", resource]; |
This file contains 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)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; | |
{ | |
NSURL *requestURL =[ [ request URL ] retain ]; | |
if ( ( [ [ requestURL scheme ] isEqualToString: @"http" ] || [ [ requestURL scheme ] isEqualToString: @"https" ] || [ [ requestURL scheme ] isEqualToString: @"mailto" ]) | |
&& ( /*navigationType == UIWebViewNavigationTypeLinkClicked ||*/ navigationType == UIWebViewNavigationTypeOther ) ) { | |
return ![ [ UIApplication sharedApplication ] openURL: [ requestURL autorelease ] ]; | |
} | |
[ requestURL release ]; | |
return YES; | |
} |
This file contains 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 IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) | |
/* | |
if (IS_IPAD) {} | |
else | |
if (!IS_IPAD) {} | |
else {} | |
*/ |
This file contains 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) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation | |
{ | |
// Return YES for supported orientations | |
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight){ | |
return YES; | |
} | |
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft){ | |
return YES; |
This file contains 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)applicationDidReceiveMemoryWarning:(UIApplication *)application { | |
//NSLog(@"RECIEVED MEM WARNING WHY?"); | |
[self report_memory]; | |
[[NSURLCache sharedURLCache] removeAllCachedResponses]; | |
} | |
-(void) report_memory { | |
//#import "mach/mach.h" ///Add to headers |
This file contains 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 IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) | |
if ([[UIApplication sharedApplication] statusBarOrientation] < 3) {//portrait | |
if (IS_IPAD) { | |
} else { | |
OlderNewer