u16suzuの blog

日々学んだことのメモブログです。

2013-04-22から1日間の記事一覧

透明なモーダルビューを自作する

こんな感じ。MyViewControllerは表示したいものを指定。windowに addSubviewする。 MyViewController *vc = [[MyViewController alloc]init]; AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate; [delegate.window addSub…

ブロック変数を定義する

NSString* (^test)(NSString*, NSString*) = ^(NSString* head, NSString* tail){ return [NSString stringWithFormat:@"%@%@", head, tail]; }; NSLog(@"%@", test(@"hoge", @"fuga"));

Sending 'void' to parameter of incompatible type 'void (^)()'

Sending 'void' to parameter of incompatible type 'void (^)()'引数を取らないブロックをとるメソッドに対して、引数を持つブロックを引数として与えたら発生した。

Ruby のArrayの要素を入れたり取り出したりするメソッドについて

This is memorandum about Ruby's Array class' instance methods. Take some notes for my understand. I still haven' store them.Manipulate to tail push: add to tail pop: remove from tail Manipulate to head unshift: add to head shift: remove fr…