You #import or #include when there is a physical dependency. Otherwise, you use forward declarations (@class MONClassstruct MONStruct@protocol MONProtocol).

Here are some common examples of physical dependence:

  • Any C or C++ value (a pointer or reference is not a physical dependency). If you have a CGPoint as an ivar or property, the compiler will need to see the declaration of CGPoint.
  • Your superclass.
  • A method you use.

参考:http://stackoverflow.com/questions/322597/class-vs-import

#import vs. @class的更多相关文章

  1. ES6模块import细节

    写在前面,目前浏览器对ES6的import支持还不是很好,需要用bable转译. ES6引入外部模块分两种情况: 1.导入外部的变量或函数等: import {firstName, lastName, ...

  2. spring源码分析之@ImportSelector、@Import、ImportResource工作原理分析

    1. @importSelector定义: /** * Interface to be implemented by types that determine which @{@link Config ...

  3. Python标准模块--import

    1 模块简介 作为一个Python初学者,你首先要学会的知识就是如何引入其它模块或者包.但是,我发现有些开发者虽然使用Python很多年,依然不了解Python引入机制的灵活性.这篇文章,我们就会研究 ...

  4. css和@import区别用法

    css和@import都是调用外部样式表的方法. 一.用法 (1)link: <link rel="stylesheet" type="text/css" ...

  5. 从爬取湖北某高校hub教务系统课表浅谈Java信息抓取的实现 —— import java.*;

    原创文章与源码,如果转载请注明来源. 开发环境:Myeclipse,依赖包:apache-httpclient . Jsoup.base64 一.概述 整个系统用Java开发.我们现在要做的是类似于超 ...

  6. python from __future__ import division

    1.在python2 中导入未来的支持的语言特征中division(精确除法),即from __future__ import division ,当我们在程序中没有导入该特征时,"/&qu ...

  7. python学习笔记-import utils报错

    今天遇到一个坑爹的问题,查找了半天原因,终于解决了,在此特地记录一下. 运行环境:Windows eclipse 我在eclipse中配置了python的运行环境,在eclipse中编写python代 ...

  8. ImportError: cannot import name '_imagingtk'

    问题描述 使用tkinter画pillow生成的图片时,在tkinter中抛出此异常. 解决方案 pip install -I --no-cache-dir Pillow 更新pillow 重启解决一 ...

  9. import renumber.py in pymol

    cp renumber.py /usr/local/lib/python2.7/dist-packages/pymol import renumber or run /path/to/renumber ...

  10. python import, from xx import yy

    区别: 用import modulexx/packagexx.moduleyy是导入某一模块,如果想引用模块的内容(class, method,variables...)必须用全名,即 [module ...

随机推荐

  1. 细聊分布式ID生成方法

    细聊分布式ID生成方法 https://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=403837240&idx=1&sn=ae9 ...

  2. ucenter 4站同步

    其中fleam站的登陆代码为下,通过登陆fleam的账号,引发其他3个站点的登陆 <meta charset="utf8"> <?php include 'con ...

  3. 第一段nodejs代码

    步骤一.创建服务器 接下来我们使用 http.createServer() 方法创建服务器,并使用 listen 方法绑定 8888 端口. 函数通过 request, response 参数来接收和 ...

  4. “双十一”购物狂欢节,电商运营和商业智能(BI)才是绝配

         百年前,人们获取信息的方式是通过报纸.书籍:十年前,人们获取信息的方式是通过传统PC互联网:而如今,在4G网络高速发展的浪潮下,伴随着移动智能终端的普及,人们获取信息的方式已经逐渐转向了移动 ...

  5. 装饰器、生成器,迭代器、Json & pickle 数据序列化

    1. 列表生成器:代码例子 a=[i*2 for i in range(10)] print(a) 运行效果如下: D:\python35\python.exe D:/python培训/s14/day ...

  6. oracle 时间格式修改

    1.临时修改时间格式第一种方式 :select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;第二种方式:alter session set n ...

  7. VVDocumenter 注释工具的使用

    首先,前往github上下载工程源代码. 然后,编译VVDocumenter工程. 重启xcode. 然后,只要在你自己的工程中要加入注释的方法前面输入“///”,一切搞定. 很好很强大.

  8. J2EE maven pom.xml常用的jar包

    新建一个maven webapp工程,默认的pom.xml文件如下: <project xmlns="http://maven.apache.org/POM/4.0.0" x ...

  9. 转:Jmeter之Bean shell使用(二)

    上一篇Jmeter之Bean shell使用(一)简单介绍了下Jmeter中的Bean shell,本文是对上文的一个补充,主要总结下常用的几种场景和方法,相信这些基本可以涵盖大部分的需求.本节内容如 ...

  10. js eventhandler

    1.获取所有eventhandler 使用 getEventHandler(target) 2.target.addEventHandler(type,handler,userCapture?) 3. ...