at kaneshin

Free space for me.

Xcode

UITapGestureRecognizer

// single tap UITapGestureRecognizer* singleTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTapGesture:)]; [self.view addGestureRecognizer:singleTapGesture]; // double tap UITapGestureRecognize…

NSDataの中身を見てみる

NSDataの中身をみたくなったときは下記を埋め込む // NSData *data const unsigned char *ptr = [data bytes]; unsigned char s[512]; for(int i = 0, n = [data length]; i < n; ++i) { unsigned char c = *ptr++; s[i] = c; NSLog(@"char=%c hex=%x", c, c…

Objective-Cで整数でなく小数でスリープ

意図的にスレッドスリープさせたいとき [NSThread sleepForTimeInterval:.3f]; sleep()は整数のみ

UIButtonがdisableで白くならない?

そんなときは [button setEnabled:NO]; [button.titleLabel setAlpha:.5f]; で無理矢理白っぽくする!

Can I get a selected row of cell on Segue?

テーブルのセルの選択したものを知りつつ、セグエを使うとき - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:IDENTIFIER]) { // Assume self.view is the table view NSIndexPath *index…

How to get the font size and name on Xcode?

if you wanna get it. Simply code like this NSString *fontName = self.label.font.fontName; CGFloat fontSize = self.label.font.pointSize;

iOS6のSocial.frameworkとTwitter.framework

iOS6からはSocial.framework推奨になって、Twitter.frameworkはiOS5用となりましたね。で、うまい具合にiOS5, iOS6で使い分けてみた。kaneshin/Social-framework-objc · GitHubもっと楽ないい方法ないかね

iOS Device の OS version を取得

iOSをCompatible対応するときに必要かなと思った NSString *currentDeviceOSVersion = [[UIDevice currentDevice] systemVersion]; NSLog(@"%@", currentDeviceOSVersion); これで、NSString型でOSのVersionがわかるので、あとはif文とかで if ([currentDevi…