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
int main() { | |
for( int i=1; i<=100; i++) | |
{ | |
if(i%3==0) | |
printf("Fizz"); | |
if(i%5==0) | |
printf("Buzz"); | |
if(i%3!=0 && i%5!=0) | |
printf("%d",i); |
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
for (id img in searchBar.subviews) { | |
if ([img isKindOfClass:NSClassFromString(@"UISearchBarBackground")]) { | |
[img removeFromSuperview]; | |
} | |
} | |
[searchBar setSearchFieldBackgroundImage:[UIImage imageNamed:@"UI_searchbar.png"] forState:UIControlStateNormal]; | |
searchView.backgroundColor = [UIColor clearColor]; | |
for (UIView *subview in [[searchBar.subviews objectAtIndex:0] subviews]) { | |
subview.alpha = 0.0; | |
subview.backgroundColor = [UIColor clearColor]; |
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
UIImage *tabBackground = [[UIImage imageNamed:@"tab_bg"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; | |
[[UITabBar appearance] setBackgroundImage:tabBackground]; |
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
UIImage *backgroundImage = [UIImage imageNamed:@"UI_navbar.png"]; | |
[[UINavigationBar appearance] setBackgroundImage:backgroundImage | |
forBarMetrics:UIBarMetricsDefault]; | |
UIImage *backButton = [[UIImage imageNamed:@"UI_backbutton.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0,0,0,0)]; | |
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButton forState:UIControlStateNormal | |
barMetrics:UIBarMetricsDefault]; | |
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButton forState:UIControlStateHighlighted | |
barMetrics:UIBarMetricsDefault]; | |
[[UINavigationBar appearance] setTitleTextAttributes: | |
[NSDictionary dictionaryWithObjectsAndKeys: |
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
OTHER_CFLAGS = -DDEBUG=1 | |
#define MARK CMLog(@"%s", __PRETTY_FUNCTION__); | |
#define CMLog(format, ...) NSLog(@"%s:%@", __PRETTY_FUNCTION__,[NSString stringWithFormat:format, ## __VA_ARGS__]); | |
CMLog(@"My iPhone is an %@, v %@", [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion]); | |
#define START_TIMER NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate]; | |
#define END_TIMER(msg) NSTimeInterval stop = [NSDate timeIntervalSinceReferenceDate]; CMLog([NSString stringWithFormat:@"%@ Time = %f", msg, stop-start]); | |
#if DEBUG==1 |
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
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; | |
[dateFormatter setLocale:[NSLocale currentLocale]]; | |
[dateFormatter setTimeStyle:NSDateFormatterNoStyle]; | |
[dateFormatter setDateStyle:NSDateFormatterShortStyle]; |
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
NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease]; | |
[numberFormatter setNumberStyle: NSNumberFormatterCurrencyStyle]; |
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
-(IBAction)buttonPress:(id)sender | |
{ | |
NSString *keyPath = @"anchorPoint.x"; | |
CAKeyframeAnimation *kfa = [CAKeyframeAnimation animationWithKeyPath:keyPath]; | |
[kfa setValues:[NSArray arrayWithObjects: | |
[NSNumber numberWithFloat:-.05], | |
[NSNumber numberWithFloat:.1], | |
[NSNumber numberWithFloat:-.1], | |
[NSNumber numberWithFloat:.1], | |
[NSNumber numberWithFloat:-.05], |
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
#import <UIKit/UIKit.h> | |
@interface UITableViewCellEnterText : UITableViewCell<UITextFieldDelegate>{ | |
UITextField *textField; | |
} | |
@property (nonatomic, retain) NSMutableDictionary *Value; | |
@property (nonatomic, readonly) NSString *StringValue; | |
@property (nonatomic, retain) UITextField *textField; |
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
@interface UIColor (myColors) | |
+ (UIColor *)questListTableViewColor; | |
+ (UIColor *)defaultBackground; | |
+ (UIColor *)defaultBackgroundColor; | |
@end | |
@implementation UIColor (myColors) | |
+ (UIColor *)questListTableViewColor | |
{ |