- 博客(39)
- 资源 (2)
- 收藏
- 关注
原创 多线程
程序:由源代码生成的可执行应用。(例如:QQ.app) 进程:一个正在运行的程序可以看做⼀个进程。(例如:正在运⾏的QQ就是一个进程),进程拥有独⽴立运⾏行所需的全部资源。线程:程序中独⽴立运⾏行的代码段。(例如:接收QQ消息的代码) 一个进程是由一或多个线程组成。进程只负责资源的调度和分配,线程才是程序真正的执⾏行单元,负责代码的执⾏行。进程是分配资源的最小单位,线程是执行的最小单位死锁
2015-07-29 20:26:09 517
原创 iOS_NSNotificationCenter(通知中心简单建立)
通知中心 (先注册观察者,后发送通知)- (IBAction)buttonDidClicked:(UIButton *)sender { SecondViewController *secondVC = [[SecondViewController alloc] init]; [self.navigationController pushViewController:secondVC
2015-07-22 19:00:18 1056
原创 iOS_网络请求_代理方式
#pragma mark - 网络请求代理方式(异步)- (IBAction)DelegateButtonDidClicked:(UIButton *)sender { // 1、拼接 urlString,网址里面必须写 http:// NSString *urlString = @"http://ipad-bjwb.bjd.com.cn/DigitalPublication/pub
2015-07-21 17:40:50 1595
原创 iOS_POST_网络请求
同步的 post 请求#pragma mark - 同步的 post 请求- (IBAction)POSTSynButtonDidClicked:(UIButton *)sender { // 1、拼接 baseUrlString NSString *baseUrlString = @"http://ipad-bjwb.bjd.com.cn/DigitalPublication/pu
2015-07-21 17:30:50 2076
原创 iOS_GET_网络请求
同步的 get 请求#pragma mark - 同步的 get 请求- (IBAction)GETSynButtonDidClicked:(UIButton *)sender { // 1、网址里面必须写 http:// NSString *urlString = @"http://ipad-bjwb.bjd.com.cn/DigitalPublication/publish/Ha
2015-07-21 17:27:12 927
原创 JSON 数据的 JSONKit 解析
@property (nonatomic, strong) NSMutableArray *JSONArray;懒加载- (NSMutableArray *)JSONArray{ if (_JSONArray == nil) { self.JSONArray = [NSMutableArray array]; } return _JSONArray;}-
2015-07-20 17:35:11 676
原创 JSON 数据的系统解析
- (IBAction)jsonSystemButtonDidClicked:(UIButton *)sender { self.JSONArray = [NSMutableArray array]; // 1、拿到 json 文件的路径 NSString *path = [[NSBundle mainBundle] pathForResource:@"student" ofTy
2015-07-20 17:03:33 554
原创 xml 数据的 DOM 解析方式
需要使用第三方工具#import "GDataXMLNode.h"@property (nonatomic, strong) NSMutableArray *xmlDOMArray;- (IBAction)XMLDOMButtonDidClicked:(UIButton *)sender { // 1、拿到 xml 文件的路径 NSString *path = [[NSBundle
2015-07-20 16:58:49 682
原创 XML数据结构 SAX 解析
SAX解析 SAX:Simple API for XML。基于事件驱动的解析⽅方式,逐⾏行解析 数据。(采⽤用协议回调机制)NSXMLParser类 NSXMLParser是iOS⾃自带的XML解析类。采⽤用SAX⽅方式解析数据。 解析过程由NSXMLParserDelegate协议⽅方法回调 解析过程:开始标签->取值->结束标签->取值<?xml version = "1.0" en
2015-07-20 13:50:40 857
原创 UI_cell 注册问题
'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier ActiveListCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
2015-07-18 17:57:06 685
原创 UI_storyboard实现页面回调
新建类 注意继承关系#import <UIKit/UIKit.h>@interface CustomPopIt : UIStoryboardSegue@end#import "CustomPopIt.h"@implementation CustomPopIt#pragma mark - 实现 pop 方法- (void)perform{ UIViewController *vc = se
2015-07-17 17:42:48 501
原创 UI_Block传值
block 传值在第二个控制器里面声明block// 类似代理的协议typedef void(^TransmitValueBlock) (NSString *);@interface SecondViewController : UIViewController// 类似代理的定义@property (nonatomic, copy) TransmitValueBlock ablock;// 可
2015-07-16 17:55:27 793
原创 UI_UITabBarController
建立控制器 // 普通控制器 GroupViewController *groupVC = [[GroupViewController alloc] init]; SecondViewController *secondVC = [[SecondViewController alloc] init]; ThirdViewController *thirdVC = [[T
2015-07-16 14:26:17 613
原创 UI_UIImagePickerController(读取图片)
创建图片#pragma mark - 创建 photoImageView- (void)createphotoImageView{ self.photoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 70, 320, 390)]; self.photoImageView.backgroundColor =
2015-07-15 15:47:27 563
原创 UI_UItableView_AutoCell(自定义cell 高度)
#pragma mark 赋值方法-(void)setCellDataWithModel:(NewsModel *)sender{ self.titleLabel.text = sender.title; self.summaryLabel.text = sender.summary; CGFloat height = [NewsCell getHeight
2015-07-14 20:31:52 719
原创 UI_UItableView_AutoCell(自定义cell)
新建类@interface YadongCell : UITableViewCell方法#pragma mark - 赋值方法- (void)setCellDateWithYadong:(CinemaModel *)sender;#pragma mark - 自定义高度+(CGFloat)height;#pragma mark - 封装+ (instancetype)getYadongCellW
2015-07-13 22:16:57 773
原创 UI_Singleton(单例传值)
新建一个类继承 NSObject#import <Foundation/Foundation.h>@interface FinxingDate : NSObject#pragma mark - 创建单例方法// 作为返回值的区别 id(泛型指针) 不知道具体对象 instancetype可以动态识别哪种类型// 起名习惯,share + 类名//+ (ShareData *)+ (insta
2015-07-13 19:13:26 679
原创 UI_UITableView编辑
向左滑动#pragma mark - 设置 tableView 能否编辑- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{ return YES;}#pragma mark - 左滑动哪种编辑状态- (UITableViewCellEditingStyle
2015-07-11 14:23:19 656
原创 UI_模态页面跳转
前一页建立跳转事件 // 添加左边导航栏按钮 UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(leftButtonAction:)]; self.navig
2015-07-11 10:43:31 1122
原创 UI_UITableView_搭建
创建 tableViewUITableViewStyle 有两种选择#pragma mark - 创建 tableView- (void)createTableView{ // 枚举类型共有两个 self.mainTableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UI
2015-07-09 19:10:11 653
原创 UI_KVC赋值
使用KVC对person的属性进行赋值 [aperson setValue:@"yadong" forKey:@"name"]; [aperson setValue:@"man" forKey:@"sex"]; [aperson setValue:@23 forKey:@"age"]; NSLog(@"%@",[aperson valueForKey:@"name
2015-07-09 15:12:17 673
原创 UI_页面传值问题
属性传值 // 属性传值:最常用的一种传值方式 /** * 操作过程 * 1、在第二个控制器的.h文件里面书写属性 * 2、就在第一个页面创建第二个页面控制器方法里面,进行赋值操作 * 3、适用性(局限性):仅仅适用于从第一个页面传到第二个页面(从前往后传) */*1、在第二个控制器的.h文件里面书写属性// 设置属性用于传
2015-07-08 21:20:47 754
原创 UI_UINavigationController
创建 UINavigationController(导航控制器)在AppDelegate.m中创建 // 创建一个普通控制器 RootViewController *rootVC = [[RootViewController alloc] init]; // UINavigationController主要用来管理一组控制器(至少有一个),自带 view 但是不使用 UI
2015-07-08 21:00:27 607
转载 Xcode的debug调试
程序员日常开发中有大量时间都会花费在 debug 上,从事 iOS 开发不可避免地需要使用 Xcode。这篇博客就主要介绍了 Xcode 中几种能够大幅提升代码调试效率的方式。“If debugging is the process of removing bugs, then programming must be the process of putting them in.” ——Edsge
2015-07-07 22:45:23 754
原创 UI_UIScrollView/UIpageControl
创建UIScrollView@property(nonatomic, retain) UIScrollView *scrollView;@property(nonatomic, retain) UIImageView *opeImageView;@property (nonatomic, retain)UIPageControl *pageControl;#pragma mark - 创建滑动视
2015-07-07 22:10:33 881
原创 UI_UIStepper控件
#pragma mark - 创建控件 UIStepper- (void)createSteppper{ UIStepper *stepper = [[UIStepper alloc] initWithFrame:CGRectMake(130, 150, 50, 20)]; // 设置 stepper 最小值,默认是0 stepper.minimumValue = 20;
2015-07-06 18:39:13 669
原创 UI_UISwitch控件
#pragma mark - 创建控件 UISwitch- (void)createSwitch{ UISwitch *aSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(50, 150, 0, 0)]; [self addSubview:aSwitch]; [aSwitch release]; // 添加绑定事件
2015-07-06 18:37:15 890
原创 UI_UISlider控件
#pragma mark - 创建控件 UISlider- (void)createSlider{ // 也是继承与 UIControl UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(40, 80, 260, 27)]; // 设置颜色 slider.backgroundColor = [
2015-07-06 18:35:51 639
原创 UI_UISegmentedControl 控件
创建控件- (void)createSegmentControl{ UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:@[@"全部", @"分类", @"进行中"]]; segmentedControl.frame = CGRectMake(80, 30, 180, 30
2015-07-06 18:33:57 676
原创 UI_搭建MVC
新建RootViewController 继承于 UIViewController 新建RootView 继承于 UIView AppDelegate.m 中引入 #import "RootViewController.h"#pragma mark - 重写#pragma mark dealloc- (void)dealloc{ [_window release]; [su
2015-07-04 17:33:50 766
原创 UI_手势
轻拍手势 // 创建一个轻拍手势,同时绑定了事件 UITapGestureRecognizer *aTapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGRAction:)]; // 设置轻拍次数 aTapGR.numberOfTapsRequired = 1;
2015-07-04 15:24:48 661
原创 UI_Target/action 设计模式
RootView.m 中 UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; button.frame = CGRectMake(100, 100, 100, 40); [button setTitle:@"Target" forState:UIControlStateNormal]; [se
2015-07-04 10:18:19 778
原创 UI_UIImageView 基本操作
UI_UIImageView 常用方法// 使用ImageView 通过 name 找到图片 UIImage *image = [UIImage imageNamed:@"bg_2"]; // 添加 image 到 imageView 上 UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
2015-07-03 19:46:50 923
原创 UI_拖动View
方法一在touchesMoved中 // 获取到触摸的手指 UITouch *touch = [touches anyObject]; // 获取集合中对象 // 获取开始时的触摸点 CGPoint previousPoint = [touch previousLocationInView:self]; // 获取当前的触摸点 CGPoint
2015-07-03 12:44:12 504
原创 UI_触摸事件
基本触摸事件 #pragma mark - 重写方法 #pragma mark 触摸开始 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"touchesBegan"); NSLog(@"%s",__FUNCTION__); } #pragma mark - 触摸移动 - (void)t
2015-07-03 12:34:25 581
原创 封装代理
LTView.h@interface LTView : UIView { UILabel *_lable; UITextField *_textField;}#pragma mark - 自定义初始化方法- (instancetype)initWithFrame:(CGRect)frame text:(NSString *)te
2015-07-02 22:50:11 722
原创 MVC三层架构
新建ViewController类 继承 UIViewControllerAppDelegate.m#import "ViewController.h"#pragma mark - 重写#pragma mark dealloc- (void)dealloc{ [_window release]; [super dealloc];} //设置window sel
2015-07-02 22:37:08 562
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人