- 博客(22)
- 收藏
- 关注
原创 UITextView添加placeholder属性
1.先遵循UITextViewDelegate协议2.设置全局变量textLable或者自定义一个UITextView,将lable设置为其属性3.以下代码#pragma mark -#pragma mark 给UITextView添加placeholder // 设置代理人 content.delegate =self;
2015-03-24 09:09:09
511
原创 计算器简单版
//// AppDelegate.m// Demo-UI3-1//// Created by dllo on 15/3/6.// Copyright (c) 2015年 luojin. All rights reserved.//#import "AppDelegate.h"@interface A
2015-03-10 10:37:18
523
原创 小球弹跳:UI2-2
//// AppDelegate.m// Demo-UI2-2//// Created by dllo on 15/3/5.// Copyright (c) 2015年 luojin. All rights reserved.//#import "AppDelegate.h"@interface A
2015-03-10 10:34:12
484
原创 关灯游戏:UI3-2
//// MyViewController.m// Demo-UI3-2//// Created by dllo on 15/3/6.// Copyright (c) 2015年 luojin. All rights reserved.//#import "MyViewController.h"#import
2015-03-10 10:28:05
503
原创 UIButton 按钮 (孙子类)
按钮⽆无需释放(因为使⽤用的是类方法创建的button)解决不同形态下的外观 //创建不同类型的按钮// UIButton *button1 = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];// UIButton *button1 = [UIButton buttonWithType:UIButt
2015-03-10 10:23:41
691
原创 字体UIFont
字体UIFont//UIFont中的把所有字体的族的名字逐一遍历出来for (NSString *fnamein [UIFont familyNames]) { NSLog(@"%@", fname); //UIFont中的字体名字存放在数组中 NSArray *fontsNames = [UIFontfontNamesForFamily
2015-03-05 11:14:03
607
原创 UILable
1.创建UILable UILabel *lable = [[UILabelalloc] initWithFrame:CGRectMake(30,30,320,50)]; [self.windowaddSubview: lable]; [lablerelease];2.属性 //编辑文本内容 labl
2015-03-05 11:10:10
532
原创 视图UIView
视图UIView 1.创建视图的方法 CGRect rect1 = CGRectMake(20, 40, 100, 100);//创建矩形区域 UIView *redView = [[UIView alloc] initWithFrame:rect1];//创建视图及初始化 [self.window addSubview:redView];//将子
2015-03-05 08:54:49
386
原创 UI初级入门
1.UI中涉及到的部分控件的英文翻译UIapplication(剧场), UIView(演员), UIWindow(舞台), UIViewController(导演) UIWindow是UIView的子类(特殊的View)Frame:框架(边框) 针对于父视图坐标而言bounds: 边界 相对于自身的坐标系而言, 原点(0, 0)UIResponder:响应者
2015-03-05 08:54:25
443
转载 UITextField的常见属性
0. enablesReturnKeyAutomatically默认为No,如果设置为Yes,文本框中没有输入任何字符的话,右下角的返回按钮是disabled的。 1.borderStyle设置边框样式,只有设置了才会显示边框样式 text.borderStyle = UITextBorderStyleRoundedRect;
2015-03-04 19:33:45
450
原创 NSDate
//NSDate NSDate *now = [NSDatedate]; NSLog(@"%@", now); NSDateFormatter *formatter = [[NSDateFormatteralloc] init]; [formatter setTimeZone:[NSTimeZoned
2015-03-02 20:38:50
375
原创 Copy的简单实现
COPY Woman *w1 = [woman copy]; // w1 和 woman 的丈夫是同一个人 // 把 woman 的所有拷贝给 w1 [w1 live]; [w1 release]; [woman release]; [man release]; [boss re
2015-03-02 20:20:56
500
原创 协议
协议(protocol)是指两个或两个以上具有独立性的主体为了开展某项活动,经过协商后达成的一致意见。协议总是指某一层的协议。准确地说,它是在同等层之间的实体通信时,有关通信规则和约定的集合就是该层协议,例如物理层协议、传输层协议、应用层协议。我要说的这个协议是指界面进行数据传递时,根据自己的需求声明的协议.一个简单的结婚协议的实现:先创建俩个类,一个Boy类,一个Girl类.Gi
2015-03-01 23:23:13
453
原创 C语言中三个基础算法
//从任意范围内随机六个不重复的数/* NSMutableArray *mArray = [[NSMutableArray alloc]initWithCapacity:20]; int i = 0; while(i unsigned long random = arc4random() % (33 - 26 + 1) +
2015-03-01 22:55:12
527
原创 通讯录的简单实现
int main(int argc,const char * argv[]) { @autoreleasepool { // 作业1 //定义一个数组 存放分组 // , @"G", @"H", @"I", @"J",@"", @"K", @"L", @"M", @"N", @"O", @"P",
2015-03-01 22:47:52
561
原创 OC--简单的ATM算法
#include int selectCadrNum(int a[],int count, int enterCardNum);int selectPassNum(int a[],int index, int enterPassNum);int canGetMoney(int a[],int index, int enterMoney);int getMon
2015-03-01 22:22:11
1180
原创 内存管理
应用程序的内存管理:是一个过程,程序在运行时分配内存,使用内存,当程序结束时释放内存。一个编写有着良好编程习惯的的程序员应该尽可能少的占用内存。在OC中,它也可以被视为一种给数据和代码分配有限的内存资源的所有权。 在我们iOS开发过程中,内存分为5大区:堆区,栈区,全局静态区,常量区和代码区,而可以供我们自行管理内存的区域只有堆区(即存在堆区的对象).现在一个iPhone手机的内存只有1
2015-03-01 21:54:23
525
原创 数组排序的六种方法
int array[] = {5,1, 6, 4, 2, 9,8, 3, 7};int count = sizeof(array) /sizeof(array[0]);1. 冒泡排序原理:比较相邻的元素。如果第一个比第二个大,就交换他们两个。对每一对相邻元素作同样的工作,从开始第一对到结尾的最后一对。这步做完后,最后的元素会是最大的数。针对
2015-03-01 20:58:35
1344
原创 API之NSString的常见用法
/*//长度NSString *string = [[NSString alloc]initWithFormat:@"sDGijkhajkhKHklhDSHJgDst"];// NSLog(@"%lu", [string length]);//- (unichar)characterAtIndex:(NSUInteger)index; //输出某个下标指定位置的字符
2015-03-01 20:52:18
849
原创 API之NSSet的常见用法
/*NSSet *set1 = [[NSSet alloc] initWithObjects:@"张三 ",@"性别不明", @"⾮非地球物种", nil];NSArray *array = [set1 allObjects];for (int i = 0; i NSLog(@"%@", [array objectAtIndex:i]);}//是否包含对象i
2015-03-01 20:50:41
716
原创 API之NSDictionary的常见用法
/*NSDictionary *dic1 = [[NSDictionary alloc]initWithObjectsAndKeys:@"李四", @"name", @"不明",@"gender", nil];//字典中的对象可以重复存储//71 - (instancetype)initWithObjectsAndKeys:(id)firstObject, ...N
2015-03-01 20:42:29
557
原创 API之NSArray的用法
//创建数组NSArray *array = [[NSArray alloc] initWithObjects:@"aad", @"bab",@"ccca", nil];//遍历输出// for (int i = 0; i // NSLog(@"%@", [array objectAtIndex:i]);// }// //数组拷贝// NSArray *
2015-03-01 20:39:56
472
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人