- Singleton
- Abstract Factory - |NSWindow| (Theme, Style)
- Builder - WebKit Document Representation
- Prototype - |NSCollectionViewItem|, Cell
- FactoryMethod - |NSDocument|, ClassCluster
- Adapter - Delegate, CocoaBinding
- Bridge - |NSImageRep|, Wrapper
- Composite - View Hierarchy, Tree
- Decorator - |NSBox|, |NSScrollView|
- Facade - |NSTextView|
Cocoa(iOS)はMVVC(Model-View-ViewController)パターンである。by me, 2011
ここで述べるターゲットはiOS5, Lion以降, ARC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// 空の配列を用意 | |
self.items = [NSArray array]; | |
[self getJSON]; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# python drive.py "origin" ["waypoint" ... ] "destination" | |
# | |
# i.e. python drive.py "Union Square, San Francisco" "Ferry Building, San Francisco" 'Bay Bridge' SFO | |
import sys, json, urllib2, md5, os.path, pprint | |
from math import radians, sin, cos, atan2, pow, sqrt | |
from urllib import quote_plus | |
from xml.sax.saxutils import escape | |
from optparse import OptionParser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Twitter/Twitter.h> | |
#import <Social/Social.h> | |
// TWTweetComposeViewControllerの場合 (for iOS5) | |
- (IBAction)tweet:(id)sender | |
{ | |
if ([TWTweetComposeViewController canSendTweet]) { | |
// ツイート用の画面をを表示する | |
TWTweetComposeViewController* composeViewController = [[TWTweetComposeViewController alloc] init]; | |
[composeViewController setInitialText:@"Hello World!"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 私が考える安全なプログラムを書くために必要なこと | |
今も昔も「入力によって挙動が大幅に変わるAPI」が世の中には多数存在していて、プログラマが本来意図した挙動と異なる動作を引き起こしている。 | |
- ファイルを開こうとしたらコマンドを実行できてしまったり | |
- CSSセレクタを書いてるつもりがHTMLタグを生成してしまったり | |
- SELECT文を発行するつもりがDELETE文を発行できてしまったり | |
こういったときに | |
- 入力値検証をしないと危険になる |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import "AppDelegate.h" | |
int main(int argc, char * argv[]) | |
{ | |
@autoreleasepool { | |
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"UIDisableLegacyTextView"]; | |
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); |
http://www.zusaar.com/event/3667003
- Blocksの循環参照
- weakSelfパターンはアンチパターンだと思ってる
- その場限りのBlocks
- $.each(function(){}) てきなやつ
- 一度きりのblocks
- blocksへの参照をnilを代入して断ち切る
- 最後にweakSelfパターン
- 発表者:
- 日時:
- 2014.02.23
- 場所:
- ソースコード
- hedjirog/ForceDirectedLayoutDemo
OlderNewer