摘要: 思路是建一个UIView的子类,获取划动出的矩形,用协议将矩形传递给代理对象,依据该矩形完成图像数据的截取,并显示出来。截图视图类:#import @protocol UICutImgDelegate;@interface BIDCutView : UIView{ CGPoint startPoint; CGRect targetRect; id _delegate;}@property (assign , nonatomic) id delegate;@end@protocol UICutImgDelegate -(void)cutImgWithRect:(CGR... 阅读全文
posted @ 2013-08-01 14:56 MingFung_Liu 阅读(493) 评论(0) 推荐(0) 编辑
摘要: 思路是将每一次按下屏幕的touch move时的点存到一个数组里,即一个数组相当于一个笔画;再将该代表笔画的数组保存到一个大数组中,每组每次touch的移动都历遍大数组和笔画数组,将点于点之间连接起来。#import @interface BIDDrawView : UIView{ NSMutableArray *allPoints;}@end#import "BIDDrawView.h"@implementation BIDDrawView- (id)initWithFrame:(CGRect)frame{ self = [super initWithFrame:fram 阅读全文
posted @ 2013-08-01 12:37 MingFung_Liu 阅读(473) 评论(0) 推荐(0) 编辑
摘要: 1.属性列表序列化2.模型对象归档3.嵌入式SQLite34.Core Data5.应用程序设置6.UIDocument管理文档存储7.iCloudDemo界面:1.属性列表序列化即从porperty list中直接读写plist对象(NSString, NSData, NSArray, or NSDictionary objects),其中容器对象中的实例亦要为plist对象。根视图控制器: 1 #define kFilename @"data.plist" 2 3 - (void)viewDidLoad 4 { 5 [super viewDidLoad]; 6 NSSt 阅读全文
posted @ 2013-07-05 09:55 MingFung_Liu 阅读(693) 评论(0) 推荐(0) 编辑
摘要: 老师版 1 #include 2 #include 3 4 // 定于Node数据类型 5 struct Node 6 { 7 int data; // 数据域 8 struct Node *next; // 指针域 9 }; 10 11 // 创建一个单链表,并把head节点返回; 12 struct Node* createLinkList(void); 13 struct Node* createLinkList(void) 14 { 15 struct Node *head ... 阅读全文
posted @ 2013-06-27 15:40 MingFung_Liu 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 6 struct Student 7 { 8 char id[4]; 9 char name[10]; 10 int score; 11 }; 12 13 typedef struct User 14 { 15 char userName[20]; 16 char userPassword[10]; 17 }UserInfo; 18 19 void inputNameAndPassword(); 20 void logon(); ... 阅读全文
posted @ 2013-06-26 16:16 MingFung_Liu 阅读(1666) 评论(6) 推荐(2) 编辑
摘要: 1.快速排序法 1 //方法1 从大到小 2 #include 3 void run(int* pData,int left,int right) 4 { 5 int i,j; 6 int middle,iTemp; 7 i = left; 8 j = right; 9 middle = pData[(left+right)/2]; //求中间值10 do{11 while((pData[i]middle) && (j>left))//从右扫描大于中值的数14 j--;15 if(ii... 阅读全文
posted @ 2013-06-21 17:02 MingFung_Liu 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 1.冒泡排序法: 1 //方法1--从小到大(假设有数组int array[n]) 2 void bubbleSort(int *array,int n) 3 { 4 int tmp; 5 for(int i=0;iarray[j+1]) { 8 tmp=array[j]; 9 arrar[j]=array[j+1];10 array[j+1]=tmp;11 }12 }13 }14 } 1 //方法2--从大到小 2 void bubb... 阅读全文
posted @ 2013-06-13 15:55 MingFung_Liu 阅读(180) 评论(0) 推荐(0) 编辑