• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

プリプロセッサ マクロとかコンパイラ フラグとか苦手です。
a-haがあったのでメモ。

compiler flag編:-DNS_BLOCK_ASSERTIONS=1

NSAssertをリリースビルド時に無効して、そのフラグでNSLogも無効にしてしまおうという技です。2009年の記事ですが、参考に:

2009-12-03NSLogとNSAssertをリリース時に無効化する
http://iphone-dev.g.hatena.ne.jp/tokorom/20091203

Xcode 4.5ではこんな感じに設定してみました: NS_BLOCK_ASSERTIONS_compiler flags.png

preprocessing編:DNS_BLOCK_ASSERTIONS

動作的には上と同じ事なのですが、別の書き方。こっちのが文字数少ない分好きです。

Working with Assertions to Debug your Apps Posted on June 27, 2011
http://mobiledevelopertips.com/debugging/working-with-assertions.html

Xcode 4.5ではこんな感じに設定してみました: NS_BLOCK_ASSERTIONS_preprocessing.png

ちなみに:

What's the “DNS_BLOCK_ASSERTIONS” (C compiler flag)?
http://stackoverflow.com/questions/2752574/whats-the-dns-block-assertions-c-compiler-flag

Just to clarify, -D defines a constant, and it is one of the confusing flags that doesn't have a space between it and it's parameter

日本語だとここもヒントになりました:

Xcodeでのプリプロセッサ定義
http://romly.com/archives/2009/10/define_by_project_setting.html

posted by Png satoko on Tue 18 Sep 2012 at 15:19

最終的に -configuration の値をマニュアルで Debug から Release に切り替える。

   1  BUILD_DIR=${SRCROOT}/build/
   2  
   3  rm -rf ${BUILD_DIR}
   4  
   5  xcodebuild -project ${PROJECT_NAME}.xcodeproj -target ${PROJECT_NAME} -configuration Debug clean build
   6  
   7  xcodebuild -project ${PROJECT_NAME}.xcodeproj -sdk iphonesimulator5.1 -target ${PROJECT_NAME} -configuration Debug clean build
   8  
   9  THE_DIR=${BUILD_DIR}/${PROJECT_NAME}.framework
  10  
  11  mkdir -p ${THE_DIR}
  12  mkdir -p ${THE_DIR}/Headers
  13  mkdir -p ${THE_DIR}/Resources
  14  
  15  lipo ${BUILD_DIR}/Debug-iphoneos/lib${PROJECT_NAME}.a ${BUILD_DIR}/Debug-iphonesimulator/lib${PROJECT_NAME}.a -create -output ${THE_DIR}/${PROJECT_NAME}
  16  
  17  cp XXX.h ${THE_DIR}/Headers/
  18  cp XXX/XXController.xib ${THE_DIR}/Resources/
  19  cp Info.plist ${THE_DIR}/Resources/

posted by Face Saturn on Thu 13 Sep 2012 at 17:50
3rd Mon

SecItemImport

OpenSSL の PEM_write_RSAPublicKey を使用して作った public key の pem ファイルを SecItemImport で読み込むと -25257 "Unknown format in import."

逆に次のものは問題なく読める
◎KeyChain で作った鍵を pem で書き出したもの。
◎PEM_write_RSAPrivateKey で書き出した private key の pem から
  openssl rsa -pubout
 で public key を作り直したもの。
◎SecKeyGeneratePair で作成したキーを SecItemExport で書き出したもの。

原因は時間のある時に調査予定。

posted by Face Saturn on Mon 3 Sep 2012 at 12:09

正整数 をいくつかの正整数の和として表したものを、 の分割という。例えば

だから、4の分割は5通りある。正整数 について次を示せ。

(1)  「奇数のみを用いたの分割の総数」と「異なる数のみを用いたの分割の総数」は等しい。

(2)  を2以上の整数とすると「 の倍数でない数のみを用いたの分割の総数」と「同じ数を高々 個までしか用いないの分割の総数」は等しい。

posted by Face lvs on Mon 3 Sep 2012 at 01:29
Contents
NSAssertやNSLogを無効にする:-DNS_BLOCK_ASSERTIONS=1とNS_BLOCK_ASSERTIONS
.framework を作る Run Script のサンプル
SecItemImport
(問題)整数の分割
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
ブログに数式を埋め込める数式コミュニティ