摘要:通知方法: 调用通知: 移出监听 ARC的情况
阅读全文
摘要:/** *当开始拖拽表格的时候就会调用 * */ -(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { //退出键盘 [self.view endEditing:YES]; }
阅读全文
摘要://去除分割线 self.tableView.backgroundColor=[UIColor colorWithRed:235/255.0 green:235/255.0 blue:235/255.0 alpha:1.0]; self.tableView.separatorStyle=UITableViewCellSeparatorStyleNone; ...
阅读全文
摘要://屏幕的宽度 CGFloat screenW=[UIScreen mainScreen].bounds.size.width;
阅读全文
摘要:NSBundle的相关信息 1.一个NSBundle代表一个文件夹,利用NSBundle能访问对应的文件夹 2.利用mainBundle就可以访问软件资源包中的任何资源 3.模拟器应用程序的安装路径: /Users/aplle/资源库/Application Support/iPhone Simul
阅读全文
摘要:instancetype的类型表示上,跟id一样,可以表示任何对象类型 instancetype只能用在返回值类型上,不能像 id 一样用在参数类型上 instancetype 比 id 多一个好处 :编译器会检测 instancetype的真实类型
阅读全文
摘要:创建cell的步骤 1.新建一个继承自UITabelViewCell的类 2.重写 initWithStyle:ReuseIdentifier: 方法 添加所有需要显示的子控件(不需要设置子控件的数据和frame,子控件要添加到contentView中) 进行子控件一次性的属性设置(有些属性中需要设
阅读全文
摘要:方式1 :普通用法 #define MJNameFont [UIFont systemFontOfSize:14] 调用方法 1. 方式 2. 创建一个扩展NSString类 /** * 返回字符串所占用的尺寸 * * @param font 字体 * @param maxSize 最大尺寸 */
阅读全文
摘要:创建一个自定义代理 声明代理,外界可以进行调用(控件器) 通知代理 使用代理(实现方法)controller
阅读全文
摘要:/**点击添加*/ - (IBAction)loadBtnClick { //1.隐藏加载按钮 self.loadBtn.hidden=YES; //2.显示“正在加载” self.loadingView.hidden=NO; //3.显示更多的数据 //GCD dispatch_after(disp...
阅读全文
摘要:/**每一行显示怎样的ceLl*/ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //1.创建cell MJtgCell *cell=[MJtgCell cellWithTableView:tableView];...
阅读全文
摘要:IOS 9.0以上用UIAlertController 代替UIAlertView(实例转载) - (void)viewDidLoad { [super viewDidLoad]; // 创建一个BUTTON 点击显示弹框 UIButton *button = [UIButton buttonWit
阅读全文
摘要:使用缓存池(标识类型) 1.通过 一个 标识 去 缓存池 中寻找可循环得用的cell 2.如果缓存池找不到可循环得用的cell:创建一个新的cell(给cell贴个标识) 3.给cell设置新的数据 本地数据性能优化(实例)
阅读全文
摘要:- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. // 32bit颜色 : ARGB // Alpha : 8 // Red : 8 // Green...
阅读全文
摘要:// 设置行高(每一行的高度一致) self.tableView.rowHeight = 60; self.tableView.delegate = self; #pragma mark - 代理方法 /** * 每一行的高度不一致的时候使用这个方法来设置行高 */ - (CGFloat)tableView:(UITableVi...
阅读全文
摘要:tableView Style:Plain(头部标题 向上移 不会消失) tableView Style:Grouped(头部标题 向上移 会 消失)
阅读全文
摘要:self.scrollView.pagingEnabled = YES; - (void)nextImage { // 1.增加pageControl的页码 int page = 0; if (self.pageControl.currentPage == MJImageCount - 1) { page = 0; } else ...
阅读全文
摘要:定时器 CADisplayLink:时间间隔比较小(使用时间频率高)的时候用(适合小游戏中开发) NSTimer:时间间隔比较大的时候调用(适合图片轮放的时候用) //声明定时器 @property (nonatomic,strong) NSTimer *timer; 调用代理时 定时器 事例: #
阅读全文
摘要:// 隐藏水平滚动条 self.scrollView.showsHorizontalScrollIndicator = NO; ScrollView的代理(delegate) 当UIScrollView 发生一系列的滚动操作时,会自动通知它的代理(delegate)对象, 给它的代理发送相应的消息,
阅读全文
摘要://设置定时器(1秒后跳到一下题) [self performSelector:@selector(nextQuestion) withObject:nil afterDelay:1.0];
阅读全文
摘要:NSMutableString *tempAnswerTitle=[[NSMutableString alloc]init]; for(UIButton *answerBtn in self.answerView.subviews) { //判断按钮是否有文字 NSString *answerTitle=[answerBtn titleForState:U...
阅读全文
摘要:/** 控制状态栏的样式 */ -(UIStatusBarStyle)preferredStatusBarStyle { //白色 return UIStatusBarStyleLightContent; } //隐藏状态栏 -(BOOL)prefersStatusBarHidden { return YES; }
阅读全文
摘要:新建 shift + cmd + n 新建项目 cmd + n 新建文件 视图 option + cmd + 回车 打开助理编辑器 cmd + 回车 显示主窗口 cmd + 0 导航窗口 option + cmd + 0 工具窗口 在.m & .h之间切换 control + cmd + 上/下 按
阅读全文
摘要:输入可以变的对象或类型,要用<#name#>
阅读全文
摘要:interface ViewController () /**获取.plist数据*/ @property (nonatomic,strong) NSArray *aps; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; //九宫格的总列数 ...
阅读全文
摘要:.@property属性的用法 * weak(assign) : 代理\UI控件 * strong(retain) : 数组、模型)其他对象(除代理\UI控件\字符串以外的对象) * copy : 字符串(NSString) * assign : 非对象类型(基本数据类型int\float\BOOL
阅读全文
摘要:一.普通的字典模型:(实例) Aps.h //模型类:用来存放数据的类 #import <Foundation/Foundation.h> /** copy:NSString strong:一般对角 weak:UI控件 assign:基本数据类型 */ @interface Apps : NSObj
阅读全文
摘要:@interface ViewController () /**获取.plist数据*/ @property (nonatomic,strong) NSArray *apps; @end @implementation ViewController - (void)viewDidLoad { [su
阅读全文
摘要:@interface ViewController () @property (nonatomic,strong) NSArray *apps; //获取.plist数据 @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; //九宫格的总列数 i...
阅读全文
摘要:@property (nonatomic,strong) NSArray *apps; //获取.plist数据
阅读全文
摘要:@interface ViewController () - (IBAction)up; - (IBAction)big ; - (IBAction)leftRotate ; @property (nonatomic,assign)CGFloat ty; @end @implementation ViewController //向上移动,transform以第一次状态为准,作变化 -...
阅读全文
摘要:#pragma mark 控制器的view加载完毕的时候调用 //一般在这里进行界面的初始化 - (void)viewDidLoad { [super viewDidLoad]; NSLog(@"%s","ddffg"); //添加 //创建控件 UIButton *btn=[[UIButton alloc]init]; ...
阅读全文
摘要:将想要安装的xcode 帮助文档 版本,将 ‘帮助文档包’ 放入‘xcode 帮助文档安装路径’。再将Xcode软件重启。 xcode 帮助文档安装路径: 在‘应用程序’->Xcode软件 右击‘显示包内容’->Contents->Developer->Documentation->DocSets
阅读全文
摘要:将SDK想要装的版本,将SDK包放入‘mac中的SDK安装路径’。再将Xcode模拟器重启。 再打开Xcode模拟器,就可以在菜单栏的 ‘硬件’->’设备‘->’iPhone Retina 3.5-inch‘(根据当相发部的机子环境),就可以找到当前刚安装的SDK模拟器版本。 mac中的SDK安装路
阅读全文
摘要:1、默认约束 区别:mysql里面DEFAULT关键字后面是不用加括号的 复制代码 代码如下: --sqlserver CREATE TABLE emp ( id INT DEFAULT(12) ) --mysql CREATE TABLE emp ( id INT DEFAULT 12 ) 2、设
阅读全文
摘要:CASE和IF的区别: 在高级语言中,CASE的可以用IF来替代,但是在SQL中不行。CASE是SQL标准定义的,IF是数据库系统的扩展。CASE可以用于SQL语句和SQL存储过程、触发器,IF只能用于存储过程和触发器。在SQL过程和触发器中,用IF替代CASE代价都相当的高,相当的麻烦,难以实现。
阅读全文
摘要:以下的文章主要是对SQL Server临时表的创建的实际操作步骤,以及在实际操作中我们要用到的实际应用代码的介绍,我在一个信誉度很好的网站找到一个关于其相关内容今天拿出来供大家分享。 SQL SERVER临时表的使用 http://www.cnblogs.com/shineqiujuan/archi
阅读全文
摘要:http://www.2cto.com/database/201308/236398.html
阅读全文
摘要:#region Time calculation method public static string DelayTypeTime_1(DateTime ArrivalTime_1, DateTime DepartureTime_1, TimeSpan DesignatedTime_1) { if (ArrivalTime_1 < D...
阅读全文
摘要:declare @DisciplineID int declare @paramStringVal nvarchar(1000) declare @NPNT nvarchar(100) declare @DisciplineMapping nvarchar(100) declare @UEIDCount int declare @NPNTDisciplin...
阅读全文