自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(24)
  • 收藏
  • 关注

原创 UINavigationController及界面传值

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; sel

2015-08-29 15:29:12 486

原创 UIScrollView+UIPageControl

#import "MainViewController.h"#define WIDTH self.view.frame.size.width#define HEIGHT self.view.frame.size.height@interface MainViewController ()<UIScrollViewDelegate>@end@implementation MainViewCont

2015-08-14 09:07:08 407

原创 UIControl和它的子类

UIControl的核心功能: 为控制控件通过addTarget:action:forControlEvents: 方法来添加事件; 通过remove:…来移除事件#import "MainViewController.h"#import <AVFoundation/AVFoundation.h>// (1).引用处理音频的系统文件@interface MainViewController ()

2015-08-13 20:02:47 431

原创 UIImageView+GestureRecognizer

第五讲: 设计模式,手势识别器 本讲内容一. Target/action设计模式 耦合: 耦合是衡量模块与模块之间关联程度的指标, 它是衡量一个程序写的好坏的标准之一 “高内聚,低耦合”是面向对象编程的核心思想// 试想 系统点击方法touches实现点击事件的劣(lie, 四声)势 每个视图的点击事件都不一样,如何处理? 我们无法预先知道这个视图点

2015-08-12 21:58:27 431

原创 UI_Delegate

#import <UIKit/UIKit.h>// 1.声明一份协议@protocol MyButtonDelegate <NSObject>//- (void)addTarget:(id)target action:(SEL)action;- (void)changeColor;@end@interface MyButton : UIView// 2.设置代理人的属性@property(non

2015-08-12 20:30:51 254

原创 UI_Target-Action

通过UIView来模拟一个button的点击#import <UIKit/UIKit.h>@interface MyButton : UIView// 通过MyButton实现button的点击效果// 1.通过自定义的方法,把目标和动作传到类的内部- (void)addNewTarget:(id)target Action:(SEL)action;// target目标,button执行哪一

2015-08-12 20:23:42 251

原创 UITouch 摇晃手势启动器

视图控制器#import "MainViewController.h"#import "MyView.h"@interface MainViewController ()@property(nonatomic, retain)UITextField *myTextField;@end@implementation MainViewController- (void)dealloc{ [

2015-08-12 20:17:29 301

原创 UIViewController

UIViewController:视图控制器 作用: 1.控制视图显⽰示,响应事件 2.分担AppDelegate的工作 3.实现模块独立,提高复用性 功能: 1.控制视图大小变换、布局视图、响应事件。 2.检测以及处理内存警告。 3.检测以及处理屏幕旋转。 4.检测视图的切换MVC概述 UIViewController是MVC设计模式的核心。 MVC是一个框架级的设计模式。

2015-08-08 20:11:04 481

原创 UIButton以及UITextField

对UILabel中所描述的程序运行流程以及代理人delegate方面的内容(ApplicationMain函数 UIApplicationDelegate)的一次练习#import "AppDelegate.h"@interface AppDelegate ()@property(nonatomic, retain)UITextField *textField;@property(nonatomic

2015-08-08 19:22:44 281

原创 自定义视图

实现一个功能,不是难事。写出高质量的代码却不是任何程序员都能做到的事。高质量代码特点:可复用,可移植,精炼等自定义视图:系统标准UI之外,⼰己组合而出的新的视图。 iOS提供了很多UI组件,借助它们,我们可以做各种程序。 尽管如此,实际开发中,我们还需自定义视图.积累自己的代码库.方便开发.自己封装的视图,能像系统UI控件一样,用于别的项目中,能大大降低开发成本,提高开发效率自定义视图步骤 根

2015-08-08 19:02:00 406

原创 UIButton

#import "AppDelegate.h"@interface AppDelegate ()@property(nonatomic, assign)BOOL isSelected;@property(nonatomic, assign)BOOL isClick;@end@implementation AppDelegate- (void)dealloc{ [_window releas

2015-08-08 16:04:30 397

原创 UITextField

#import "AppDelegate.h"@interface AppDelegate ()@end@implementation AppDelegate- (void)dealloc{ [_window release]; [super dealloc];}- (BOOL)application:(UIApplication *)application didFinishL

2015-08-08 15:12:11 344

原创 UILabel

#import "AppDelegate.h"@interface AppDelegate ()@end@implementation AppDelegate- (void)dealloc{ // 对应属性里边那个strong(retain) [_window release]; [super dealloc];}- (BOOL)application:(UIApplic

2015-08-05 21:30:38 289

原创 UIView详解

#import "AppDelegate.h"// 宏#define WIDTH self.window.frame.size.width#define HEIGHT self.window.frame.size.height// 通过改变视图中心点center的位置可以改变视图的位置// center.x = frame.origin.x + frame.size.width/2;//

2015-08-05 20:37:39 391

原创 OC_Block

// BaseModel.m+ (instancetype)baseWithName:(NSString *)name sex:(NSString *)sex{ // 多态的方式完成对象的创建 id obj = [[[self class] alloc] initWithName:name sex:sex]; return

2015-08-01 16:20:03 429

原创 OC内存管理

// 管理内存有三种方式 // 1.垃圾回收,java常见的管理内存方法,系统来检测对象是否被使用,是否被释放 // 2.MRC 手动管理引用计数,iOS管理内存的方式,程序员通过手动的方式来管理对象是否被释放 // 3.ARC 自动管理引用计数,基于MRC,系统自动的管理内存,以后我们还是先使用MRC,培养管理内存的习惯 Boy *boy = [[Boy alloc]

2015-08-01 14:22:28 356

原创 OC语言类的扩展

// setValue和setObject的区别 NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"1",@"2",@"3",@"4",@"5",@"6", nil]; // 当用setValue时,如果前边value里放的是一个空值nil,那么这个方法会被removeForK

2015-07-27 09:06:59 384

原创 枚举,类型转换,#NSData,NSSet,#NSDate

加星号的为重要内容(^o^)/~ // 迭代器 // 枚举 // 数组的枚举 NSArray *arr = @[@"1",@"2",@"3",@"4",@"5",@"6"]; NSEnumerator *enumerator = [arr objectEnumerator]; NSLog(@"%@", enumerator); NSString

2015-07-25 10:24:16 1529

原创 OC语言字典

// 创建字典对象// NSDictionary *dic = [[NSDictionary alloc] init];// NSDictionary *dict = [NSDictionary dictionary]; NSDictionary *diction = [[NSDictionary alloc] initWithObjectsAndKeys:@"1",@"2"

2015-07-25 09:40:48 321

原创 NSString以及NSArray的习题练习

// 作业1 // 将“⽂艺⻘年”改成“213青年”。 // 不可变字符串 NSString *str1 = @"文艺青年"; // 可变字符串 NSMutableString *str2 = [NSMutableString stringWithString:@"文艺青年"]; // 部分替换 NSLog(@"%@", [str1 strin

2015-07-25 08:42:18 550

原创 省市区字典

// 首先需要将省市区TXT文本放入工程里main下边,再从工程里将其拖拽到path的字面量里边,开始敲代码 NSString *path = @"/Users/dlios/Desktop/省市区限时代码/省市区限时代码/area.txt"; NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8

2015-07-24 19:59:54 2483

原创 OC语言数组

// Student.h文件@property(nonatomic, copy)NSString *name;- (id)initWithName:(NSString *)name; // Book.h文件@property(nonatomic, copy)NSString *name;@property(nonatomic, assign)CGFloat price;- (id)i

2015-07-21 19:16:41 416

原创 省市区数组

// 先找到文件对应的路径 NSString *path = @"/Users/dlios/Desktop/OC5_省市区数组/OC5_省市区数组/area.txt"; // 通过路径产生字符串,内容就是txt文本里的内容 NSString *str = [NSString stringWithContentsOfFile:path encoding:NSUTF8String

2015-07-21 17:39:01 2558

原创 OC语言字符串的多种方法

NSString *str = @"Chinese characters"; // length字符串的长度,它是NSString类型的一个只读属性 NSLog(@"%ld", str.length); // 通过指定的下标获取字符内容 NSLog(@"%c", [str characterAtIndex:0]); NSString *str1 = @"你好,很高

2015-07-20 18:49:04 400

空空如也

空空如也

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

TA关注的人

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