关键字 for 的文章


由   YIem   撰写于    浏览:3807  评论:0
// 按钮 button UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; button.frame = CGRectMake(100, 300, 50, 30);// button.backgroundColor = [UIColor redColor];//[...]

由   YIem   撰写于    浏览:3234  评论:0
iOS-UI-用for循环铺各色小方块for (CGFloat i = 0; i < 375; i+= 75) { for (CGFloat j = 0; j < 667; j+=83.375) { UIView *view = [[UIView alloc] initWithFrame:CGRectMake(i[...]

由   YIem   撰写于    浏览:2979  评论:0
iOS-植物大战僵尸-UIVIew-UIImageView-#import "ViewController.h" @interface ViewController ()@end@implementation ViewController(void)viewDidLoad {[super viewDidLoad];// Do a[...]

由   YIem   撰写于    浏览:3747  评论:0
iOS-TOM猫-汤姆猫动画播放-UIImageVIew#import "ViewController.h" @interface ViewController ()@property (nonatomic, retain) UIImageView *img;@end@implementation ViewController([...]

由   YIem   撰写于    浏览:3869  评论:0
iOS-UI-View-实现七种颜色的--跑马灯效果-使用for循环铺view forin遍历颜色写在ViewController.m

由   YIem   撰写于    浏览:4749  评论:0
Objective-C考试- 蓝鸥3G-OC考试题 ※ 选择题(共40题,每题2分) 1、NSString *str = @“lanou”; [str retain]; [str autorelease];
此时str的引用计数是________。 答案:(D) A、0 B、1 C、2 D、以上[...]

由   YIem   撰写于    浏览:3624  评论:0
/* 完成以下需求 需求:1、定义 联系人类Contact。实例变量:姓名(拼⾳, ⾸字母大写)、性别、电话号码、住址、分组名称、年龄。 ⽅法:自定义初始化方法(姓名、电话号码)、显示联系⼈信息(重写description方法, 打印所有成员变量)。 2、在main.m中定义字典,分组管理所有联系人。分组名 为26个大写的英文字母。 3、可以[...]

由   YIem   撰写于    浏览:3334  评论:0
main.m/* 实现图书管理系统: 1、使⽤数组管理所有书籍。 2、数组可以添加、删除。 3、可以从数组根据书名查找书籍,并修改书籍的价格。 4、展⽰所有书籍清单(书名)。*/ // 创建 对象Book *book1 = [Book bookWithBookName:@"YIem" price:20]; Book *b[...]

由   YIem   撰写于    浏览:3039  评论:0
.main.m文件/* 定义Student类 1、属性有age,name,gender; 2、age使⽤用assign,name使⽤用retain,gender使⽤用copy; 3、重写age、name、gender的setter和getter⽅方法。 */if 0 Student *stu = [[Stude[...]

由   YIem   撰写于    浏览:2729  评论:0
///************* 不同类型转换 ****** // 整型转NSString int a = 3; NSString *str = [NSString stringWithFormat:@"%d", a]; NSLog(@"%@", str); // NS[...]

由   YIem   撰写于    浏览:3608  评论:0
/********* 方法2 简单类型对象的排序 ************/if 0// 创建排序对象 // 参数1 - 为简单类型对象可填写nil/@"self" // 为复杂类型对象可填写要进行排序的关键字, 如 按照Person的name成员排序 可填写@"name"; //参数2 [...]

由   YIem   撰写于    浏览:3001  评论:0
.main.m 代码 /********** 自定义类型对象的排序 *****************/ Person *per1 = [[Person alloc] initWithName:@"Long" age:22]; Person *per2 = [[Person alloc] initWithName:@[...]

由   YIem   撰写于    浏览:2860  评论:0
/*************** 简单对象的排序 *****************/ // 排序 可变数组NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"8", @"2", @"3", @"5", [...]

由   YIem   撰写于    浏览:3392  评论:0
// 集合 - 集合的元素具有唯一性 // 常用于判断交/并集等操作 /// 不可变集合// 创建集合 // 如果有重复元素 只保留一个 eg;@"2", @"2" NSSet *set = [NSSet setWithObjects:@"1",@"2" , @[...]

由   YIem   撰写于    浏览:6565  评论:0
OC- 字典套数组 -- 省市区// 获取文件 NSString *str = [NSString stringWithContentsOfFile:@"area.txt" encoding:NSUTF8StringEncoding error:nil]; // 按\n截取 NSArray *line = [str compon[...]

由   YIem   撰写于    浏览:3577  评论:0
省市区OC-字典-省市区-省数组套省字典套市数组套市字典套区数组数据文件:省市区TXT(数据)文件 NSString *str = [NSString stringWithContentsOfFile:@"area.txt" encoding:NSUTF8StringEncoding error:nil]; NSLog(@&qu[...]

由   YIem   撰写于    浏览:3095  评论:0
分别有三个文件.mian.mint main(int argc, const char * argv[]) { // 创建学生 Student *stu1 = [[Student alloc]initWithName:@"卞一" sex:@"男" age:@"20"]; Student [...]

由   YIem   撰写于    浏览:2798  评论:0
OC-可变字典(NSMutableDictionary)操作// 可变字典创建 NSMutableDictionary *mdic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"卞一", @"name", @"男", @&quo[...]

由   YIem   撰写于    浏览:2834  评论:0
OC-不可变字典(NSDictionary) 操作// 不可变字典 创建 NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"卞一", @"name", @"男", @"sex", @&quo[...]

由   YIem   撰写于    浏览:3049  评论:0
可变数组的各种操作// 可变数组 NSMutableArray *mArr = [NSMutableArray arrayWithObjects:@"aaa", @"bbb", @"ccc", @"ddd", @"eee", nil]; // 添加一[...]

由   YIem   撰写于    浏览:3116  评论:0
iOS 判断Objective-C 字符串是否已i开头 you结尾 NSString *str = [NSString stringWithFormat:@"i Love you"]; [str hasPrefix:@"i"] && [str hasSuffix:@"you&[...]

由   YIem   撰写于    浏览:3847  评论:0
//// AppDelegate.h// UI14_Xib//// Created by YIem on 15/12/24.// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.//import <UIKit/UIKit.h>@interface AppDel[...]

由   YIem   撰写于    浏览:4079  评论:0
//// AppDelegate.h// UI13_Block传值//// Created by YIem on 15/12/23.// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.//import <UIKit/UIKit.h>@interface Ap[...]

由   YIem   撰写于    浏览:4434  评论:0
//// AppDelegate.h// UI13_练习//// Created by YIem on 15/12/23.// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.//import <UIKit/UIKit.h>@interface AppDele[...]

由   YIem   撰写于    浏览:3800  评论:0
//// AppDelegate.h// UI12_TavleView编辑//// Created by YIem on 15/12/22.// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.//import <UIKit/UIKit.h>@interfac[...]