Skip to content

Instantly share code, notes, and snippets.

@nakiwo
nakiwo / gist:3179598
Created July 26, 2012 00:46
Xcode4.4 iOS SDKで @yES,@no,array[...],dictionary[...]を使う
// Xcode4.4
// llvm4の機能のうち一部が、
// iOS 5.1 SDK で使えない
// 例
NSNumber *b = @YES; // error
NSArray *array = @[ @1, @2, @3 ];
NSNumber *n = array[1]; // error
@nakiwo
nakiwo / gist:3174351
Created July 25, 2012 04:15
subviewだけtouchできるview
@interface TestView : UIView
@end
@implementation TestView
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
UIView *view = [super hitTest:point withEvent:event];
if(view == self) {
return nil;
@nakiwo
nakiwo / gist:3063673
Created July 7, 2012 01:04
自分でviewをunloadする
- (void)didReceiveMemoryWarning
{
if([self isViewLoaded] && self.view.window == nil) {
// viewWillUnloadでやっていた処理を書く
self.view = nil;
// viewDidUnloadでやっていた処理を書く
}
[super didReceiveMemoryWarning];
}