我将不胜感激,了解如何重写这行代码以消除编译器警告.代码是:
if (string == nil)
[NSException raise:NSInvalidArgumentException format:nil];
Run Code Online (Sandbox Code Playgroud)
警告是:
Format not a string literal and no format arguments.
Run Code Online (Sandbox Code Playgroud)
我找到了与NSLog有关的答案,但没有找到NSException.
JAL
该错误适用于任何需要格式字符串的内容.你只需要更换nil有@"",如:
[NSException raise:NSInvalidArgumentException format:@""];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1205 次 |
| 最近记录: |