Skip to content

Instantly share code, notes, and snippets.

@roothybrid7
roothybrid7 / file0.txt
Created March 12, 2014 11:29
Xcode 5.1にupdateした後に、使えなくなったxcode plug-inを再び使えるようにする方法 ref: http://qiita.com/roothybrid7/items/85bacb992a22aaad04cd
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist | xargs -IFILE defaults write FILE DVTPlugInCompatibilityUUIDs -array-add A2E4D43F-41F4-4FB9-BB94-7177011C9AED
@roothybrid7
roothybrid7 / MasterViewController.m
Created February 2, 2014 10:42
Segueを使ってUINavigationControllerの画面遷移アニメーションを変更する ref: http://qiita.com/roothybrid7/items/532b63175da30fa9a2b1
#import "MasterViewController.h"
#import "DetailViewController.h"
#import "MyNavigationController.h"
#import "NavigateFlipSegue.h"
@interface MasterViewController () <MyNavigationControllerDelegate> // 委譲用プロトコルの適用
- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath;
@end
@roothybrid7
roothybrid7 / new.m
Created February 2, 2014 04:28
Parse iOS SDKでPFObjectのサブクラスを登録し忘れないようにする ref: http://qiita.com/roothybrid7/items/2eff484f1a87f0776925
// Armor.h
@interface Armor : PFObject<PFSubclassing>
+ (NSString *)parseClassName;
@end
// Armor.m
// Import this header to let Armor know that PFObject privately provides most
// of the methods for PFSubclassing.
#import <Parse/PFObject+Subclass.h>
@roothybrid7
roothybrid7 / file0.txt
Created March 9, 2013 06:26
即時関数のスコープでハマったこと ref: http://qiita.com/items/f66d0e57f1d5f8ed847f
;(function(global, $, undefined) {
'use strict';
// globalはwindowだということを期待している
global.App = global.App || {};
var App = global.App;
// […]
}(this, jQuery));
@roothybrid7
roothybrid7 / apn.py
Created January 21, 2013 14:39
Parse.com REST APIを使ったAPN(remote notification)を試した ref: http://qiita.com/items/8fc283403dc9c77848f6
# coding: utf-8
PARSE_API_BASE = 'https://api.parse.com'
PARSE_PUSH_API = '/1/push'
PARSE_PUSH_URL = PARSE_API_BASE + PARSE_PUSH_API
# Push Notificationに必要なKeyをHTTP Headerで指定
HEADERS = {
"X-Parse-Application-Id": "<Application ID>",
"X-Parse-REST-API-Key": "<REST API Key>",
"X-Parse-Master-Key": "<Master Key>",
@roothybrid7
roothybrid7 / MyURLProtocol.h
Created January 20, 2013 13:44
iOSのUIWebViewでHTTPステータスをチェックする ref: http://qiita.com/items/6e1399cec9fbe865b132
#import <Foundation/Foundation.h>
@interface MyURLProtocol : NSURLProtocol
@end
@roothybrid7
roothybrid7 / vimdiff_cheet.md
Created November 3, 2012 07:36
vimdiff cheet sheets.

Vimdiff cheet sheets.

##Git mergetool.

$ git config --global merge.tool=vimdiff

##vimdiff key mappings.

@roothybrid7
roothybrid7 / UIViewController.md
Created October 20, 2012 01:29
UITableViewを使いたい場合、UITableViewControllerとUIViewControllerどっちを使うか

#UITableViewController vs UIViewController

__Storyboard__や__Interface builder__を使う場合の話

  • UITableViewControllerは、UIViewControllerのサブクラス
  • table viewの扱いに最適化され、追加機能もある

##具体例

__table cell__に__text field__があり、__text field__をタップした時にキーボードが立ち上がる。