他人のサーバ、既存環境が動いているサーバでバージョン確認したいことってありますよね。

■postgreSQL

psql --version

■httpd

httpd -vでバージョン、httpd -Vでコンパイルオプション

■mysql

mysql -D mydatabase -e "select version();"

posted by Face ysakaki on Thu 13 Nov 2008 at 13:08

Objective-CでMethodのIMPを取得して呼び出す場合に、 正しい関数プロトタイプの関数ポインタにキャストする必要がありますが、 typedefなどを使わずにその場で目的の関数ポインタ型にキャスト する方法を紹介します。

   1  SEL selector = @selector(drawRect:);
   2  Method method = class_getInstanceMethod([UISearchBar class], selector);
   3  IMP drawRect = method_getImplementation(method);
   4  ((void(*)(id, SEL, CGRect))drawRect)(self, selector, rect);

こんな感じにすればOkです。

posted by Png genki on Thu 13 Nov 2008 at 01:15
Contents
postgreSQL、httpd他のバージョン確認方法
その場で関数ポインタ型にキャストする方法
Comments
瀧内元気: MacOS版は以下にあります * [genki/ViMouse](https://githu... '23-1
KingofSmack: Here also good reads for this mobile applicatio... '14-5
Spencer: You don't have to re-compile it, this version w... '14-4
staiano: Any chance we can get a recompile for 10.9? '14-1
dsjf: https://gist.github.com/6bf1bf2c3cbb5eb6e7a7 これ... '13-1
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ