![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
移动开发
文章平均质量分 57
m7723sun
这个作者很懒,什么都没留下…
展开
-
PureLayout的部分用法
//例如,一排并列两个按钮//需要注意的是,先添加的父视图中,然后才能添加约束有效1)//第一个按钮的约束 [normalCarryBtn autoSetDimensionsToSize:CGSizeMake(([UIScreenmainScreen].bounds.size.width - 15 * 3)/2, 40)]; [normalCarry原创 2016-04-14 11:11:17 · 243 阅读 · 0 评论 -
安装cocoapods的时候显示没有权限:You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
还有就是安装cocoapods没有权限的时候,本来是$sudo gem install cocoapods ,但是显示没有权限,换成这句$sudo gem install -n /usr/local/bin cocoapods原创 2016-04-06 16:44:32 · 11024 阅读 · 0 评论 -
JPush极光推送问题,用户是否打开允许推送信息的开关,但不管设置没设置都会弹出警告说没有设置
但不管设置没设置都会弹出警告说没有设置这是我用的方法if(isIOS8){ BOOL isRemoteNotify = [UIApplicationsharedApplication].isRegisteredForRemoteNotifications; [self shareNotificationCheck:!isRemoteNotify]; }原创 2016-04-16 13:54:25 · 4203 阅读 · 0 评论 -
iOS中点击button切换背景图片与点击切换背景颜色问题的解释
//几个按钮共用一个方法,点击的时候切换图片问题-(void)databtn:(UIButton*)sender{ UIButton *btn = (UIButton *)sender; for (UIButton *buttonin _btnArray) { if (button==btn)原创 2016-04-16 15:21:36 · 861 阅读 · 0 评论 -
iOS的layer的anchorpoint与posion问题
每一个UIView内部都默认关联着一个CALayer, UIView有frame、bounds和center三个属性,CALayer也有类似的属性,分别为frame、bounds、position、anchorPoint。frame和bounds比较好理解,bounds可以视为x坐标和y坐标都为0的frame,那position、anchorPoint是什么呢?先看看两者的原型,可知都是CGPoi转载 2016-04-18 18:02:19 · 470 阅读 · 0 评论 -
获取字符串内容的宽度,label.text的宽度,以及textField.text的宽度问题
intrinsicContentSize//固有的,内容,尺寸- (void)viewDidLoad { [superviewDidLoad]; // Do any additional setup after loading the view, typically from a nib. UILabel *label=[[UILabel原创 2016-04-19 11:42:56 · 1113 阅读 · 0 评论 -
//将字典或者数组转化为JSON串
//将字典或者数组转化为JSON串- (NSData *)toJSONData:(id)theData{ NSError *error = nil; jsonData = [NSJSONSerialization dataWithJSONObject:theData原创 2016-05-04 11:59:56 · 234 阅读 · 0 评论 -
UITableViewCell的cell在屏幕中的位置问题
如何获得UITableViewCell 在屏幕中的位置//在解析省市县的json数据中,用到了前一个表的cell的位置问题,达到想要的效果 CGRect rectInTableView=[tableView1rectForRowAtIndexPath:indexPath]; CGRect rectInSuperView=[tableView1原创 2016-05-28 09:46:54 · 345 阅读 · 0 评论 -
window下生成苹果证书
Windows环境下生成Apple证书教程准备OpenSSL访问:http://slproweb.com/products/Win32OpenSSL.html 。并下载Win32 OpenSSL v1.0.1c Light版本(注意:版本可能会升级),如果您运行OpenSSL有问题,还需要下载Visual C++ 2008 Redistribut原创 2016-05-20 15:48:55 · 9314 阅读 · 1 评论 -
iOS自定义Log的宏
#define HGLog(...) NSLog(__VA_ARGS__)...表示宏里边的可变参数__VA_ARGS__表示函数里边的可变参数//因为NSLog很消耗资源的,如果上架的时候,需要注释掉,总不能一个一个注释,用宏的话,只需要注释掉方法就可以了例如:#define HGLog(...) //NSLog(__VA_ARGS__)原创 2016-06-21 13:51:16 · 427 阅读 · 0 评论 -
MJExtension使用,数据跟模型之间的相互转换
MJExtension使用(转)1. MJExtension使用指导(最新)2. MJExtension[模型字典]包含[模型字典数组]解析数据的bug及处理方法当自己看到原文的排版时,真的是。。。,自己花了点时间重新排版了下,分享出来!原文链接:IOS 字典模型互转框架 MJExtensionMJExtension能做什么?MJEx转载 2016-09-13 22:09:04 · 10169 阅读 · 0 评论 -
判断一个对象是否存在一些属性
[self checkIsExistPropertyWithInstance:instance verifyPropertyName:key]//对象,属性,可以与kvc,kvo相互联系。原创 2016-04-13 16:09:13 · 580 阅读 · 0 评论 -
时间戳转化成时间
NSTimeInterval timeInterval = [timeStr doubleValue]; NSDate *date = [NSDatedateWithTimeIntervalSince1970:timeInterval]; // NSTimeInterval interval = -[date timeIntervalSinceNow];原创 2016-04-01 18:29:08 · 353 阅读 · 0 评论 -
QQ气泡聊天核心代码与QQ列表问题
//高度随着输入字符串而自适应 NSString *string=@"";//默认字体大小是17号字 CGRect rect1=[stringboundingRectWithSize:CGSizeMake(160,MAXFLOAT) options:NSStringDrawingUsesLineFragmentOriginattributes:@{NSFon原创 2016-04-02 09:43:24 · 986 阅读 · 0 评论 -
关于NSRunLoop和NSTimer问题的深入理解
一、什么是NSRunLoopNSRunLoop是消息机制的处理模式NSRunLoop的作用在于有事情做的时候使的当前NSRunLoop的线程工作,没有事情做让当前NSRunLoop的线程休眠NSTimer默认添加到当前NSRunLoop中,也可以手动制定添加到自己新建的NSRunLoopNSRunLoop就是一直在循环检测,从线程start到线程end,检测inpu转载 2016-04-07 18:13:39 · 361 阅读 · 0 评论 -
DDMenu中添加手势是否有用的方法,为了在视图中添加手势起作用
首先在代理类中添加左右视图MenuViewController*rootview=[[MenuViewController alloc]init]; UINavigationController *rootnav=[[UINavigationController alloc]initWithRootViewController:rootview]; DD转载 2016-04-12 16:02:07 · 338 阅读 · 0 评论 -
iOS中NSAttributedString问题的一些解释
字符属性 字符属性可以应用于 attributed string 的文本中。 NSString *const NSFontAttributeName;(字体) NSString *const NSParagraphStyleAttributeName;(段落) NSString *const NSForegroundColorAttributeName;(字体颜色)转载 2016-04-13 15:41:27 · 722 阅读 · 0 评论 -
tableView一些细节问题用于开发
1.UITabelviewCell 的高亮状态的取消用以下方法: -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ //设置cell的背景是透明的。 cell.backgroun转载 2016-04-13 16:03:56 · 269 阅读 · 0 评论 -
从NSString中提取数字 NSScanner
-(int)findNumFromStr { NSString *originalString = @"a1b2c3d4e5f6g7h8i9j"; // Intermediate NSMutableString *numberString = [[[NSMutableString alloc] init] autorelease];转载 2016-04-13 16:07:52 · 1592 阅读 · 0 评论 -
修复U盘,SD卡等存储设备无法访问问题
1.打开终端,windows+R, cmd2.chkdsk i:/f3.回车自动开始修复,修复成功之后,就可以使用了原创 2017-01-16 11:10:51 · 3152 阅读 · 1 评论