私のobjective-cプロジェクトでは、次のような奇妙な機能があります。たとえば、次のようなクラスがあります。
#import <Foundation/Foundation.h>
@interface Convert /* : NSObject */ // <--- is that necessary?
+(int) toInt:(id) obj;
@end
@implementation Convert
+(int) toInt:(id) obj
{
return [obj intValue];
}
@end
コードをステップ実行すると、問題なく動作しますが、コンソールに不可解なエラーが表示されます (コードは完全に正常ですが、期待どおりに動作します)。
2010-11-03 09:35:49.422 Tests[14066:5f03] *** NSInvocation: warning: object 0x9e424 of class 'Convert' does not implement methodSignatureForSelector: -- trouble ahead
2010-11-03 09:35:49.422 Tests[14066:5f03] *** NSInvocation: warning: object 0x9e424 of class 'Convert' does not implement doesNotRecognizeSelector: -- abort
それでも、abort と表示されていても、コードは機能します。ただし、これらのコード行をステップ実行せずに実行すると、中止されます。何が起こっているのか、その理由は?