ログイン



missing sentinel in function call

金曜日, 11月 18th, 2011 by

Objective-cにおいて、可変長引数を取るメソッドでは最後にnilを指定します。今まではnilを忘れていた場合エラーになっていたと思うのですが、iOS5では、「missing sentinel in function call」という警告がでるものの、実行自体は成功するようです。

間違い

tb.items = [NSArray arrayWithObjects:bbColored, bbNotColored];

正解

tb.items = [NSArray arrayWithObjects:bbColored, bbNotColored, nil];