摘要: NSData *imagedata1=UIImagePNGRepresentation(btn.currentBackgroundImage);//按钮背景图片转NSData NSData *imagedata2=UIImagePNGRepresentation([UIImage imageNamed:@"资讯默认"]);//未选图片转NSData if([imagedata1 ... 阅读全文
posted @ 2019-04-18 20:56 纯粹的code 阅读(503) 评论(0) 推荐(0) 编辑
摘要: 原理:由于textView是继承自UIScrollview,所以会有ContentSize属性。所以可以通过文字内容的高度(也就是ContentSize)的高度和textView的高度之间的差值,设置内边距,就相当于把内容居中了。 阅读全文
posted @ 2019-04-16 19:38 纯粹的code 阅读(4042) 评论(0) 推荐(0) 编辑
摘要: UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"IDENTIFIER"]; [self.navigationC... 阅读全文
posted @ 2019-04-11 14:53 纯粹的code 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-03-07 17:29 纯粹的code 阅读(1626) 评论(0) 推荐(0) 编辑
摘要: //创建文件 NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *filePath = [docum... 阅读全文
posted @ 2019-03-06 14:53 纯粹的code 阅读(650) 评论(0) 推荐(0) 编辑
摘要: arc4random 不需要初始种子(用 srand 或 srandom),使它更加容易使用。arc4random 范围可达 0x100000000 (4294967296),而 rand 和 random 的上限在 RAND_MAX = 0x7fffffff (2147483647)。rand 经 阅读全文
posted @ 2019-03-04 10:29 纯粹的code 阅读(946) 评论(0) 推荐(0) 编辑
摘要: 1、 通知传值-一般常用于返回界面的时候,把返回前界面的值传到返回后界面。 2、block 反向传值 前一个界面获取后一个界面传过来的值 3、属性传值(一般适用于前一个界面传值给后一个界面) 4、数据持久化传值 NSUserDefaults是数据持久化的一种主要做存储使用。 阅读全文
posted @ 2019-02-28 16:48 纯粹的code 阅读(433) 评论(0) 推荐(0) 编辑
摘要: NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"xxx.txt"]; https://www.cnblogs.com/FBiOSBlog/p/5819418.html https://blog.csd 阅读全文
posted @ 2019-01-22 15:35 纯粹的code 阅读(808) 评论(0) 推荐(0) 编辑
摘要: NSString* str=@"hello";//存在代码区,不可变 NSLog(@"%@",str); //1.【字符串插入】 NSMutableString* str1=[[NSMutableStringalloc]initWithString:@"hello"];//存在堆区,可变字符串 NSLog(@"str... 阅读全文
posted @ 2019-01-22 10:06 纯粹的code 阅读(772) 评论(0) 推荐(0) 编辑
摘要: 听着歌,想起了快一年没回家了,听说家那边变化了很多,说实话,我是不太喜欢原来的事物变得我不认识的样子,可能是对开始的东西有情感了,新的东西不适应吧,也说不上来。本来有很多话要说的,突然就无话了,就这样吧。 阅读全文
posted @ 2019-01-19 12:29 纯粹的code 阅读(142) 评论(0) 推荐(0) 编辑