![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
UI
起个名怎么这么难
这个作者很懒,什么都没留下…
展开
-
XML和json解析
DomTool.h#import <Foundation/Foundation.h> #import "Student.h"@interface DomTool : NSObject-(void)startDom; @property(nonatomic,retain)NSMutableArray *stuArr;+(NSMutableArray *)startXMLDom; @end DomToo原创 2016-01-03 11:46:02 · 342 阅读 · 0 评论 -
tableView联动(省市区)
#import "RootViewController.h"#define WIDTH self.view.frame.size.width #define HEIGHT self.view.frame.size.height@interface RootViewController ()<UITableViewDataSource,UITableViewDelegate>@property(non原创 2015-12-27 15:37:45 · 474 阅读 · 0 评论 -
Block
传值,只能从后往前传,需要三部..RootViewController.m 准备工作 先写用来实现功能的blockvoid(^newBlock)(NSString *)=^(NSString *str){ NSLog(@"%@",str); };1.要把block的遥控器从前往后通过属性进行传值,SecondViewController.h定义一个属性接受@property原创 2015-12-27 15:49:24 · 234 阅读 · 0 评论 -
tabbarController
在AppDelegate.m中写#import "AppDelegate.h" #import "RootViewController.h" #import "SecondViewController.h" #import "ThirdViewController.h" #import "FouthViewController.h" #import "FifthViewController.h" #原创 2015-12-27 15:52:58 · 191 阅读 · 0 评论 -
tableView简化写法
#import "MyTableViewController.h"@interface MyTableViewController () @property(nonatomic,retain)NSMutableArray *arr;@end@implementation MyTableViewController- (void)viewDidLoad { [super viewDidLoad原创 2015-12-27 15:57:45 · 204 阅读 · 0 评论 -
actionSheet和从相册选取图片
UIActionSheet:弹出提示框UIActionSheet *actionSheet=[[UIActionSheet alloc]initWithTitle:@"图片" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"从相册选取" otherButtonTitles:@"第一项",@"第二项", nil]; a原创 2015-12-27 16:01:30 · 405 阅读 · 0 评论 -
KVO通知中心
//KVO key-value-Observer 键值对观察者 //它主要功能就是用来监听,属性里的内容发生的变化 //监听的对象,必须是观察者的属性 //参数二:要监听的属性,要和keypath保持一致,否则不会触发方法 //参数三:触发的条件,就是旧值和新值变化的时候// self.stu=[[Student alloc] init]; //原创 2016-01-13 08:34:28 · 285 阅读 · 0 评论 -
键盘和输入框上移
动画和键盘一起向上平移定义两个属性@property(nonatomic,retain)UITextField *textField; @property(nonatomic,retain)UIView *myView;创建输入框和view- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup aft原创 2016-01-13 08:46:22 · 535 阅读 · 0 评论 -
基本动画效果(点赞,长按抖动,播放器转盘,水滴效果)
定义属性- (IBAction)trainsformAction:(id)sender;@property(nonatomic,retain)UIImageView *imageView; @property(nonatomic,assign)BOOL isRotation; @property(nonatomic,retain)UIImageView *secImageView; @propert原创 2016-01-13 09:04:40 · 4486 阅读 · 0 评论 -
UIView的四种动画(类似于下拉刷新的动画效果)
定义属性@property(nonatomic,retain)UIView *myView;创建- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.myView=[[UIView alloc原创 2016-01-13 10:29:07 · 780 阅读 · 0 评论 -
xib,AFN的网络请求,判断网络状态
使用方法和storyboard基本相同,但是只能创建view,tableViewcell可以直接铺,省去计算坐标的过程,比较省事创建xib文件的方式 1.在创建文件的时候,选择also create xib file,就会自动创建一个xib文件,文件和xib和关联好了,直接就可以用 2.需要在empty里创建一个xib文件,然后指定files owner,像文件里拖拽一个view,指定原创 2016-01-13 16:38:22 · 638 阅读 · 0 评论 -
多线程
主要有四种准备工作#import "ViewController.h" #import "MyOperation.h"@interface ViewController () - (IBAction)buttonAction:(id)sender; @property(nonatomic,retain)UIImageView *imageView; @end@implementation ViewC原创 2016-01-13 16:55:50 · 208 阅读 · 0 评论 -
加密和解密
有四种加密方式** 1.公钥私钥的加密和解密 ** //公钥和私钥称为非对称加密解密,通过公钥和私钥的钥匙对儿进行对数据加密和解密 //公钥一般存才客户端,私钥一般存在服务器端,而且私钥必须要加密,保证安全不猛泄露 //公钥对数据加密之后,将密文发送到服务器端,服务器再利用私钥对密文进行解密,服务器信息通过私钥进行加密,再通过客户端的公钥进行解密,从而显示内容 /原创 2016-01-14 09:03:53 · 998 阅读 · 0 评论 -
FMDB(用SQLite存数据)
完成查询,删除,添加,插入等功能1.先写一个单例+ (instancetype)shareDataBase;+ (instancetype)shareDataBase{ static DataBaseManager *manager = nil; static dispatch_once_t once; dispatch_once(&once, ^{ mana原创 2016-01-14 16:31:51 · 293 阅读 · 0 评论 -
自定义瀑布流
不规则的图片排列起来,改数据直接用就可以ZCGFlowLayout.h#import <UIKit/UIKit.h>@class ZCGFlowLayout;@protocol ZCGFlowLayoutDelegate <NSObject>-(CGFloat)ZCGFlowLayout:(ZCGFlowLayout *)flowLayout heightForRowAtIndexPath:(NSI原创 2016-01-14 16:40:08 · 271 阅读 · 0 评论 -
数据解析的基类
已经写好了,可以直接用,用的时候只需要写网址就好,model也已经写好了ZCGBaseModel.h#import <Foundation/Foundation.h>@interface ZCGBaseModel : NSObject+(NSMutableArray *)baseModelByArr:(NSArray *)arr; ZCGBaseModel.m#import "ZCGBaseMode原创 2016-01-14 16:52:37 · 275 阅读 · 0 评论 -
tableView下移,拉大图片
1.下移 //第一种 UIImageView *imageView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 200)]; imageView.image=[UIImage imageNamed:@"c4.jpg"]; //给tableView添加头视图,一般在头视图上放轮播图等 self.tableView原创 2015-12-27 15:35:13 · 385 阅读 · 0 评论 -
TableView编辑
准备工作 1.Student.h#import <Foundation/Foundation.h>@interface Student : NSObject @property(nonatomic,copy)NSString *name; @property(nonatomic,copy)NSString *phone; @property(nonatomic,copy)NSString *add原创 2015-12-27 15:31:49 · 406 阅读 · 0 评论 -
自适应高度
1.MyCell.h#import <UIKit/UIKit.h>@interface MyCell : UITableViewCell @property(nonatomic,retain)UIImageView *picImageView; @property(nonatomic,retain)UILabel *newsLabel;@end 2.MyCell.m@implementation M原创 2020-05-27 21:59:20 · 284 阅读 · 0 评论 -
Get和post网络请求
一般block用的比较多#import "ViewController.h"@interface ViewController ()<NSURLSessionDelegate> - (IBAction)asynAction:(id)sender; - (IBAction)synProtocolGET:(id)sender; - (IBAction)synProtocolPOST:(id)sender原创 2016-01-03 11:54:10 · 248 阅读 · 0 评论 -
CollectionView
瀑布流, 和tableview类似,但可以一行铺多个MyCell.h#import <UIKit/UIKit.h>@interface MyCell : UICollectionViewCell@property(nonatomic,retain)UIImageView *picImageView; @property(nonatomic,retain)UILabel *label;@endMyCe原创 2016-01-03 12:00:28 · 220 阅读 · 0 评论 -
网络数据获取的封装
可以直接用,无需再重新写, 下面是三个封装,用一个就可以 NetworkingTool.h#import <Foundation/Foundation.h>@protocol NetworkingToolDelegate <NSObject>-(void)bringResult:(id)result;@endtypedef void(^Block)(id result);typedef NS_EN原创 2016-01-03 12:17:30 · 246 阅读 · 0 评论 -
把数据保存到本地
Student.h#import <Foundation/Foundation.h>@interface Student : NSObject<NSCoding> @property(nonatomic,copy)NSString *name; @property(nonatomic,copy)NSString *sex; @property(nonatomic,assign)NSInteger a原创 2016-01-03 12:23:02 · 1534 阅读 · 0 评论 -
对本地文件的管理
//1.获取沙盒路径 NSString *path=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, 1, YES)lastObject]; //2.拼接文件夹路径 NSString *docPath=[path stringByAppendingPathComponent:@"dengdeng"];原创 2016-01-03 12:27:35 · 402 阅读 · 0 评论 -
沙盒存储收藏的练习(豆瓣)
AppDelegate.m#import "AppDelegate.h" #import "ViewController.h" #import "MyViewController.h" @interface AppDelegate ()@end@implementation AppDelegate - (BOOL)application:(UIApplication *)application di原创 2016-01-03 12:40:46 · 251 阅读 · 0 评论 -
文章标题
界面传值<协议六步>准备工作#import "AppDelegate.h" #import "RootViewController.h"@interface AppDelegate ()@end@implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptio原创 2015-12-27 14:23:13 · 229 阅读 · 0 评论 -
文章标题
UITableView 自带滑动效果 创建方法和UIView相同创建UITableView *tableView=[[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain]; tableView.backgroundColor=[UIColor yellowColor]; [sel原创 2015-12-27 14:38:28 · 206 阅读 · 0 评论 -
TableView界面传值和TableViewCell使用
初始化-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNilP{ self=[super initWithNibName:nibNameOrNil bundle:nibBundleOrNilP]; if (self) { self.arr=[NSMutableArr原创 2015-12-27 14:58:21 · 3119 阅读 · 1 评论 -
UINavigationController(导航控制器)
UINavigationController(导航控制器) 界面可以滑动,多用于做轮播图 //修改导航视图控制器的半透明效果,默认是YES self.navigationController.navigationBar.translucent=NO; //修改背景颜色 self.navigationController.navigationBar.barTintColor=原创 2015-12-27 14:07:51 · 214 阅读 · 0 评论 -
手势
手势控制图片,对其进行放大,缩小,旋转等操作代码块-(void)viewDidLoad{ // 1.先创建一个图片,要对其进行操作 self.view.backgroundColor=[UIColor whiteColor]; self.imageView=[[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 200,原创 2015-12-20 14:17:02 · 340 阅读 · 0 评论 -
控件:滑块,加减键
控件:滑块,加减键1.音量加减键UIStepper UIStepper *stepper=[[UIStepper alloc] initWithFrame:CGRectMake(100, 200, 100, 40)]; stepper.backgroundColor=[UIColor yellowColor]; stepper.tintColor=[UIColor redColor]原创 2015-12-20 14:38:49 · 611 阅读 · 0 评论 -
UIScrollView
UIScrollView UIScrollView可以让屏幕滚动AppDelegate.m#import "AppDelegate.h" #import "RootViewController.h"@interface AppDelegate ()@end@implementation AppDelegate - (BOOL)application:(UIApplication *)applica原创 2015-12-20 14:53:56 · 296 阅读 · 0 评论 -
UIPageControl
UIPageControl 给图片添加可以动的点AppDelegate.m#import "AppDelegate.h" #import "RootViewController.h"@interface AppDelegate ()@end@implementation AppDelegate - (BOOL)application:(UIApplication *)application did原创 2015-12-20 15:08:24 · 290 阅读 · 0 评论 -
model传值
1.Student.h#import <Foundation/Foundation.h>@interface Student : NSObject@property(nonatomic,copy)NSString *name; @property(nonatomic,copy)NSString *hobby; @property(nonatomic,copy)NSString *address; @原创 2015-12-27 15:15:08 · 535 阅读 · 0 评论 -
简易视频播放器
注:用xib拽的,可以去工程里找,这里只写代码部分可以实现视频播放,可横竖屏切换,可快进快退,暂停 AppDelegate.m#import "AppDelegate.h" #import "PlayerViewController.h" //#import "RootViewController.h"@interface AppDelegate ()@end@implementation App原创 2016-01-14 22:02:44 · 555 阅读 · 0 评论