LoginSignup
13
13

More than 5 years have passed since last update.

iOSアプリ開発で使っている小技みたいなもの

Last updated at Posted at 2013-05-08

忘れないうちに自分用メモ。

開発時のみログ出力

#ifdef DEBUG
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define DLog(...)
#endif

UIColorのマクロ

#define RGB(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1]
#define RGBA(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]

2013.05.08 コメントをもとに修正。

クラッシュレポートの管理 (crashlytics)

プロジェクト内に組み込むことで、クラッシュした時の状態を一元管理できる。今後の為に導入して様子見。

シュミレータと実機の切り替え

下記プリプロセッサで実現

#if TARGET_IPHONE_SIMULATOR
#warning *** Simulator mode: audio session code works only on a device

#else
some code
#endif

参考情報元

13
13
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
13