#import "ViewController.h"@interface ViewController (){ UIButton *btn;}@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoa...
分类:
其他好文 时间:
2015-04-01 16:50:06
阅读次数:
120
//单例模式
#import "MySingleton.h"
@implementation MySingleton
- (instancetype) sharedInstance{
static MySingleton *SharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_on...
分类:
其他好文 时间:
2015-04-01 13:42:49
阅读次数:
127
与C 和C++ 一样,Objective-C 也使用“头文件”(header file) 与“实现文件”(implementation file)来区隔代码。用Objective-C 语言编写“类”(class)的标准方式为:以类名做文件名,分别创建两个文件,头文件后缀用.h,实现文件后缀用.m。创建好一个类之后,其代码看上去如下所示: // EOCPerson.h
#import <Foun...
分类:
其他好文 时间:
2015-04-01 09:32:47
阅读次数:
133
#import "MyView.h"@interface MyView (){ CGMutablePathRef pathRef;}@end@implementation MyView-(id)initWithCoder:(NSCoder *)aDecoder{ if (self=[su...
分类:
其他好文 时间:
2015-04-01 00:19:54
阅读次数:
114
继承:继承是使用已存在的类的定义作为基础建立新类的技术,新类继承旧类,就可以实用旧类的部分数据。例如实例变量的继承和方法的继承。
旧类Aaa
@interfance Aaa:NSObject
{
int val;
}
-(int)intVar;
@end
@implementation Aaa
-(int)intVar
{
var=1000;
return var;
}...
分类:
其他好文 时间:
2015-03-31 22:32:00
阅读次数:
108
#import "MJOneViewController.h"
@interface MJOneViewController ()
@property (nonatomic,
strong) NSArray *apps;
@property (nonatomic,
strong) NSArray *persons;
@end
@implementation MJOne...
分类:
其他好文 时间:
2015-03-31 22:26:45
阅读次数:
208
OC入门第一课
hello.m(implementation) hello.c
#import 引入头文件
#include
import是include的加强版,预处理只要预处理一次
编译链接:clang hello.m -framework Foundation
(-fobjc-arc 用自动引用计数编译)//终端默认为手动引用计数
(-fno-objc-ar...
分类:
其他好文 时间:
2015-03-31 09:10:08
阅读次数:
153
C++实现的avl平衡树 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 class AvlNode 10 { 11 public : 12 ...
分类:
其他好文 时间:
2015-03-31 00:39:12
阅读次数:
224
#import "ViewController.h"@interface ViewController ()@property(nonatomic,strong)CALayer *imageLayer;@end@implementation ViewController- (void)viewDid...
分类:
其他好文 时间:
2015-03-31 00:25:10
阅读次数:
166
原文??http://wulijun.github.com/2012/08/21/mysql-index-implementation-and-optimization.html 第一部分:基础知识 索引 官方介绍索引是帮助MySQL高效获取数据的数据结构。笔者理解索引相当于一本书的目录,...
分类:
数据库 时间:
2015-03-30 23:17:39
阅读次数:
548