贝塞尔 UIBezierPath
UIBezierPath CGRect rect = CGRectMake(50, 50, 50, 50);
// UIBezierPath *bezierPath = [UIBezierPath bezierPath];
// //CALayer的子类
// CAShapeLayer *layer = [CAShapeLayer new];
// //轮廓的颜色
// layer.strokeColor = [UIColor greenColor].CGColor;
// //填充颜色
// layer.fillColor = [UIColor yellowColor].CGColor;
// //轮廓线宽度
DownLoad 下载练习
DownLoad
- (IBAction)buttonDidPress:(id)sender {
if (self.downLoad) {
if (self.boolen) {
[self.downLoad pause];
self.boolen = NO;
} else {
[self.downLoad resume];
self.boolen = YES;
}
} else {
// 文件路径
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *path = [paths lastObject];
path = [path stringByAppendingFormat:@"%@\aa", path];
NSLog(@"*********** %@", path);
self.downLoad = [[DownLoadTask alloc] init];
[self.downLoad downLoadTaskWithURL:[NSURL URLWithString:@"http://61.155.212.122/hc.yinyuetai.com/uploads/videos/common/5B86014C1334A89EB08B30D386FAA9C1.flv?sc=1c7a66a8a8bf0612&br=783&rd=iOS"] WithLocation:path];
}
}
音乐播放器
//初始化音乐
//创建音乐文件路径
NSString *musicFilePath = [[NSBundle mainBundle] pathForResource:@"myMusic" ofType:@"mp3"];
//判断文件是否存在
if ([[NSFileManager defaultManager] fileExistsAtPath:musicFilePath])
{
NSURL *musicURL = [NSURL fileURLWithPath:musicFilePath];
NSError *myError = nil;
//创建播放器
_myBackMusic = [[AVAudioPlayer alloc] initWithContentsOfURL:musicURL error:&myError];
关灯游戏(view)
用view 做的关灯游戏 都是以前做的简单游戏 谁喜欢拿去用吧
关灯的游戏
用按钮做的关灯游戏,还有一个用view做的下面发出来
URLConnection 数据解析
URLConnection 数据解析 数据的同步请求 数据的异步请求
#pragma mark -- 异步Block
- (void)buttonBlock:(UIButton *)sender {
NSLog(@"异步Block");
// 1. 创建网址
NSString *string = kTtpodHomPageURL;
NSURL *url = [NSURL URLWithString:string];
// 2.设置网络请求
NSURLRequest *requst = [NSURLRequest requestWithURL:url];
// 建立异步连接,通过Block接受数据
[NSURLConnection sendAsynchronousRequest:requst queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse * _Nullable response, NSData * _Nullable data, NSError * _Nullable connectionError) {
if (!connectionError) {
//data 就是网络请求返回的数据
// 数据处理
id result = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
NSLog(@"%@", result);
}
}];
NSLog(@"同步?异步?");
}
XML解析数据
XML解析数据 iOS 中对xml格式的文件进行解析,取出当中的数据。
GestureRcognizer
GestureRcognizer UI手势 iOS
OC中的内存管理
OC内存管理:采用引用计数的方式管理内存
MRC :手动管理内存(手动管理引用计数)
ARC:自动管理内存(自动管理引用计数)--系统默认