随笔分类 -  iOS开发

摘要:1:首先 [objc] view plain copy print? [textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; [ob 阅读全文
posted @ 2016-09-18 09:28 ma_fighting 阅读(3245) 评论(0) 推荐(0)
摘要:类方法: 阅读全文
posted @ 2016-09-18 09:16 ma_fighting 阅读(1072) 评论(0) 推荐(0)
摘要://一个section刷新 NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; //一个cell刷新 NSIndexPath *... 阅读全文
posted @ 2016-09-16 16:41 ma_fighting 阅读(5829) 评论(1) 推荐(0)
摘要://两个按钮的父类view UIView *rightButtonView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 50)]; //历史浏览按钮 UIButton *historyBtn = [[UIButton alloc] in 阅读全文
posted @ 2016-09-14 15:53 ma_fighting 阅读(6545) 评论(0) 推荐(0)
摘要:- (void)refresh { MJRefreshGifHeader *header = [MJRefreshGifHeader headerWithRefreshingTarget:self refreshingAction:@selector(getData)]; NSMutableArray *images = [NSMutableArray array]; f... 阅读全文
posted @ 2016-09-14 15:32 ma_fighting 阅读(181) 评论(0) 推荐(0)
摘要:PHP 上传文件接口: iOS通过接口上传图片: 阅读全文
posted @ 2016-09-13 15:12 ma_fighting 阅读(5576) 评论(0) 推荐(1)
摘要://初始化并定义大小 UITextView *textview = [[UITextView alloc] initWithFrame:CGRectMake(20, 10, 280, 30)]; textview.backgroundColor=[UIColor whiteColor]; //背景色 阅读全文
posted @ 2016-09-12 19:15 ma_fighting 阅读(657) 评论(0) 推荐(0)
摘要:效果展示: 阅读全文
posted @ 2016-09-12 14:32 ma_fighting 阅读(306) 评论(0) 推荐(0)
摘要:效果展示: 阅读全文
posted @ 2016-09-12 14:29 ma_fighting 阅读(993) 评论(0) 推荐(0)
摘要:一、设置textView的行间距 1.如果只是静态显示textView的内容为设置的行间距,执行如下代码: // textview 改变字体的行间距 NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] 阅读全文
posted @ 2016-09-12 09:19 ma_fighting 阅读(1608) 评论(0) 推荐(0)
摘要:博主地址: http://yulingtianxia.com/blog/2014/11/05/objective-c-runtime/ 曾经觉得Objc特别方便上手,面对着 Cocoa 中大量 API,只知道简单的查文档和调用。还记得初学 Objective-C 时把[receiver messag 阅读全文
posted @ 2016-09-10 21:34 ma_fighting 阅读(385) 评论(0) 推荐(0)
摘要:/* 注意:要先导入ObjectC运行时头文件,以便调用runtime中的方法*/ #import <objc/runtime.h> @implementation NSObject (PropertyListing) 1、/* 获取对象的所有属性,不包括属性值 */ - (NSArray *)ge 阅读全文
posted @ 2016-09-10 21:30 ma_fighting 阅读(1476) 评论(0) 推荐(0)
摘要:在本系列的第一部分中,你已经学到超过你想像的关于并发、线程以及GCD 如何工作的知识。通过在初始化时利用 dispatch_once,你创建了一个线程安全的 PhotoManager 单例,而且你通过使用 dispatch_barrier_async 和 dispatch_sync 的组合使得对 P 阅读全文
posted @ 2016-09-10 21:27 ma_fighting 阅读(252) 评论(0) 推荐(0)
摘要:虽然 GCD 已经出现过一段时间了,但不是每个人都明了其主要内容。这是可以理解的;并发一直很棘手,而 GCD 是基于 C 的 API ,它们就像一组尖锐的棱角戳进 Objective-C 的平滑世界。我们将分两个部分的教程来深入学习 GCD 。 在这两部分的系列中,第一个部分的将解释 GCD 是做什 阅读全文
posted @ 2016-09-10 21:25 ma_fighting 阅读(751) 评论(0) 推荐(0)
摘要:#pragma mark - UIScrollView 内容竖向自适应、内容横向自适应方法 @interface UIScrollView (SDAutoContentSize) /** 设置scrollview内容竖向自适应 */ - (void)setupAutoContentSizeWithBottomView:(UIView *)bottomView bottomMargin:(CG... 阅读全文
posted @ 2016-09-10 15:33 ma_fighting 阅读(4523) 评论(0) 推荐(0)
摘要:1.隐藏TabBar: [cpp] view plain copy - (void)hideTabBar { if (self.tabBarController.tabBar.hidden == YES) { return; } UIView *contentView; if ( [[self.ta 阅读全文
posted @ 2016-09-09 21:47 ma_fighting 阅读(11435) 评论(0) 推荐(0)
摘要:只需要在自定义的PhotoContainerView中做一下判断就可以了 阅读全文
posted @ 2016-09-09 21:09 ma_fighting 阅读(625) 评论(0) 推荐(0)
摘要:加好友, 其实就是跟发消息一样 获取好友列表 同步好友列表 SDK内部默认会在每次登陆成功后与服务端同步好友列表,开发者可以通过设置disableAutoRequestAllContacts来禁用这个特性,也可以通过 1 - (void)requestAllContactsFromServerWit 阅读全文
posted @ 2016-09-09 20:58 ma_fighting 阅读(549) 评论(0) 推荐(0)
摘要:在开发iOS程序时,有时候需要将时间格式调整成自己希望的格式,这个时候我们可以用NSDateFormatter类来处理。例如: 字符说明 (:) 时间分隔符。在某些区域设置中,可以使用其他字符表示时间分隔符。时间分隔符在格式化时间值时分隔小时、分钟和秒。格式化输出中用作时间分隔符的实际字符由您的应用 阅读全文
posted @ 2016-09-09 16:21 ma_fighting 阅读(524) 评论(0) 推荐(0)
摘要:UIButton同时设置Title和Image后,默认是图片在左文字在右,如下图1,很多情况下我们希望图片在上图片在下,如下图2,只需要简单的几行代码,即可实现。 图1 (1)因为需要处理多个按钮,所以将实现代码封装为一个方法,把每个UIbutton实例作为参数传入即可,代码如下: [objc] v 阅读全文
posted @ 2016-09-09 15:28 ma_fighting 阅读(2568) 评论(0) 推荐(0)

历史天气查