分類はしませんので、必要があれば検索してください。基本的に、ネットへの接続が問題だったために起きているエラーです。
異常時
% gem update cocoapods
Updating installed gems
^CERROR: Interrupted
- (void)osVersion | |
{ | |
NSString *targetVersion = @"6.0"; | |
NSString *osVersion = [[UIDevice currentDevice] systemVersion]; | |
NSLog(@"OSのバージョン:%@", osVersion); | |
if ([osVersion compare:targetVersion options:NSNumericSearch] == NSOrderedAscending) { | |
NSLog(@"iOS%@前のバージョン", osVersion); | |
} |
% brew upgrade mongodb | |
==> Upgrading 1 outdated package, with result: | |
mongodb 2.4.5 | |
==> Upgrading mongodb | |
==> Downloading http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.4.5.tgz | |
######################################################################## 100.0% | |
==> Caveats | |
To have launchd start mongodb at login: | |
ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents | |
Then to load mongodb now: |
# | |
# https://github.com/CocoaPods/Specs | |
# | |
platform :ios, '6.0' | |
# デフォルトで導入 | |
pod 'TestFlightSDK', '1.2.6' | |
pod 'CocoaLumberjack', '1.6.2' | |
pod 'SVProgressHUD', '0.9' |
たまには「brew doctor」しておくかと思い、やってみると「developer tools」がインストールされてないと言われます。
/Users/naokits% brew doctor
Warning: No developer tools installed.
You should install the Command Line Tools.
Run `xcode-select --install` to install them.
^C
各ソースコードの行数とファイル名を表示 | |
% find nana -type f \( -name '*.h' -or -name '*.m' \) | xargs wc -l | |
ソースコードのファイ名、行数を、最後に行数の合計を表示 | |
% find nana -type f \( -name '*.h' -or -name '*.m' \) | wc -l |
% ssh-keygen -t rsa -C "hogehoge@gmail.com" |
マッチャーフレームワーク for Objective-C/Cocoa
ExpectaはGithubのメンバーが作ったマッチャーです。BDDフレームワークであるSpecta(これもGithub製)と組み合わせて使用すると、手軽にテストコードが書けます。特に非同期テストの書きやすさは秀逸です。是非皆さんも一度使ってみることをお勧めします。
このドキュメントは私がspecta/expectaから、自分が必要とする部分のみを抜粋して翻訳したものです。 翻訳に自信がない部分はそのままにしています。
- (RACSignal *)userHasAccessToTwitter | |
{ | |
return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) { | |
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) { | |
[subscriber sendCompleted]; | |
} else { | |
[subscriber sendError:[NSError errorWithDomain:@"" code:2 userInfo:nil]]; | |
} | |
return nil; | |
}]; |