iOS 8以降に搭載されたQuickType(予測変換)
続きを読む
PowerPointのタイトル(文字列)が全て大文字
症状
PowerPointのタイトル(文字列)が全て大文字で表される。
原因
文字枠(プレースホルダー)のフォント設定で「全て大文字」が有効になっている。
PowerPoint 2010 の例
homebrewがバージョンアップできない
症状
Sierra (macOS 10.12) でhomebrewがバージョンアップできない。
1 2 3 4 5 |
$ brew upgrade Warning: You are using OS X 10.12. We do not provide support for this pre-release version. You may encounter build failures or other breakages. Please create pull-requests instead of filing issues. |
Trailing Closures
引数の最後においたクロージャ式は特別な記法で記述できる。接尾クロージャ、後置クロージャ。
省略を一切しない一般的な記述方法
1 2 3 |
func someFunctionThatTakesAClosure(closure: () -> Void) { // function body goes here } |
Closureの引数リストと戻り値を省略した記述方法
1 2 3 |
someFunctionThatTakesAClosure(closure: { // closure's body goes here }) |
someFunctionThatTakesAClosureの引数をTrailing Closureに置き換えた記述方法
1 2 3 |
someFunctionThatTakesAClosure() { // trailing closure's body goes here } |
さらに空の括弧を省略した記述方法
1 2 3 |
someFunctionThatTakesAClosure { // trailing closure's body goes here } |
Gradleのビルドが遅い
症状
Gradleによるビルドが遅い
コンソールに警告が表示される
1 2 3 4 5 |
To run dex in process, the Gradle daemon needs a larger heap. It currently has 1024 MB. For faster builds, increase the maximum heap size for the Gradle daemon to at least 1536 MB. To do this set org.gradle.jvmargs=-Xmx1536M in the project gradle.properties. For more information see https://docs.gradle.org/current/userguide/build_environment.html |
Duplicate files copied in APK
症状
APKの作成中に下記のエラーで停止する。
1 2 |
Error:Execution failed for task ':transformResourcesWithMergeJavaResForDebug'. > com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE |
Gradleが "GC overhead limit exceeded"
症状
Gradleによるビルド中に下記のエラーで停止する。
1 2 3 4 |
Error:Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded Error:1 error; aborting Error:Execution failed for task ':transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException |
解決策
build.gradleに以下の記述を追加してJavaのヒープサイズを拡張する。
1 2 3 4 5 6 |
android { ... dexOptions { javaMaxHeapSize "4g" } } |
Macの機種固有文字コード
Macの修飾キー、特殊キーボードキーの文字コード。
pod setupが遅い
CocoaPodsをつかっていて、pod setupの処理が遅い(いつまで経っても終わらない)
[Obj-C] メソッドファミリー
Objective-Cにおいてインスタンスを生成するメソッドは命名規則が決まっている。この命名規則を元に処理系がオーナーシップポリシーを判定して、コンパイル時の警告やエラーを判定するため注意すること。SwiftからObjective-Cのメソッドを呼び出したときも、下記の『メソッドファミリー』が影響する。