目标c:方法关系.h和.m [英] Objective c: method relation .h and .m

查看:167
本文介绍了目标c:方法关系.h和.m的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个理论问题:但是每个方法和IbAction都必须在.h中声明因为如果我在.m中编写一个方法(void)而不是在.h中,那么这个项目没有问题。

I have a theoretical question: but every method and IbAction must be declared in .h??? Because if I write a method (void) in .m and not in .h the project not has problem.

推荐答案

想要从另一个类中访问函数,您将导入.h头文件,以使您的编译器了解在哪里找到这些函数以及如何翻译它们。

If you wanna access a function from another class you're gonna import that .h header file to make your compiler understand where to find those functions and how to translate them.

这篇关于目标c:方法关系.h和.m的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆