自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 runtime选择器和消息转发处理

方法相关的操作函数// 调用指定方法的实现 id method_invoke ( id receiver, Method m, ... );// 调用返回一个数据结构的方法的实现 void method_invoke_stret ( id receiver, Method m, ... );// 获取方法名 SEL method_getName ( Method m );// 返回方法的实现 IMP

2016-02-25 11:42:40 341

原创 runtime 关联对象的使用

examplestatic NSString *key; static NSString *blockKey; static NSString *clickkey;- (void)viewDidLoad { [super viewDidLoad]; [self showDetailText]; [self addClass]; [self initUI]; vo

2016-02-24 18:16:38 374

原创 runtime 类和对象的使用和基本的数据结构

类和对象基本的数据结构struct objc_class { // typedef struct objc_class *Class; // 所有的类自身也是一个对象,这个对象的Class里面也有一个isa指针,它指向metaClass(元类) Class isa OBJC_ISA_AVAILABILITY;#if !__OBJC2__ Class super_class

2016-02-24 15:44:21 401

原创 Runtime Method Swizzling

//重写该方法,自动执行 +(void)load{ static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ Class class=[self class]; //获取方法的选择器 SEL originalSel=@selector(viewWillAppear:);

2016-02-25 13:49:22 273

原创 iOS SHA1算法

//哈希算法+ (NSData *)getHashBytes:(NSData *)plaintText { CC_SHA1_CTX ctx; uint8_t *hashBytes = NULL; NSData *hash = nil; // Malloc a buffer to hold hash hashBytes = malloc(kMChosenDiges

2016-02-16 12:56:00 493

原创 iOS 内存管理详解

在ARC下主要有以下几个关键字: 1.关键字 __strong 默认值,表示只要有强引用指针指向该变量,则该变量会一直存在。 2.关键字__weak 弱引用,表示若没有任何强引用指针指向该变量,会自动将变量的值置为空,即nil状态。 3.关键字 __autoreleasing 用于标示自动释放的变量 4.关键字__unsafe_unretained 不安全的弱引用,若没有任何强引用指针指向

2016-02-15 10:00:36 275

原创 iOS字符串处理详解

1.创建字符串: //字符串创建工厂 NSString*str1=[NSString stringWithFormat:@”%d, %d”,1,2]; NSString*str2=[NSString stringWithString:@”hello”]; NSString*str3=[NSString stringWithCString:”hello” encoding:NSUTF8Stri

2016-02-14 17:34:46 494

原创 iOS MVVM设计模式

MVVM的设计模式中,M(model) V(viewcontroller)  VM(viewmodel) 1.VM层主要是用来处理业务逻辑和数据访问层 2.M层就是MVC中的M层 3.V层从VM层获取数据,然后展示数据

2016-02-14 15:44:16 304

原创 iOS 控制器的生命周期

iOS中控制器的生命周期如下: .alloc->创建对象 .init->初始化对象 .loadView->从nib载入视图 .viewDidLoad->载入完成 .viewWillAppear->UIViewController对象的视图即将加入窗口时调用 .viewDidApper->UIViewController对象的视图已经加入到窗口时调用 .viewWillDisapper

2016-02-14 13:54:20 346

原创 iOS 程序的生命周期

1.applicationwillFinishLaunchingWithOptions: 程序将要启动 2.didFinishLaunchingWithOptions: 程序第一次启动时执行,如果直接启动,launchOptions是没有数据的,如果由其它应用启动,launchOptions是包含数据的 3.applicationWillResignActive: 应用进入后台,注销程序

2016-02-14 11:37:09 445

原创 iOS MVC设计模式

MVC设计模式在iOS是最常使用的一种设计模式,主要有M(model)  V(view)  C(controller) 这三层构成: C(控制层)控制M和V这两层 Cocoa version of MVC as a compound design pattern: Traditional version of MVC as a compound p

2016-02-14 11:15:43 249

原创 谈谈iOS的layoutSubviews机制

首先layoutSubviews这个方法会在什么情况下被调用呢?我们都知道layoutSubviews是UIView中的属性方法,即只要继承于UIView,就可以使用这个方法。 1.init初始化的时候不会触发layoutSubviews 2.addSubview会触发layoutSubviews 3.设置view的Frame,如果Frame发生改变,则触发layoutSubviews 4

2015-10-10 15:35:01 618

原创 瀑布流接口的设计以及应用(五)

// //  ViewController.h //  瀑布流 // //  Created by Jose on 15-7-11. //  Copyright (c) 2015年 Jose. All rights reserved. // #import @interface ViewController : UIViewController @end

2015-07-15 22:59:15 345

原创 瀑布流接口的设计以及应用(四)

// //  MyShopCell.h //  瀑布流 // //  Created by Jose on 15-7-12. //  Copyright (c) 2015年 Jose. All rights reserved. // #import "MyWaterFlowViewCell.h" @class MyWaterFlowView,MyShop; @in

2015-07-15 22:57:23 868

原创 瀑布流接口的设计以及应用(三)

// //  MyShop.h //  瀑布流 // //  Created by Jose on 15-7-12. //  Copyright (c) 2015年 Jose. All rights reserved. // #import @interface MyShop : NSObject @property (nonatomic, assign) CG

2015-07-15 22:54:46 481

原创 瀑布流接口的设计以及应用(二)

// //  MyWaterFlowViewCell.h //  瀑布流 // //  Created by Jose on 15-7-11. //  Copyright (c) 2015年 Jose. All rights reserved. // #import @interface MyWaterFlowViewCell : UIView @propert

2015-07-15 22:52:04 432

原创 瀑布流接口的设计以及应用(一)

// //  MyWaterFlowView.h //  瀑布流 // //  Created by Jose on 15-7-11. //  Copyright (c) 2015年 Jose. All rights reserved. // #import //枚举方法 typedef enum {     MyWaterFlowViewMarginTypeTop,

2015-07-15 22:47:32 739

原创 Eclipse 智能提示

1.JAVA  智能提示: 打开Eclipse->Window->Preferences->JAVA->Editor->Content Assist->Auto activation triggers for JAVA 添加24个大小写英文字母。 2. XML 智能提示: 打开Eclipse->Window->Preferences->XML->XML Files->

2015-05-26 12:16:16 263

原创 新浪微博开发之三十六(微博view)

// //  MyweiboTableViewCell.h //  新浪微博 // //  Created by Jose on 15-4-21. //  Copyright (c) 2015年 jose. All rights reserved. // #import @class MyweiboFrame; @interface MyweiboTableVi

2015-04-30 22:52:41 353

原创 新浪微博开发之三十五(微博frame)

// //  MyweiboFrame.h //  新浪微博 // //  Created by Jose on 15-4-20. //  Copyright (c) 2015年 jose. All rights reserved. //  微博frame #import #import "UIView+Extension.h" @class MyWeiboModel,

2015-04-30 22:50:42 313

原创 新浪微博开发之三十四(微博工具栏view)

// //  MyweiboToolBarView.h //  新浪微博 // //  Created by Jose on 15-4-21. //  Copyright (c) 2015年 jose. All rights reserved. // #import @class MyWeiboModel; @interface MyweiboToolBarView :

2015-04-30 22:38:08 577

原创 新浪微博开支三十三(原创和转发微博view)

// //  MyweiboDetailView.h //  新浪微博 // //  Created by Jose on 15-4-21. //  Copyright (c) 2015年 jose. All rights reserved. // #import @class MyweiboDetailFrame; @interface MyweiboDetailVi

2015-04-30 22:12:00 338

原创 新浪微博开发之三十二(原创微博和转发微博frame)

// //  MyweiboDetailFrame.h //  新浪微博 // //  Created by Jose on 15-4-20. //  Copyright (c) 2015年 jose. All rights reserved. //  原创和转发微博的frame #import #import "UIView+Extension.h" @class M

2015-04-30 22:08:32 338

原创 新浪微博开发之三十一(转发微博view)

// //  MyweiboRetweetedView.h //  新浪微博 // //  Created by Jose on 15-4-21. //  Copyright (c) 2015年 jose. All rights reserved. //   #import @class MyweiboRetweetedFrame; @interface Myweibo

2015-04-30 22:06:51 315

原创 新浪微博开发之三十(转发微博frame)

// //  MyweiboRetweetedFrame.h //  新浪微博 // //  Created by Jose on 15-4-20. //  Copyright (c) 2015年 jose. All rights reserved. //  转发微博frame #import #import "UIView+Extension.h" @class My

2015-04-30 21:35:13 372

原创 新浪微博开发之二十九(原创微博view)

// //  MyweiboOriginalView.h //  新浪微博 // //  Created by Jose on 15-4-20. //  Copyright (c) 2015年 jose. All rights reserved. // #import @class MyweiboOriginalFrame; @interface Myweibo

2015-04-30 21:28:14 360

原创 新浪微博开发之二十八(原创微博frame)

// //  MyweiboOriginalFrame.h //  新浪微博 // //  Created by Jose on 15-4-20. //  Copyright (c) 2015年 jose. All rights reserved. //  原创微博frame #import #import "UIView+Extension.h" @class MyW

2015-04-30 21:25:33 321

原创 新浪微博开发之二十七(全局变量)

// //  Global.h //  新浪微博 // //  Created by jose on 15-3-23. //  Copyright (c) 2015年 jose. All rights reserved. // #ifndef _____Global_h #define _____Global_h //添加全局 #define ScreenBou

2015-04-30 20:58:51 330

原创 新浪微博开发之二十六(上拉加载)

// //  MyLoadFootWeiboData.h //  新浪微博 // //  Created by jose on 15-4-2. //  Copyright (c) 2015年 jose. All rights reserved. // #import @interface MyLoadFootWeiboData : UIView +(instan

2015-04-30 20:46:32 428

原创 新浪微博开发之二十五(封装微博工具)

// //  MyWeiboTool.h //  新浪微博 // //  Created by Jose on 15-4-6. //  Copyright (c) 2015年 jose. All rights reserved. //  封装微博工具 #import #import "MyWeiboParams.h" #import "MyWeiboResult.h"

2015-04-30 20:39:48 315

原创 新浪微博开发之二十四(微博末读消息模型)

// //  MyWeiboUnReadCountResult.h //  新浪微博 // //  Created by jose on 15-4-8. //  Copyright (c) 2015年 jose. All rights reserved. //  微博末读消息模型 #import @interface MyWeiboUnReadCountResul

2015-04-30 20:34:43 474

原创 新浪微博开发之二十三(微博请求结果返回模型)

// //  MyWeiboResult.h //  新浪微博 // //  Created by Jose on 15-4-6. //  Copyright (c) 2015年 jose. All rights reserved. //  微博返回结果模型 #import @interface MyWeiboResult : NSObject /** 微博模型

2015-04-30 20:34:13 444

原创 新浪微博开发之二十二(微博请求参数模型)

// //  MyWeiboParams.h //  新浪微博 // //  Created by Jose on 15-4-6. //  Copyright (c) 2015年 jose. All rights reserved. //  微博请求参数模型 #import @interface MyWeiboParams : NSObject /** acce

2015-04-30 20:31:50 586

原创 新浪微博开发之二十一(微博模型)

// //  MyUserModel.h //  新浪微博 // //  Created by jose on 15-3-31. //  Copyright (c) 2015年 jose. All rights reserved. //  用户模型 #import @interface MyUserModel : NSObject /** string 用户昵称

2015-04-30 20:13:51 648

原创 新浪微博开发之二十(中间工具栏控制器)

// //  MyPlusController.h //  新浪微博 // //  Created by jose on 15-3-26. //  Copyright (c) 2015年 jose. All rights reserved. //  Plus控制器 #import #import "MyTextToolBar.h" @interface MyPl

2015-04-30 20:03:36 351

原创 新浪微博开发之十九(文本框工具栏)

// //  MyTextToolBar.h //  新浪微博 // //  Created by jose on 15-3-27. //  Copyright (c) 2015年 jose. All rights reserved. // #import @class MyTextToolBar; typedef enum{     MyCamera,  //相机

2015-04-30 19:54:18 400

原创 新浪微博开发之十八(文本框)

// //  MyTextView.h //  新浪微博 // //  Created by jose on 15-3-26. //  Copyright (c) 2015年 jose. All rights reserved. //  自定义输入文本框 #import @interface MyTextView : UITextView //提示文本 @pr

2015-04-30 19:51:34 303

原创 新浪微博开发之十七(图片工具)

// //  MyPictureTool.h //  新浪微博 // //  Created by jose on 15-3-30. //  Copyright (c) 2015年 jose. All rights reserved. //  图片工具 #import @interface MyPictureTool : UIView -(void)AddIma

2015-04-30 19:48:31 542

原创 新浪微博开发之十六(封装网络工具)

// //  MyHttpTool.h //  新浪微博 // //  Created by jose on 15-3-30. //  Copyright (c) 2015年 jose. All rights reserved. //  封装网络工具 #import @interface MyHttpTool : NSObject //get请求 +(

2015-04-30 19:33:00 483

原创 新浪微博开发之十五(MBProgressHUD的使用)

-(void)webViewDidStartLoad:(UIWebView *)webView{     hud=[[MBProgressHUD alloc]initWithView:self.view];     [self.view addSubview:hud];     hud.mode=MBProgressHUDModeDeterminate;     hud.labelText

2015-03-26 13:09:38 276

空空如也

空空如也

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

TA关注的人

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