ios – Xcode 7 Null传递给需要非null参数的被调用者

前端之家收集整理的这篇文章主要介绍了ios – Xcode 7 Null传递给需要非null参数的被调用者前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我更新了 xcode 7并给出了这个错误

Null传递给需要非null参数的被调用

_recorder = [[AVAudioRecorder alloc]initWithURL:[NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@.%@",[NSHomeDirectory() stringByAppendingString:@"/Documents"],name,extension]] settings:nil error:nil];

解决方法

如果困扰你的是警告,你可以使用这个-Wnonnull来压制它
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnonnull"

_recorder = [[AVAudioRecorder alloc]initWithURL:[NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@.%@",extension]] settings:nil error:nil];

#pragma clang diagnostic pop
原文链接:https://www.f2er.com/iOS/333092.html

猜你在找的iOS相关文章