iOS 警告:隐式声明函数“pathInDocumentDirectory”
在尝试开发我的第一个 iPhone 应用程序时,我收到此行代码的“函数'pathInDocumentDirectory'的隐式声明”警告:
NSString *imagePath = pathInDocumentDirectory(s);
奇怪的是,我找不到任何关于该做什么的好信息关于这个。有谁知道如何摆脱警告?谢谢!
I'm getting an "Implicit declaration of function 'pathInDocumentDirectory'" warning for this line of code while trying to develop my first iPhone app:
NSString *imagePath = pathInDocumentDirectory(s);
Strangely, I can't find any good information on what to do about this. Does anyone know how to get rid of the warning? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果这是一个内联函数,请将声明移至实现文件的顶部(在任何内容使用它之前)。
如果它是您编写的方法,那么它应该是 Objective-C 方法...
然后您使用...
不要忘记在实现文件的标头或私有类别中声明该方法。
If that is an inline function, move the declaration to the top of the implementation file (before anything uses it).
If it's a method you've written it should be an objective-c method...
Then you use...
Don't forget to declare the method in either the header or a private category in the implementation file.
确保您已导入或包含包含 pathInDocumentDirectory 函数的头文件。
或者
如果pathInDocumentDirectory函数在同一个文件中,只需将其放在您使用的函数之前。或者直接声明pathInDocumentDirectory。
Make sure you have import or include the header file which contains pathInDocumentDirectory function.
OR
If pathInDocumentDirectory function is in the same file ,just put it before the function where you used.Or just declare the pathInDocumentDirectory at first。