2012-03-01から1ヶ月間の記事一覧
容量が少なくなってきたため、仮想メモリが作られる場所を、任意のパス(ボリューム)に変更する。 環境:Mac OS X 10.7.3以下、管理者権限にて ・作業ディレクトリ移動 # cd /System/Library/LaunchDaemons ・バックアップ # cp com.apple.dynamic_pager.pl…
for F in *.txt;do mv $F new_$F;done convert(ImageMagickのフォーマット変更コマンド)に流用すると for F in *.jpg;do convert -channel Red -separate $F new_$F;done
viewDidLoad()あたたりで、 AppDelegate appd = (〇〇AppDelegate *)[[UIApplication sharedApplication] delegate];
NASをTime Machineに使えるようターミナルで下記実行 $ defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1 マウントしたNASの中に、ディスクイメージを作成する。以下を参考 参考 http://www.sky-s.net/sky-blog/archives/2010…
asterisk ソースをダウンロードし、展開。configureを実行。ここまでは普通。 「make menuselct」を実行し余分なオプションを解除。Lionではsnmp関連のビルドでエラーになったので、「Resource Modules」->「res_snmp」を解除した。 make、make install(必…
mysqlのdatetime型カラムに対し、phpのdate()で使うには、strtotimeで文字列からdate型に変換しておく必要がある。 $datetime = "2012-03-08 12:23:20"; echo date("Y年m月d日 H:i:s",strtotime($datetime));
NSString *phoneName = [[UIDevice currentDevice] name]; NSString *phoneUniqueIdentifier = [[UIDevice currentDevice] uniqueIdentifier];
my_strに正規表現を使って、文字を切り出したサンプル。パターン定義の(...)を:[match rangeAtIndex:何個目]]で抜ける。 NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:@"^〒\\d{3}-\\d{4} (.+)" options:0 error:nil…
xcode 非同期処理のため、引き当てた住所をUIラベルで表示する...とかは、住所がセットされるタイミングに注意。 住所は、CLPlacemarkの中のmy_placemark.addressDictionaryの中のvalueForKey:@"FormattedAddressLines"を使用するが、郵便番号があったり、な…
改行の\nや、正規表現の\dとか、表示上では円(¥)記号だが、Xcodeでは「Alt+\」でバックスラッシュ(\)を必ず入れる
TabBarControllerのタブは、segueを繋げた順になってしまうが、TabBarControllerの各タブアイコンをドラッグすると、入れ替えることができる。
StroyBoardで、画面遷移元のViewControllerで「Ctrl+右クリック」し、遷移先に繋げる。modal/push等を選択しておき、プロパティウィンドウの「identify」でsegue名を設定する。 コードの中で、 [self performSegueWithIdentifier:@"segue名" sender:self];
行を選択し、「Ctrl+i」
UIAlertviewを複数個作って、それぞれ[self delegate]をやると、アクションがバッティングするため、tagを設定し、tagで処理を分ける。 //アラート画面のタグを宣言 static const NSInteger loginAlertTag = 1; static const NSInteger logoutAlertTag = 2; …