#CoreFoundation入門 基本クラス その2
一回目の続き
bytebufferを扱う(ラッパー)クラス。NSDataとToll-free bridgingが可能
#CoreFoundation入門 基本クラス その2
一回目の続き
bytebufferを扱う(ラッパー)クラス。NSDataとToll-free bridgingが可能
#CoreFoundation入門 基本クラス
##概要
Core Foundationで頻出するドキュメントにて「Derived from CFPropertyList」となっている以下の基本クラスを確認。
CFData, CFString, CFArray, CFDictionary, CFDate, CFNumber(CFBoolean)
※CFNumber、CFDate以外は上記のImutable型に対してそれぞれMutablel型が用意されている。
#CoreFoundation入門 メモリ管理
##概要
CoreFoundationのルートクラス的存在であるCFTypeの中から一番使用するであろう、メモリ管理関連のメソッドを確認。
##リファレンスカウント方式のメモリ管理
CoreFoundationはObjective-Cと同様の生成/保持/解放のリファレンスカウント方式。生成したらオーナーシップを持ち、必要なくなったらオーナーシップを破棄するのが必須なのも一緒。
#CoreFoundation入門 Toll-free bridge
##概要 CoreFoundation入門 CFStringとその周辺の続き。
CoreFoundation入門 イントロで説明したFoundationとCoreFoundationの互換性を実現するToll-free bridgeの仕組みを確認していく。
##Tool-free bridgeとは
CocoaのオブジェクトをCoreFoundationから、そしてCoreFoundationのオブジェクトをCocoaから呼ぶ事ができる仕組み。
#CoreFoundation入門 CFStrringとその周辺
##概要
入門 イントロのHello,Worldで使用した「CFSTR("Hello, World!")」からCoreFoundationの実装を追っていく。
##CFStringの実装
まずはCFSTRのリファレンスを確認。CFStringRef型ということわかる。
#CoreFoundation入門 イントロ
##概要
デバッグ中にCF〜とかコンソールに表示されるが、そもそもCoreFoundationとはなんぞ?というレベルなのでこの機会に調べてみたいと思った。
以下をガイドとしてCoreFoundation の世界に飛び込みたい。
| /** | |
| * AppleScript to launch iterm2 terminals/tabs with configurable: | |
| * ~ Name <name> | |
| * ~ List of commands <cmds> | |
| * ~ Split behavior horizontal(h) or vertical(v) <split> :: (h, v) | |
| * | |
| * Run from terminal with `osascript iterm-launcher.js`. | |
| * Don't unfocus with the mouse/keyboard while executing the script. | |
| * | |
| * JS port of https://github.com/luismartingil/scripts/blob/master/iterm_launcher02.applescript |
| // ==UserScript== | |
| // @name Wikipedia Hukkatsu | |
| // @namespace http://ssig33.com/ | |
| // @description Wikipedia ga Hukkatsu Suru | |
| // @include http://en.wikipedia.org/* | |
| // ==/UserScript== | |
| var wikipedia = function(){ | |
| var ns =document.querySelectorAll('div'); | |
| for(i in ns){ | |
| try{ |