NSHTTPURLResponseオブジェクトを設定するコードは次のとおりです。
NSString * data = @"response successful";
NSUInteger length = [data length];
NSDictionary * headersDict = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInt:length], @"Content-Length", nil];
NSHTTPURLResponse * response = [[NSHTTPURLResponse alloc] initWithURL:[request URL] statusCode:200 HTTPVersion:@"1.1" headerFields:headersDict];
次のコードは、パラメーターとして配置すると、最後の行でクラッシュしheadersDictます。
エラー: testReportAppOpenToAdMobWithAppstoreId (AdTrackerTests) に失敗しました: -[__NSCFNumber 長さ]: 認識されないセレクターがインスタンス 0xf653f40 に送信されました
なぜクラッシュするのかわかりません。デバッグheadersDictは良好であることを示しています。私は Apple 側のバグを疑っています。
何か案は?