iOS
文章平均质量分 81
雨声不在
有问题请在相关博客下评论,或者给我邮件 [email protected]。:)
展开
-
苹果应用提审与NAT64
NAT64原创 2022-05-02 21:22:44 · 864 阅读 · 0 评论 -
iOS的维护记录
最近需要维护iOS的产品,整理下从代码提交到appstore的流程。fastlane打包出最新的ipa包把ipa包上传到appstorehttps://help.apple.com/app-store-connect/#/devb1c185036简单点可以下载Transporter App。下载后输入账号密码登录即可。拖拽上传即可。PS:以前的旧版本可以用APP-Launcher...原创 2019-12-12 10:30:03 · 245 阅读 · 0 评论 -
ios 文字变色
extension UILabel{ func paint(aText:String,aColor:UIColor?,startIndex:Int,endIndex:Int){ self.text = aText if (attributedText != nil && aColor != nil){ let attr =原创 2016-04-02 10:22:09 · 550 阅读 · 0 评论 -
swift set
As of Swift 1.2 (Xcode 6.3 beta), Swift has a native set type. From the release notes:A new Set data structure is included which provides a generic collection of unique elements, with full val转载 2016-03-23 14:55:14 · 487 阅读 · 0 评论 -
linker command failed with exit code 1 (use -v to see invocation)
今天xcode挂掉了,强行关闭后打开报这个错误:linker command failed with exit code 1 (use -v to see invocation)蒙了一小会,想起来可以清除:product clean原创 2016-03-25 21:42:21 · 339 阅读 · 0 评论 -
ios限制输入字数
有时候由于后台容量,需要在手机端限制输入字体数量,搜索一下,网上的方法基本上都是这样:- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{BOOL res = YES;if (textView.text.length >=原创 2015-08-17 18:29:38 · 683 阅读 · 0 评论 -
swift uiwebview 数字被点击默认成拨打电话
给文字中的电话号码和网址自动加链接1234textview.dataDetectorTypes = UIDataDetectorTypes.None //都不加链接textview.dataDetectorTypes = UIDataDetectorTypes.PhoneNumber //只有电话加链接转载 2016-04-29 16:50:30 · 1530 阅读 · 0 评论 -
swift URL生成
extension String{ func EncodeURL() -> String{ iflet url = self.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet(charactersInString:"`#%^{}\"[]|\\<> ").in原创 2016-04-19 20:34:34 · 727 阅读 · 0 评论 -
swift用xib 自定义View
swift用xib 自定义View原创 2016-06-03 11:08:08 · 7944 阅读 · 0 评论 -
swift json的序列化和反序列化
protocol yson{ func dicnarySerializer() -> AnyObject? func deserializer(jsonstring:String?) -> Bool func serialization() -> String? func deserialization(string:String) -> Bool原创 2016-06-27 16:01:29 · 3117 阅读 · 0 评论 -
swift 文件缓存
ios中也有沙盒的概念,就是本程序只能操作本程序中的沙盒部分的东西,如下图:在哪里放APP文件呢,apple说是放在Documents下Where You Should Put Your App’s FilesTo prevent the syncing and backup processes on iOS devices from taking a long time,原创 2016-06-23 16:01:16 · 831 阅读 · 0 评论 -
IOS(APP) 微信接入实践
最近交互出了一个分享到微信的功能,找了一下微信的开发平台,注册了一下我是按照这个教程做的:https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=1417694084&token=d43ebad7e6837f9223887057e50c5a5defe6a3原创 2016-08-08 11:04:00 · 361 阅读 · 0 评论 -
swift(ios) webview 的优化
最近一直在做手机H5的东西,网页写多了,测试也测出问题来了,打开十几个网页后,app出现无响应,app的webview界面出现黑屏等等奇怪的问题。我试了几遍,APP内存占用从20M飙升到100M+,到了100M的时候,xcode被断开了,然后问题就一个个冒出来了-_-! 搜索了一下,是uiwebview内存泄漏,然后我就兼容了wkwebview。wkwebview遇到的问题主要有几个:原创 2016-09-02 14:24:34 · 2784 阅读 · 0 评论 -
优化Hybrid app的原生支持
最近老板组织了一下技术分享,我分享了两点东西,最后老板的点评还是挺有意思的,多点图,尽量深入浅出,吃透了才能深入浅出,说得云里雾里的,多半是自己还没理解到位。我整理成博客吧。什么是Hybrid app?(图片来自https://zhuanlan.zhihu.com/p/21387961 :侵立删)(摘自百度百科:Hybrid App同时使用网页语言与程序语言开发,通过应用商店区原创 2016-09-14 20:55:45 · 1199 阅读 · 0 评论 -
如何解决 (IOS)UIWebview 内存泄漏
哈哈,其实详细的代码已经给了出来:http://blog.csdn.net/yeshennet/article/details/52413517这里补一点当时出现的情况吧:一开始是测试说手机用久了以后会卡,还有就是会闪退,会黑屏,出现一些奇奇怪怪的毛病。问题很严重,而且是用久了以后,听描述是偶发的。后来我用xcode中的工具查看了一下内存,如下图:每打开一个页面就会出现增加一点内存,退出也不会消失...原创 2016-09-14 21:42:14 · 6690 阅读 · 4 评论 -
ipa包的简单校验方法
最近在维护一个新的App,我可能要接手开发iOS部分的功能。回头看了一下,最后一次写iOS是2016年。那时候是用swift写的,参考我这些文章ipa包也是zip的压缩格式,可以这样解压7z x XXX.ipals -al# BCSymbolMaps# Payload提交到apple store的包一般比较大,是因为带了符号信息(BCSymbolMaps)。Payload中就是代码...原创 2019-01-24 09:50:12 · 1411 阅读 · 0 评论 -
IOS 隐藏输入法
self.tableView.endEditing(true)self.view.endEditing(true)原创 2016-01-06 17:42:29 · 493 阅读 · 0 评论 -
swift 解析GZIP
居然会自动解码,要不要这么智能,弄了快一个上午,傻逼了。。。。1、如果不能自动解析的话,就得用http://stackoverflow.com/questions/29694050/gzip-usage-in-swift using this NSData+GZIP.swift library to zip/unzip data from server and here原创 2015-12-03 11:25:53 · 1477 阅读 · 0 评论 -
swift 广播
var obj = Dictionary<String,String>()obj[Consts.Brocast.NotifyOp] = "222222222222"NSNotificationCenter.defaultCenter().postNotificationName(Consts.BrocastName.NotifyCome, object: obj)func ReceiveNoti原创 2015-08-08 11:50:27 · 845 阅读 · 0 评论 -
swift中使用object-c代码
上次写完调用就给忘了,今天用一个object-c的库,苦苦没引用上,才发现是连接没做好。目录时在supporting files -> iosclient-bridging-Header.h #import "MZTimerLabel.h"这个博客陆陆续续写了一些只言片语,当作是开发过程中的小记好了原创 2015-08-08 21:05:17 · 458 阅读 · 0 评论 -
tableView.reloadData()无效
用swift的时候,有一个奇怪的bug,我修改了cell.detailTextLabel?.text 的数值,断点也能断到里面有数值,但是就是不能显示出来。我初始值给的是一个”“的String,后来想是不是占位问题,初始值给了一个” “的String,然后就没问题了。这个应该是swift的bug吧?原创 2015-07-17 15:19:53 · 1424 阅读 · 0 评论 -
swift截断String末尾字符
CSDN越来越不好用了,登录要老半天,发表博客总是提示要重新登录!swift截断String 末尾字符可以这样做:var sb = Strings.emptyfor Id in iSelected.keys{ sb = sb + Id + ","}if(!sb.isEmpty){ return (sb as NSString).substringToIndex(count原创 2015-07-30 17:35:54 · 1938 阅读 · 0 评论 -
navigationItem中加入UISegmentedControl
模拟器上显示会飘移,感觉是navigationItem的初始化没完成,segmented就开始加载了,修改了一下初始值var seg = UISegmentedControl(frame: CGRectMake(160, 120, 8, 30))seg.insertSegmentWithTitle(Strings.CleanTable, atIndex: 0, animated: true)se原创 2015-07-30 17:34:11 · 408 阅读 · 0 评论 -
swift 中如何定义接口
var inteface:((Int) -> Void)?@IBOutlet weak var num: UIButton!override func viewDidLoad() { super.viewDidLoad() num.addTarget(self, action: "onNumClick:", forControlEvents: UIControlEvents.Tou原创 2015-08-01 11:48:24 · 1059 阅读 · 0 评论 -
xcode修改代码模拟器没有生效
最近有一个bug,我去修改,不管我怎么改,模拟器出来还是那个效果,试了十多分钟,才知道是xcode没有刷新代码,菜单product-> clean,问题终于解决了原创 2015-08-13 19:42:28 · 1953 阅读 · 0 评论 -
navigationItem “back”改为中文
困扰很久,后来才知道这个要在父页面设置self.navigationItem.backBarButtonItem = UIBarButtonItem(title: Strings.Back, style: UIBarButtonItemStyle.Bordered, target: nil, action: nil) self.navigationController?.pushViewContr原创 2015-08-14 11:59:02 · 532 阅读 · 0 评论 -
swift extension
还是在swift入门,最近找了一个类似android Toast的控件UIView+Toast UIView+Toast.h Toast Copyright (c) 2014 Charles Scalesse. Permission is hereby granted, free of charge, to any person obtaining a copy of thi原创 2015-07-23 16:44:39 · 462 阅读 · 0 评论 -
tablebview滚动到顶部
网上都是这一类代码[tableview setContentOffset:CGPointMake(0,0) animated:NO];应该是我有加了navigationItem,这个方法会遮住第一个item,后来找到了这个方法 let section = self.query.numberOfSections() if(section > 0 ){ let row原创 2015-09-12 10:36:41 · 443 阅读 · 0 评论 -
swift 拼音转化为英文字母
原来Object 也有这样的东西,弄个过来,发现是用C写的,原来是用object-c 去调用,再从swift中调用oc,然后刚好配遇上一个BUG,排序的问题,“sortInplace”这个函数,debug没问题,屎活就是发release版本crash,奈何晚上项目立刻就要发布,奈何奈何,越急越乱!!第二天上午把这个东西整个复制到swift上,幸苦一番,弄了一上午,最后定位到时sortInplace原创 2015-12-29 18:05:29 · 7618 阅读 · 0 评论 -
MAC如何获取IPHONE中的crash log
上一篇文章(http://blog.csdn.net/yeshennet/article/details/50428264)提到的定位了一个晚上的问题,其实还有一个原因是我是新手,TMD连crash log 放在哪里都不知道,摸索了许久。其实很简单,打开Xcode -> window -> devices 点击View Device Logs,里面就是各种app的log原创 2015-12-29 18:17:24 · 1174 阅读 · 0 评论 -
xcode svn 提交报错
最近视觉加了很多图标,用xcode的source control 提交代码死活出错,报错是: Illegal target for the requested operation去掉图片就能正常提交,无奈只能用脚本提交,提交代码如下: svn commit "iosclient" -m "img"iosclient 是路径, img 是提交注释原创 2015-12-17 15:55:27 · 514 阅读 · 0 评论 -
UITextField placeholder 改变默认字体颜色
这么基础的东西居然还要找好一会,做个记录:继承UITextFieldclass GsTextField: UITextField {}override func drawPlaceholderInRect(rect: CGRect) { if let placeholders = placeholder{ self.attributedPlaceholder原创 2015-12-17 18:20:05 · 558 阅读 · 0 评论 -
UICollectionView reloadData 遇上 layoutAttributesForSupplementaryElementOfKind “crash”
crash log:2015-12-20 15:48:46.076 iosclient[1993:46171] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds for原创 2015-12-20 15:56:53 · 4446 阅读 · 0 评论 -
cell?.viewWithTag 为 nil
cell?.viewWithTag为nil简单修正原创 2015-07-04 15:54:02 · 974 阅读 · 0 评论