自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(45)
  • 资源 (5)
  • 收藏
  • 关注

转载 加载动画

//声明加载view的动画路径 UIBezierPath *pacmanOpenPath; CGFloat radius = 15.0f; CGPoint arcCenter = CGPointMake(radius, radius); //定制一段圆弧 pacmanOpenPath = [UIBezierPath bezierPathW

2015-04-24 17:14:21 308

转载 跑马灯效果动画

UILabel *label3 = [[UILabel alloc] initWithFrame:CGRectMake(10,300, 300, 100)]; label3.text =@"噜啦啦噜啦啦噜啦"; [self.view addSubview:label3]; CGRect frame = label3.frame;

2015-01-15 20:35:27 765

转载 IOS设备 UIDevice 获取操作系统 版本 电量 临近手机触发消息检测 (转载)

- (void)viewDidLoad{[super viewDidLoad];// 操作系统NSString * osName =[[UIDevice currentDevice]systemName];// 操作系统版本NSString * systemVersion =[[UIDevice currentDevice]systemVersion];

2014-12-24 18:42:09 739

原创 栈区,堆区,常量区,静态区代码区

//1.栈区:特性先进后出(后进先出) //栈的特性 /* int a=10;//1 int b=10;//2 int c=10;//3 //创建顺序:123 //销毁顺序:321 //每一个函数都有一个栈帧 test(); int f=10; */ //函数中的变量一旦函数执行完成

2014-11-29 21:03:46 876

原创 函数指针和 宏定义

//普通宏定义//命名规范//1.全部大写//2.k+驼峰命名法#define kNumOrAge 30#define NUM 20//这不是变量//带参的 宏定义//所有的宏定义都是将你写得东西 原封不动 的替换掉#define MUL(a,b) ((a)*(b))#define CUM(a,b,c) ((a)*(b)*(c)) //结构体指针 stu

2014-11-29 21:00:24 1749

原创 函数,结构体,折半查找

//递归函数/*int remul(int num){ if (num<=1) { return 1; } else{ return num*remul(num-1); }}*///这就是一个结构体//这只是一个类型/*struct point{ float x;//x轴 float y;//y轴

2014-11-29 20:19:16 514

原创 冒泡排序

char name[4][22]={"yez","zhaoguodong","yangp,"}; char n[22]={0}; for (int i=0; i<3; i++) { for (int y=0; y<3-i; y++) { if (strcmp(name[y], name[y+1])>0)

2014-11-29 20:16:39 279

原创 GData第三方文件引入流程

1:Gdata文件拖入2:.h文件中找注释  /user/include/libxml2BuildSettings  搜索 search path找到  Header Search Paths双击右边加号 ,,   填进去/usr/include/libxml23:搜索 Other linkOther linker flags 右边加上 -lxml24:Build Ph

2014-11-27 21:18:38 342

原创 Block简单四种

//Block块 //Block块可以传到任何地方使用 //^托字符 //1.无返回值,无参数的Block void(^myBlock)()= ^{ NSLog(@"******"); }; myBlock(); //2.有返回值有参数的Block NSInteger(^sumBlock)(NSI

2014-11-27 21:03:10 362

原创 多态 ,

建立父类Person类person.h#import @interface Person : NSObject@property (nonatomic,copy)NSString *name;@property (nonatomic,retain)NSNumber *age;-(instancetype)initWithName:(NSString *)name

2014-11-27 20:55:15 289

原创 自动释放池,

Penson *p=[[Penson alloc] init]; [p retain]; NSLog(@"%ld",[p retainCount]); [p release]; [p release]; p=nil; NSLog(@"%ld",[p retainCount]);

2014-11-27 20:47:55 403

原创 KVC简单介绍

//实例化一个老师 Teacher *t1=[[Teacher alloc] init]; //KVC工作流程 //KVC首先检车类中是否有getter,setter方法. //如果没有就去找有没有和key相同名字的实例变量. //如果也米有,就去找有没有和_key相同名字的实例变量. //第一个方法是用来设置值的

2014-11-27 20:39:14 381

原创 NSDate

//创建一个日期对象 NSDate *date=[NSDate date]; NSLog(@"%@",date); //以0时区为基准,便宜某个时间间隔. NSDate *nowDate=[NSDate dateWithTimeIntervalSinceNow:(60*60*8)]; //计算两个时间的间隔,单位:秒. NSTim

2014-11-27 20:31:54 283

原创 NSDictionary NSMutableDictionary NSSet 还有数组中字符串比较排序,数组中国数字从大到小排序

//创建一个字典//key:能够当key值的一定会遵循NSCopying的协议 //Value:任意类类型的 //1.正常的初始化方法 NSDictionary *dic1=[[NSDictionary alloc] initWithObjectsAndKeys:@"张三",@"name",@"男",@"sex",@"18",@"age",

2014-11-27 19:36:59 517

原创 NSString NSMutableString NSArray NSNumber

//NSString 不可变字符串. /* //1.初始化 //使用字符串常量初始化 NSString *s1=@"hello"; //初始化方法 NSString *s2=[[NSString alloc] initWithFormat:@"%@,world",s1]; NSLog(@"s2,%@",s2);

2014-11-27 17:51:31 336

原创 OC基础 便利构造器 继承,

父类:Animal.h#import @interface Animal : NSObject{//实例变量 NSString *_type; //种类 NSString *_color; }-(instancetype)initWithType:(NSString*)type color:(NSString*

2014-11-27 17:46:16 461

原创 OC基础初始化方法,Set get方法,继承父类

@interface Student : NSObject{ //实例变量 NSString *_name; NSInteger _age;}//初始化方法-(instancetype)initWithName:(NSString *)name age:(NSInteger)age;//getter方法-

2014-11-27 17:40:46 535

原创 UIapplication 执行顺序

//在AppDelegate 里边的.- (void)applicationWillResignActive:(UIApplication *)application{ NSLog(@"将要进入不活跃状态");}- (void)applicationDidEnterBackground:(UIApplication *)application{

2014-11-27 17:31:24 282

原创 动画 CALayer

UIView的属性动画,会修改属性产生动画.CALayer,没有修改UIView属性.初始化myView@property (nonatomic,strong)UIView *myView;self.myView=[[UIView alloc] initWithFrame:CGRectMake(50, 50, 100, 100)]; self.myVi

2014-11-26 19:28:55 334

原创 动画,(UIView上)

//UIView动画 //开始动画 [UIView beginAnimations:nil context:nil]; //运动的时间 [UIView setAnimationDuration:2.0f]; //延时启动 //[UIView setAnimationDelay:2.f]; //速度曲线 [UIVie

2014-11-26 19:21:08 241

原创 GCD

//GCD (先进先出 FIFO)    //串行:前一个任务完成,后一个任务才能执行    //并行:任务在派发时是有序的,但是不用等第一个任务执行完成才开始.    //GCD队列分为三种:主队列,全局队列,和自定义队列    1:使用主队列实现任务派发(串行),在主线程中//1.使用主队列实现任务派发(串行),在主线程中 dispatch_queue

2014-11-25 20:07:28 219

原创 多线程

线程:{ NSInteger _count; //锁 NSLock *_lock;} _lock=[[NSLock alloc] init];  //在didload里边初始化_lock第一种: NSThread *thred1=[[NSThread alloc]initWithTarget:self selector:@selec

2014-11-25 19:49:48 258

原创 UICollectView

1 :初始化 视图布局

2014-11-24 21:57:57 2717

原创 简单数据持久化/NSUserDefaults(单例) 登陆界面简单验证

声明两个@property (strong, nonatomic) IBOutlet UITextField *userName;@property (strong, nonatomic) IBOutlet UITextField *passWord;

2014-11-24 21:51:58 288

原创 SQLite数据库

先建立一个Student类声明:@property(nonatomic,copy)NSString *name;@property(nonatomic,copy)NSString *sex;@property(nonatomic,copy)NSString *age;

2014-11-24 21:43:42 305

原创 数据库,归档,反归档 修改删除文件夹

创建修改文件夹删除文件夹//NSFileManager //创建文件夹 //1.在Documents创建一个文件夹 NSString *documentPath=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]; // NSLog(@"do

2014-11-24 21:39:45 326

原创 获取DocumentsPath路径 简单文件写入

//访问沙盒路径 //1.Home主目录,里面有 :Documents.Library.temp 和一个应用程序 // NSLog(@"Home:%@",NSHomeDirectory()); //2,Documents NSString *DocumentsPath=NSSearchPathForDirectoriesInDoma

2014-11-24 21:29:51 1267

原创 监视,一旦改变执行下边的方法

- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.p=[[Person alloc] init]; self.p.name=@"Kim"; self.p.age=@"18";

2014-11-24 21:21:59 224

原创 自己封装的读取图片的工具 类目

Uiimage+ImageDownLoad

2014-11-24 21:13:00 265

原创 网络解析

先声明 #import "CWViewController.h"//get请求的url#define BASE_URL @"http://project.lanou3g.com/teacher/yihuiyun/phpJSON.php"//post请求的url#define BASE_URL_2 @"http://ipad-bjwb.bjd.com.cn/DigitalPublic

2014-11-24 20:57:41 322

原创 数据解析

1 xml sax解析 系统自带

2014-11-24 20:43:55 293

原创 appearance一键换肤

//一键换肤 [[UINavigationBar appearance]setBarTintColor:[UIColor blueColor]]; [[UITabBar appearance] setBarTintColor:[UIColor purpleColor]];

2014-11-24 20:19:14 315

原创 tabBarController简单属性

UIViewController *v1=[[UIViewController alloc] init]; v1.view.backgroundColor=[UIColor redColor]; UITabBarItem *v1BI=[[UITabBarItem alloc] initWithTabBarSystemItem: UITabBarSystemItemFavorites

2014-11-24 20:14:38 290

原创 block块简单传值

在NextViewController.h里边声明

2014-11-24 20:08:31 265

原创 设置textView根据输入的文字自动增加高度

#import "CWViewController.h"@interface CWViewController ()@end@implementation CWViewController- (void)viewDidLoad{ [super viewDidLoad]; //设置代理对象 self.textView.delegate=self; /

2014-11-24 19:57:33 464

原创 根据文字自定义Label和Cell高度

方法:+(CGFloat)cellHeight:(NSString *)text{ //死值和文字的高度 return 20+60+10+20+[[self class]textHeight:text];}//计算文字的高度+(CGFloat)textHeight:(NSString *)aString{ NSDictionary *dic=@{NSFont

2014-11-22 20:45:24 350

原创 TableViewCell添加和删除

延展声明{ UITableViewCellEditingStyle _style;}

2014-11-22 20:31:18 470

原创 代理传值

1:新建协议@protocol PassValueDelegate -(void)passValueWithLableString:(NSString *)labelString textString:(NSString *)textString;@end

2014-11-22 20:19:27 258

原创 UIScrollView和UIPageControl结合实现简单图片浏览

定义声明@interface RootView : UIView@property(nonatomic,retain)UIScrollView *scroll;@property(nonatomic,retain)UIPageControl *page;@end

2014-11-22 20:01:07 320

原创 UIScrollView基本属性

初始化UIImage *imag=[UIImage imageNamed:@"13.png"]; //滚动视图 self.scroll=[[UIScrollView alloc] init]; self.scroll.frame=[UIScreen mainScreen].bounds; //内容尺寸 self.scroll.conten

2014-11-22 19:51:18 294

简单练习通讯录,通过沙盒实现数据保存,Demo

功能不完整,不爱写了,注意Student.plist放到沙盒里

2014-11-25

简单计算器, IOS开发,

简单的计算器, + - * /,归零,后退,不过后退之后有点问题,显示是改变了,数值实际没变.

2014-11-25

取拼音首字母,第三方

取拼音首字母,比如王军 那就能取出W,用于简单通讯录分组使用

2014-11-25

Gdata Json 解析工具

Gdata Json 第三方解析工具

2014-11-24

简单相册 UIScrollView ,每个单视图都可以自由缩放

UIScrollView ,每个单视图都可以自由缩放

2014-11-24

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除