摘要: 类与实例 对象是一个自包含的实体,用一组可识别特性和行为来标识 简称OOP 类就是具有相同的属性和功能的对象的抽象的集合 ‘class’是便是定义类的关键字 (OC中用@interface 类名:继承类 @end) 第一,类名称首字母记者要大写。多个单词则各个首字母大写,第二,对外的方法需要用‘pu 阅读全文
posted @ 2016-03-02 15:20 徒步天涯 阅读(437) 评论(0) 推荐(0) 编辑
摘要: 第二章:商场促销——策略模式 策略模式的定义: 策略模式是一种定义一系列算法的方法,从概念上来看,所有这些算法完成的都是相同的工作,知识实现不同,他可以以相同的方式调用所有的算法,减少了各类算法类与使用算法类之间的耦合 策略模式的优点 : 1. 策略模式的Strategy 类层次为Context定义 阅读全文
posted @ 2016-03-01 18:46 徒步天涯 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 第一章:代码无错就是优-简单的工厂模式 先建立一个计算类Operation Operation.h文件 @interface Operation : NSObject @property(nonatomic,assign)double numberA; @property(nonatomic,ass 阅读全文
posted @ 2016-03-01 11:32 徒步天涯 阅读(304) 评论(0) 推荐(0) 编辑
摘要: @interface ViewController : UIViewController@property (strong,nonatomic) UILabel *aLable;@property (strong,nonatomic) UILabel *lblPassword;@end#import... 阅读全文
posted @ 2016-01-13 11:14 徒步天涯 阅读(193) 评论(0) 推荐(0) 编辑
摘要: #import #import "Car.h"int main(int argc, const char * argv[]) { @autoreleasepool { Car *ca =[Car new]; Engine *eng=[Engine ne... 阅读全文
posted @ 2016-01-11 16:13 徒步天涯 阅读(259) 评论(0) 推荐(0) 编辑
摘要: int main(int argc, const char * argv[]) { @autoreleasepool { //字符串进行排序 NSArray *arr=@[@"b",@"a",@"c"]; NSSortDescriptor *ns=[NSSortDescriptor sortDesc 阅读全文
posted @ 2016-01-10 16:04 徒步天涯 阅读(1476) 评论(0) 推荐(0) 编辑
摘要: NSDate#import int main(int argc, const char * argv[]) { @autoreleasepool { //通过date方法创建的时间对象,对象就保存了当前的时间; /* NSDate *now=[NSDate date]... 阅读全文
posted @ 2016-01-09 15:05 徒步天涯 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 1.数字int main(int argc, const char * argv[]) { @autoreleasepool { //添加空白 [NSNull null]// NSArray *arr=[NSArray arrayWithObjects:@1,@2,... 阅读全文
posted @ 2016-01-07 16:41 徒步天涯 阅读(732) 评论(0) 推荐(0) 编辑
摘要: #import int main(int argc, const char * argv[]) { @autoreleasepool { /** * NSArray 数组,可以存储任何类型的OC对象 NSEnumerator, N... 阅读全文
posted @ 2016-01-07 11:26 徒步天涯 阅读(374) 评论(0) 推荐(0) 编辑
摘要: #import int main(int argc, const char * argv[]) { @autoreleasepool { /** * length获取字符串长度,即获取字符个数 */// NSString *str=... 阅读全文
posted @ 2016-01-06 16:26 徒步天涯 阅读(604) 评论(0) 推荐(0) 编辑
摘要: 下载地址:http://pan.baidu.com/s/1boxvewB1.首先下载解压压缩包打开VVDocumenter工程,编译一遍(快捷键com+B)2.在finder里面的应用程序,找到Xcode,右键 “显示包内容”,在Contents文件夹下,找到Info.plist文件,并打开,找到D... 阅读全文
posted @ 2016-01-05 13:51 徒步天涯 阅读(424) 评论(0) 推荐(0) 编辑
摘要: 在OC中结构体有时候也作为对象的属性类的定义#import typedef struct{ int year; int month; int day;} Date;@interface Student : NSObject{ @public NSString *_nam... 阅读全文
posted @ 2016-01-04 20:24 徒步天涯 阅读(574) 评论(0) 推荐(0) 编辑
摘要: 今天终于开始进行OC的学习了一.首先讲了NSLogNSLog是oc里面的输出语句,其用法和printf差不多,但是还是有差别的1,NSLog是自动换行的,不用像printf那样还需要加'\n';2,NSLog在引号面前需要添加@符号,例如: NSLog(@"Hello World"); ... 阅读全文
posted @ 2016-01-03 19:46 徒步天涯 阅读(423) 评论(0) 推荐(2) 编辑
摘要: //// main.c// homeWork1222////#include int main(int argc, const char * argv[]) {// insert code here...// 第一题 年份// int year,month;// pri... 阅读全文
posted @ 2015-12-30 21:01 徒步天涯 阅读(6530) 评论(0) 推荐(0) 编辑
摘要: C语言中可以使用系统函数也可以使用自己的函数,就是自定义函数自定义函数分为四种第一种:无参无返回值的函数的声明void sayH();函数的实现void sayH(){ printf("你好");}第二种:有参数无返回值函数的声明:void pxsbx(int c,int k);函数的实现:v... 阅读全文
posted @ 2015-12-30 20:02 徒步天涯 阅读(6445) 评论(0) 推荐(0) 编辑
摘要: //// main.c// homeWork1230////#include #include #include int main(int argc, const char * argv[]) {//// strstr(str1,str2) 函数用于判断字符串str2是否是str1的子串。... 阅读全文
posted @ 2015-12-30 17:27 徒步天涯 阅读(693) 评论(0) 推荐(0) 编辑
摘要: C语言在中常常出现字符和字符串,而一串字符或者字符串其实就是数组字符数组的定义char arr[]={'h','e','l','l','o','\0'};而定义字符串:char arr1[]="HELLO";字符的输入和输出可以向一维数组那样用scanf和printf,而字符也可以用自己特定输入和输... 阅读全文
posted @ 2015-12-30 14:04 徒步天涯 阅读(1179) 评论(0) 推荐(0) 编辑
摘要: 用c语言编写的简易日历,代码如下:#include int main(int argc, const char * argv[]) { // insert code here.. int year,month,day=0,day1=0; printf("请输入年份:"); ... 阅读全文
posted @ 2015-12-25 20:28 徒步天涯 阅读(2306) 评论(0) 推荐(1) 编辑
摘要: 许多系统的登录都有验证码,而如果使用thinkPHP框架搭建网站的话,验证码的生成和验证就比较容易了1.生成验证码thinkPHP有对应生成验证码的方法要使用验证码,需要导入扩展类库中的ORG.Util.Image类库和ORG.Util.String类库。我们通过在在模块类中增加一个verify方法... 阅读全文
posted @ 2015-10-05 20:52 徒步天涯 阅读(650) 评论(1) 推荐(1) 编辑