18
19

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

64bit移行対応は実機を使おう

Last updated at Posted at 2014-11-05

シミュレータでは再現しないけれど64bitの実機端末でテストすると
クラッシュする箇所がありました。
公式でも既知のようですが、注意点として共有します。

ポインタに関わる部分は注意

Cocoa Touch 64ビット移行ガイド
https://developer.apple.com/jp/documentation/CocoaTouch64BitGuide.pdf
「Objective-Cのポインタに直接アクセスしない」という項目があります。
例えば、64bit対応をするときには下記書き換えを行う必要があります。

注意点としては、公式ドキュメントにもありますが、
シミュレータでは正常動作してしまうので、テスト時は実機で行う必要があることです。

Objective-C
// メソッドへ対応する関数へのポインタを利用して関数を呼び出す記法
IMP func = [catClass methodForSelector:@selector(eat:)];
BOOL ret = (*func)(catClass, @selector(eat:), fish);
Objective-C
// 通常の引数付きメッセージ送信による記法
BOOL ret = [catClass eat: fish];

参考URL

  • ダイナミックObjective-C (22) メソッドとは何か(5) - メソッドの実装

18
19
0

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
18
19

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?