タグ

ARCとobjective-cに関するzepbagのブックマーク (4)

  • iOS6(ARC)でのGCDのメモリ管理 - blog.ishkawa.org

    Deployment TargetがiOS6.0以上の場合、GCDのオブジェクトもARCの管轄下になるらしいです。   以下のStack Overflowによると<os/object.h>というヘッダに書かれているそうです。 Why is ARC complaining about dispatch_queue_create and dispatch_release in iOS 6? これが適用される場合にはdispatch_releaseなどに対してXcodeが警告を出してくれます。 で、GCDのオブジェクトをプロパティとして持つ場合にどうしたらいいのか、 ちょっと迷ったので、dispatch_semaphore_tを例に書いておきます。 Deployment Targetが6.0未満の場合 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

  • Objective-C Automatic Reference Counting (ARC) — Clang 20.0.0git documentation

    Objective-C Automatic Reference Counting (ARC)¶ About this document¶ Purpose¶ The first and primary purpose of this document is to serve as a complete technical specification of Automatic Reference Counting. Given a core Objective-C compiler and runtime, it should be possible to write a compiler and runtime which implements these new semantics. The secondary purpose is to act as a rationale for wh

  • [iOS5] ARC : Autorelease, キャスト, 環境設定 | Natsu note

    これまでの記事はこちら: [iOS5] ARC (Automatic Reference Counting) : Overview [iOS5] ARC : プロパティ属性と使い方 [iOS5] ARC : Outletにはweakプロパティを使おう [iOS5] ARC : 循環参照 ARCまとめの最終回はAutoreleaseとキャストについてです。また、最後で簡単にですが、Xcodeの環境設定についても触れます。 Autorelease ARC環境下では、これまでのNSAutoreleasePoolは使えません。そうは言っても、別にAutorelease環境がなくなってしまったわけではなく、作法が少し変わったのですね。 まずは、参考までにmain.mを見てみましょう。 非ARC(マニュアルメモリ管理) int main(int argc, char *argv[]) { NSAuto

  • [iOS5] ARC : プロパティ属性と使い方 | Natsu note

    strong __strong修飾子に対応するプロパティ属性です。strong属性を用いたプロパティは参照先オブジェクトのオーナーとなります。 weak __weak修飾子に対応するプロパティ属性です。__weak修飾子を持った変数と同様、weak属性のプロパティも、参照先のオブジェクトが破棄されたら自動的にnilが代入されます。weak属性を用いたプロパティはオーナーシップ権を持ちません。 weak属性は、delegateやOutletの変数に最適です。 なお、iOS 4では__weak修飾子が使えないため、プロパティのweak属性も使えません。この場合は、後述のunsafe_unretainedを使いましょう。 copy __strong修飾子に対応しますが、実際にはコピーオブジェクトが代入されます。copy属性を用いたプロパティは参照先オブジェクトのオーナーとなります。 unsafe

  • 1