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 <Foundation/Foundation.h> | |
@interface XMLReader : NSObject <NSXMLParserDelegate> | |
{ | |
NSMutableArray *dictionaryStack; | |
NSMutableString *textInProgress; | |
NSError *errorPointer; | |
} | |
+ (NSDictionary *)dictionaryForPath:(NSString *)path error:(NSError *)errorPointer; |
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
NSString *dateString = [dic objectForKey:@"2013-04-30T11:30:00+09:00"]; | |
NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; | |
[formatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ssZZZZ"]; | |
NSDate* date = [formatter dateFromString:dateString]; |
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
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.yahoo.co.jp/"]]; |
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
// 変更後のイメージ | |
UIImage *img = [UIImage imageNamed:@"hoge"]; | |
// 変更後のイメージを設定するボタン | |
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; | |
// イメージを設定 | |
[button setImage:img forState:UIControlStateNormal]; | |
// ボタンにターゲットを設定 |
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)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
UIRefreshControl *refreshControl = [[UIRefreshControl alloc]init]; | |
// 更新アクションを設定 | |
[refreshControl addTarget:self action:@selector(onRefresh:) forControlEvents:UIControlEventValueChanged]; | |
// UITableViewControllerにUIRefreshControlを設定 |
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
NSString *path = [[NSBundle mainBundle] pathForResource:@"config" ofType:@"plist"]; | |
NSDictionary *propDictionary = [NSDictionary dictionaryWithContentsOfFile:path]; | |
NSArray *array = [NSArray arrayWithArray:[propDictionary objectForKey:@"key"]]; |
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 "UIImageView+WebCache.h" | |
- (void)viewDidLoad | |
{ | |
NSURL url = [NSURL URLWithString:@"http://hogehoge.com/hoge.png"]; | |
[imageView setImageWithURL:url placeholderImage:nil options:SDWebImageCacheMemoryOnly]; | |
} |
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)drawTextInRect:(CGRect)rect | |
{ | |
// top, left, bottom, right | |
UIEdgeInsets insets = {0, 20, 0, 20}; | |
return [super drawTextInRect:UIEdgeInsetsInsetRect(rect, insets)]; | |
} |
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)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
cell.backgroundColor = UIColor colorWithHue:0.61 saturation:0.09 brightness:0.99 alpha:1.0]; | |
} |
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
UIApplication *application = [UIApplication sharedApplication]; | |
// アクティブになったときに通知されるように登録する | |
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(hoge) name:UIApplicationDidBecomeActiveNotification object:application]; |
OlderNewer