我想创建一个UIActionSheet
,但我总是收到关于“缺少哨兵”的警告:
/Users/....mm:136:173:警告:方法调度中缺少哨兵 [-Wsentinel]
UIActionSheet* adsl_action_sheet = [[[UIActionSheet alloc] initWithTitle:nil
delegate:(id<UIActionSheetDelegate>)self
cancelButtonTitle:[dsd_string_localizer ms_get_localized_system_string:@"Cancel"]
destructiveButtonTitle:nil
otherButtonTitles:[dsd_string_localizer ms_get_localized_system_string:@"Logoff"], [dsd_string_localizer ms_get_localized_system_string:@"Disconnect"], nil] autorelease];
我真的看不出有什么不对……也许我只是瞎了。
包含此代码的文件是一个 Objective-C++ 文件。
我还注意到它在每个需要这种哨兵的地方都显示这些“哨兵警告”。