2013-07-01から1ヶ月間の記事一覧
UIEdgeInsets CSSにおける paddingみたいなもの. 元となる CGRect から paddingを適用した CGRect を生成することができる. UAModalPanelで使用されている. CGPointを考えなくてもいいところとサイズの計算を自分でしなくても良いところが便利. CGRect CGPoi…
Scroll Viewは2個のView Sizeを持っている. たまにその事実を忘れるというか,contentViewの存在を忘れるのでメモ. スクロールビューを窓と窓に表示される風景に例えて書くと... サイズその1. viewのSize: 窓のサイズ. scrollView.frameで指定する. サイズそ…
.pch ファイルで NSStringWithFormat を使うことができる. URLを指定するときに便利 #define BASE_URL @"http://localhost:3000/" // 各機能での接続先URL #define URL_SETTINGS [NSString stringWithFormat:@"%@%@", BASE_URL, @"v1/settings.json"] #defin…
コマンドは以下のとおり $ openssl md5 file.txt
AppDelegate.mで以下のように書けば. アプリ内のすべてのナビゲーションバーに適用される. // Design UIImage *navigationBarImage = [UIImage imageNamed:@"topbar"]; [[UINavigationBar appearance] setBackgroundImage:navigationBarImage forBarMetrics:…
deep copy するには copy methodを呼べばよい NSMutableArray *hoge = @[@1, @2, @3].mutableCopy; NSMutableArray *fuga = [[hoge copy] mutableCopy]; hoge[0] = @99; NSLog(@"hoge : %@", hoge); NSLog(@"fuga : %@", fuga); result 2013-07-04 03:26:25.…
BlocksKit を使うとデリゲート書かなくて済む. 読みやすい. アラート出すだけなのにデリゲート書く必要があるのはやっぱり大げさだなぁ. UIAlertView *al = [UIAlertView alertViewWithTitle:@"OK?"]; [al addButtonWithTitle:@"OK" handler:^{ [self.naviga…
Use NSTextAlignmentCenter instead.
テーブルビューのセルでよく使います NSLog(@"before : %@", [cell.contentView subviews]); for (UIView *view in [cell.contentView subviews]) { [view removeFromSuperview]; } NSLog(@"after : %@", [cell.contentView subviews]);
.pchファイル に書いておくと appをグローバルに使える #import <AppDelegate.h> // 共有オブジェクト #define app (AppDelegate *)[[UIApplication sharedApplication] delegate] #define SharedAppDelegate (AppDelegate *)[[UIApplication sharedApplication] delegate]</appdelegate.h>
AppDelegate.m の中で, こんな感じで書けば良い self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; _tabBarController = [UITabBarController new]; _homeViewController = [HomeViewController new]; _postViewController =…