自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 iOS中NSFileManager的使用

//NSFileManager用于判断        NSString * filePath=@"/Users/ms/Desktop/contact.json";        NSString * filePath1=@"/Users/ms/Desktop";        //1.文件是否存在        NSFileManager * fm=[NSFileManager

2016-01-08 12:54:48 330

原创 iOS中NSnumber的使用 NSValue的使用

nsnumber        int i=4;        float f=3.4;        NSNumber * n1=[NSNumbernumberWithInt:i];        NSNumber * n2=[NSNumbernumberWithFloat:f];        //把数字转成对象加到数组里        NSMutableArr

2016-01-08 12:51:54 374

原创 iOS中NSdata的使用

void test(){    NSDate * d1=[NSDatedate];//获取当前时间    NSLog(@"当前时间是:%@",d1);//0时区的时间,中国在东8区,小时加8就是中国时间    NSDateFormatter * formater=[NSDateFormatternew];//格式化输出时间    //yyyy表示4位的年份    /

2016-01-08 12:51:02 376

转载 ios开发中什么时候调用layoutSubviews

今天在写程序时候遇见layoutSubviews触发时候引起的问题。特来总结一下什么时候会触发layoutSubviews:layoutSubviews在以下情况下会被调用: 1、init初始化不会触发layoutSubviews 2、addSubview会触发layoutSubviews 3、设置view的Frame会触发layoutSubviews,当然前提是frame的值设置

2016-01-07 09:41:55 305

原创 ios中二维码的生成

//首先创建一个控件,点击的时候到一下一界面,下一个界面生成二维码  MyCardViewController * card=[[MyCardViewControlleralloc]init];            //带http默认会直接跳到网站           // card.strCard=@"http://www.baidu.com";            //

2016-01-04 17:27:04 243

原创 ios中摇一摇功能的使用

#import "infosYYYViewController.h"@interface infosYYYViewController (){    UIImageView * _iViewBird;}@end@implementation infosYYYViewController- (void)viewDidLoad {

2016-01-04 15:55:32 435

原创 ios中ARC模式下的内存管理

#import #import "Person.h"int main(int argc, const char * argv[]) {    @autoreleasepool {     #if 0                //在ARC中,把强引用变成弱引用,将对象=nil就可以        //在ARC中判断的一指针是强引用还是弱引用根据__stron

2015-12-27 16:26:50 281

转载 欢迎使用优快云-markdown编辑器

iOS开发学习笔记-UIScrollView的用法UIScrollView是用来在屏幕上显示那些在有限区域内放不下的内容。例如,在手机屏幕上显示内容丰富的网页或者很大的图片。在这种情况下,需要用户对屏幕内容进行拖动或缩放来查看屏幕或窗口区域外的内容。所以,ScrollView应该首先有一个窗口,用来显示内容,其次,还要有内容本身。这里的这个显示窗口就是UIScrollView,这个窗口可以是整个手机

2015-12-24 20:28:39 233

原创 ios中Block内访问函数局部变量时变量的改变情况

int (^bk)(int);void f1(void){    int a=1;  //在栈区    static int b=2; //在数据区    __blockint c=3;    //在栈区,由__block修饰的局部变量会在block代码中复制一份,但这个备份不在常量区,在数据区或堆区        printf("在f1中&a=

2015-12-24 09:59:34 2193

原创 ios中MRC下set方法的正确写法

#import #import "Cpu.h"#import "Computer.h"int main(int argc, const char * argv[]) {    @autoreleasepool {    #if 0//为什么要retain        Cpu * cpu=[[Cpu alloc]init];        Computer *

2015-12-21 19:32:27 3140

原创 ios中MRC的内存管理

Person * person=[[Personalloc]init];Person* person仅是一个指针,它创建了一个指针指向了一个对象[[Person alloc]init]这才是一个对象 Person * person是系统给他分配的空间,不需要我们来进行管理NSLog(@"对象的地址:%p,指针的地址:%p",person,&person);对

2015-12-21 19:29:14 347

原创 ios中自定义tabBar

#import "CustomTabBarController.h"#import "FirstViewController.h"#import "SecondViewController.h"#import "ThreeViewController.h"#import "FourViewController.h"@interface CustomTabBarControlle

2015-12-21 19:24:41 215

原创 ios中自定义tabBar

首先把TabBar作为根试图#import "CustomTabBarController.h"#import "FirstViewController.h"#import "SecondViewController.h"#import "ThreeViewController.h"#import "FourViewController.h"@interface Custo

2015-12-21 19:21:34 236

原创 用系统的TabBar不让系统渲染图片设置文字背影颜色

AppDelegate    self.window=[[UIWindowalloc]initWithFrame:[UIScreenmainScreen].bounds];    self.window.backgroundColor=[UIColorwhiteColor];    CustomTabBar * cus=[[CustomTabBaralloc]ini

2015-12-18 10:46:34 287

原创 纯代码实现cell嵌套cell

#import "ViewController.h"@interface ViewController ()UITableViewDelegate,UITableViewDataSource>{    UITableView * rootTable;    UITableView * tableView1;    NSMutableArray * ChildArr;

2015-12-14 18:48:59 517

原创 根据内容自动调节cell的高度

#define PATH @"http://www.oschina.net/action/api/tweet_list?uid=0&pageIndex=0&pageSize=10"#import "ViewController.h"#import "TweetModel.h"    //数据模型#import "AFNetworking.h"   //第三方库#import "GD

2015-12-07 16:13:53 550

原创 OC语法基础之一

//block遍历 效率最快    [arr enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {        //obj 数组的元素  idx 数组的索引  *stop是否停止遍历        if ([obj isEqualToString:@"2"] == YES) {           

2015-11-15 15:30:17 286

原创 UI之区头表头区尾表尾快速定位A—Z

#import"ViewController.h"@interface ViewController ()UITableViewDataSource,UITableViewDelegate>@property(nonatomic,strong)UITableView * tableV;@property(nonatomic,strong)NSMutableArray * dataA

2015-11-15 15:25:46 377

原创 UI之搜索框的创建Search

#import"RootViewController.h"@interface RootViewController ()UITableViewDataSource,UITableViewDelegate,UISearchResultsUpdating>//引入三个代理,一个用于搜索,两个用于建立cell@property(nonatomic,strong)UITableView

2015-11-15 15:24:36 680

原创 UI之CustomTableViewcell自定义cell(用xib)

- (void)viewDidLoad {    [super viewDidLoad];    [self createTableView];    [self createDataSource];}-(void)createTableView{    self.tableV=[[UITableViewalloc]initWithFrame:self.vi

2015-11-15 15:23:35 399

原创 UI之单个表视图的移动插入和删除

[btn addTarget:selfaction:@selector(doEdit:)forControlEvents:UIControlEventTouchUpInside];    UIBarButtonItem*item = [[UIBarButtonItemalloc]initWithCustomView:btn];    self.navigationItem.ri

2015-11-15 15:22:30 242

原创 UI之Tableviewcell

@interface ViewController ()UITableViewDelegate,UITableViewDataSource>- (void)viewDidLoad {    [super viewDidLoad];    [self createTableView];}- (void)createTableView{    //UITableVi

2015-11-15 15:21:30 233

原创 UI之用class类方法加for循环来批量创建tab bar标签栏

NSArray*controllerArr = @[@"ViewController1",@"ViewController2",@"ViewController3",@"ViewController4"];    NSArray*titleArr = @[@"第一页",@"第二页",@"第三页",@"第四页"];    NSMutableArray*arr = [NSMutable

2015-11-15 15:20:33 347

原创 UI之uiScrollView and uipageControl

//UIScrollView 继承自UIView    UIScrollView *scrollView = [[UIScrollViewalloc]initWithFrame:self.view.bounds];  //iOS7之后滚动试图会自动留白(自动向下调节64),NO禁止可以进行常规的计算 //把系统自动调节滚动试图的功能取消    self.automaticallyA

2015-11-15 15:17:14 282

原创 UI之tabBarItem

/tabBarItem是属于每一个试图控制器的    ViewController1 * VC1=[[ViewController1alloc]init];    UINavigationController *nav1=[[UINavigationController alloc]initWithRootViewController:VC1];    VC1.title=@"首页";

2015-11-15 15:15:59 294

原创 UI之把一个控件在屏幕内做任意拖拽并得到时时坐标

@interfaceViewController (){    UIView *_view;    UIImageView *_imageV;}@end@implementationViewController- (void)viewDidLoad {    [super viewDidLoad];    _view = [[UIView alloc]initW

2015-11-15 15:14:07 362

原创 UI之摇晃手机和触摸手势

摇晃手机-(void)motionBegan:(UIEventSubtype)motionwithEvent:(UIEvent *)event//摇晃触发。[UIViewanimateWithDuration:0.1 animations:^{//摇晃时的事件}completion:^(BOOLfinished) {摇晃结束后引导的事件}//-(void)motionEnded:(

2015-11-15 15:12:20 389

原创 UI之uiNavigationCtroller and navigationBar UIappearance navigationItem

//关联了rootViewController后,会自动调用viewDidLoad放法,而且通常只会调用一次-(void)viewWillAppear:(BOOL)animated//view将要显示-(void)viewDidAppear:(BOOL)animated//view已经显示-(void)viewWillDisappear:(BOOL)animated//view将要消失

2015-11-15 15:09:02 246

原创 UI之uiViewController

//关联了rootViewController后,会自动调用viewDidLoad放法,而且通常只会调用一次-(void)viewWillAppear:(BOOL)animated//view将要显示-(void)viewDidAppear:(BOOL)animated//view已经显示-(void)viewWillDisappear:(BOOL)animated//view将要消失

2015-11-15 15:06:42 282

原创 UI之textField文本框

UITextField *fieldV=[[UITextField alloc]initWithFrame:CGRectMake(10, 30, 300, 40)];//文本框输入   fieldV.borderStyle=UITextBorderStyleRoundedRect; //设置边框样式为圆角    //UItextField--->UIControl-->UIview  

2015-11-15 15:05:28 329

原创 UI之UiView和CAlayer基础

//UIVIew 是所有看见摸得着的控件的基类(直接或者间接的父类),UIView里所有的方法和属性它的子类都可以使用UIView  像UILabel UIButtonUIImageView等,把他们相似的功能抽离出来,写到一个类里面,这个类作为父类,也就是UIViewUIView 描述的一块矩形区域的视图的样式,通常会把UIView作为某些控件的父试图来使用//frame bound

2015-11-15 11:02:08 266

原创 UI之button基础

UIButton->UIControl->UIView->UIResponder->NSObject//继承关系系统样式:    UIButton * btn=[UIButtonbuttonWithType:UIButtonTypeCustom];    btn.frame=CGRectMake(100, 100, 100, 100);    [btn setTitle:@"文字"

2015-11-15 10:52:59 276

原创 UI之label基本使用

UILabel->UIView->UIResponder->NSObject//继承关系 生命周期: 当程序加载的时候 将要进入后台 已经过入后台 将要进入前台 已经进入前台 程序退出 self.window=[[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; self.window.backgroundCol

2015-11-15 10:41:54 407

空空如也

空空如也

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

TA关注的人

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