定义接口: 在接口中要按照与类一样的方式声明方法,只是不能够指定任何访问修饰符,要将方法的主体换成一个分号,接口默认的访问类型是public;interface a{int b();}实现接口: 实现一个接口时,必须保证每个方法都完全匹配与他对应的接口中的方法,方法名和返回类型完全匹配,所有参数.....
#import "ViewController.h"
@interface ViewController ()
@property (strong, nonatomic)UILabel *label;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do ...
分类:
移动开发 时间:
2015-04-03 15:44:37
阅读次数:
148
JNI(Java Native Interface)_01
习惯
1、技术是什么?
2、为什么要使用这个技术?
3、怎么使用?
4、实际怎么应用?
jni 是什么
* jni (java native interface)
* 两张不同编程语言之间通讯
java:
特点:一次编写,到处运行
java源代码--->.class--->JVM--->os
c/c++
源代...
分类:
编程语言 时间:
2015-04-03 15:23:35
阅读次数:
200
API文档部分@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})@Retention(RetentionPolicy.RUNTIME)public @interface FormParam { /** ...
分类:
其他好文 时间:
2015-04-03 13:05:22
阅读次数:
220
1 包含#import 2 导入AVFoundation库文件 1 #import "ViewController.h" 2 #import 3 @interface ViewController () 4 - (IBAction)scan:(UIButton *)sender; 5 @prope....
分类:
移动开发 时间:
2015-04-03 13:04:43
阅读次数:
178
我们可以使用ifconfig来进行启动、观察与修改网络接口的相关参数,我们直接使用ifconfig就可以查看所有的网络接口,我们可以使用ifconfig interface up|down来启动或者关闭网络接口,我们可以使用ifconfig interface option的方式来进行修改,比如我们可以修改IP地址。
我们可以使用ifconfig eth0来查看该网卡的...
分类:
系统相关 时间:
2015-04-03 11:25:02
阅读次数:
190
学JAVA必须知道:抽象类与接口的区别abstract class和interface是Java语言中对于抽象类定义进行支持的两种机制,正是由于这两种机制的存在,才赋予了Java强大的面向对象能力。 abstract class和interface之间在对于抽象类定义的支持方面具有很大的相似性,甚至...
分类:
其他好文 时间:
2015-04-03 11:00:15
阅读次数:
128
抽象工厂模式(Abstract Factory Pattern)是工厂方法模式的进一步抽象,其英文原话"Provide an interface for creating families of related or dependent objects without specifying thei...
分类:
编程语言 时间:
2015-04-03 10:56:32
阅读次数:
143
4、接口隔离原则: ISP(Interface Segregation Principle) 客户端不应该依赖它不需要的接口,或者说类的依赖的关系应该建立在最小的接口上。举个例子,直接上代码:1interfaceI{2publicvoidmethod1();3publicvoidmethod2();...
分类:
编程语言 时间:
2015-04-03 01:32:30
阅读次数:
227
一、实现下载文件进度控制1.代码示例 1 #import "YYViewController.h" 2 3 @interface YYViewController () 4 @property(nonatomic,strong)NSMutableData *fileData; 5 @pr...
分类:
移动开发 时间:
2015-04-03 00:02:16
阅读次数:
454