
iOS编程-基础知识
iOS 开发的基础语法
优惠券已抵扣
余额抵扣
还需支付
¥9.90
¥99.00
购买须知?
本专栏为图文内容,最终完结不会低于15篇文章。
订阅专栏,享有专栏所有文章阅读权限。
本专栏为虚拟商品,基于网络商品和虚拟商品的性质和特征,专栏一经购买无正当理由不予退款,不支持升级,敬请谅解。
猫头老鹰
Happy life happy coding
展开
-
UIButton
UIButton*button=[UIButtonbuttonWithType:(UIButtonTypeRoundedRect)]; button.frame=CGRectMake(150, 450, 100, 50); button.backgroundColor=[UIColorredColor];原创 2020-07-25 18:05:49 · 339 阅读 · 0 评论 -
UIImage
UIImageView*imageView=[[UIImageViewalloc]init]; imageView.frame=CGRectMake(55, 150, 300, 400); UIImage*image=[UIImageimageNamed:@"535BAB7AF85C3243E4BFB0CD163E1888.jpg原创 2020-07-25 18:05:38 · 323 阅读 · 0 评论 -
UIButton交互事件-点击button改变label文字
//button交互事件-点击button改变label的文字 [button addTarget:selfaction:@selector(gaibian)forControlEvents:UIControlEventTouchUpInside];原创 2020-07-25 18:05:26 · 2626 阅读 · 0 评论 -
UIImage 切圆形图片方法
//(1)创建image image=[[UIImageViewalloc]initWithFrame:CGRectMake(200, 200, 80, 80)]; image.backgroundColor=[UIColorredColor]; //(2)设置圆角 image.layer.masksToBounds=YES;原创 2020-07-25 18:05:01 · 915 阅读 · 0 评论 -
全局变量的设置及注意事项
{ // 要在任何处都可调用,必须设置全局变量 UILabel*liliang; UIImageView *image; UITextField *text;}设置全局变量后,创建控件时:UILabel*liliang=就应该写成liliang=UIImageView*image=就应该原创 2020-07-25 18:04:19 · 1746 阅读 · 0 评论 -
UITextField及代理方法
注:由于已经将UITextField*text定义为全局变量,所以在新建UITextField时只需写出它的名称text。 text=[[UITextFieldalloc]initWithFrame:CGRectMake(85, 220, 250, 40)]; text.borderStyle=UITextBorderStyleRoundedRect;原创 2020-07-25 18:04:01 · 723 阅读 · 0 评论 -
UISwitch
- (void)viewDidLoad { [superviewDidLoad]; UISwitch*mySwitch=[[UISwitchalloc]init]; mySwitch.frame=CGRectMake(150, 150, 300, 100); mySwitch.backgroundColor=[UICo原创 2020-07-25 18:03:37 · 274 阅读 · 0 评论 -
UISlider
- (void)viewDidLoad { [superviewDidLoad]; UISlider*slider=[[UISlideralloc]init]; slider.frame=CGRectMake(52, 200, 300, 50); slider.backgroundColor=[UIColorwhi原创 2020-07-25 18:03:25 · 326 阅读 · 0 评论 -
UIProgress
- (void)viewDidLoad { [superviewDidLoad]; UIProgressView*progressView=[[UIProgressViewalloc]initWithProgressViewStyle:UIProgressViewStyleBar]; progressView.f原创 2020-07-25 18:03:00 · 781 阅读 · 0 评论 -
UITextView
#import "ViewController.h"@interface ViewController (){ UITextView*textView; UITextField*textField;}@end@implementation ViewController- (v原创 2020-07-25 18:01:29 · 352 阅读 · 0 评论 -
NSString
//(一)不可变字符串////1.字符串长度的比较(相等为1,不相等为0)// NSString*str=@"hello world";// // NSString*str2=@"hello world";// // BOOL ret=[str isEqualToString:str2];// NSLog(@原创 2020-07-24 23:25:05 · 332 阅读 · 0 评论 -
NSArray
- (void)viewDidLoad { [superviewDidLoad];// Dog*dog=[[Dog alloc]init];// (一)不可变数组// NSArray*array=[[NSArray alloc]initWithObjects:@"one one",@"two",@"three" ,dog,nil];原创 2020-07-24 23:24:52 · 552 阅读 · 0 评论 -
NSDictionary
- (void)viewDidLoad { [superviewDidLoad];//(一)字典的方便之处就在于,可以迅速的查找出需要的值// NSDictionary*dict=[[NSDictionary alloc]initWithObjectsAndKeys:@"One",@"1",@"Two",@"2",@"Three",@"3", nil];原创 2020-07-24 23:24:40 · 583 阅读 · 0 评论 -
NSNumber[将基础的数据类型存储成对象]
- (void)viewDidLoad { [super viewDidLoad]; //NSNumber不是一个类,实际上是一类簇(群类),是数据大联盟,可以通过它调用不同的数据对象 NSNumber*intNumber=[[NSNumber alloc]initWithInt:5];//整形 NSNumber*floatNumber=原创 2020-07-24 23:24:28 · 465 阅读 · 0 评论 -
NSSet / NSMutableSet / NSIndexSet / NSMutableIndexSet
- (void)viewDidLoad { [super viewDidLoad];//(一)NSSet静态集合//1.NSSet是没有顺序的集合// NSSet*set=[[NSSet alloc]initWithObjects:@"One",@"Two",@"Three",@"Four",nil];// NSLog(@"%@",set)原创 2020-07-24 23:24:13 · 1050 阅读 · 0 评论 -
NSData [ NSData 与NSString的相互转换]
- (void)viewDidLoad { [superviewDidLoad]; //将字符串转化成 NSData NSString*str=@"hello world"; NSData*data=[strdataUsingEncoding:NSUTF8StringEncoding]; NSLog(@"%@",str)原创 2020-07-24 23:23:58 · 2229 阅读 · 0 评论 -
NSValue
- (void)viewDidLoad { [superviewDidLoad]; 1.将结构体的数据存储到对象中,从而实现对象能够实现的方法(发送数据……) //NSValue*value=[[NSValue alloc]initWithBytes:&sctt objCType:@encode(struct sct原创 2020-07-24 23:23:48 · 263 阅读 · 0 评论 -
UILable &UIImageView& UIButton布局
#import "ViewController.h"@interface ViewController (){ UILabel*lable; }@end@implementation ViewController- (void)viewDidLo原创 2020-07-24 23:23:25 · 294 阅读 · 0 评论 -
textfield 登录页面Number&Password的同时判定
//// CONE.m// TableView//// Created by 李小亮 on 16/6/8.// Copyright © 2016年 李小亮. All rights reserved.//#import "CONE.h"@interface CONE (){ UITextField*number; UI...原创 2020-07-24 23:22:55 · 419 阅读 · 0 评论 -
UITableView(表示图)
#import "ViewController.h"#import "one1.h"#import "two2.h"#import "three3.h"#import "four4.h"#import "five5.h"#import "six6.h"#import "seven7.h"#import "ei原创 2020-07-24 23:22:08 · 311 阅读 · 0 评论