随笔分类 -  iOS

1 2 3 下一页

「mac」开启ssh服务(转)
摘要:原文地址:http://blog.csdn.net/cwj649956781/article/details/37913637 mac本身安装了ssh服务,默认情况下不会开机自启 1.启动sshd服务:sudo launchctl load -w /System/Library/LaunchDaem 阅读全文

posted @ 2017-10-31 16:17 trako 阅读(349) 评论(0) 推荐(0)

「ios」block块中使用self
摘要:【问题现象】 在block块中使用self时报警告:self strongly in this block is likely to lead to a retain cycle 【问题解决】 __block ViewController *blockSelf = self;_block = ^{ 阅读全文

posted @ 2017-09-04 12:54 trako 阅读(152) 评论(0) 推荐(0)

强制横屏
摘要:说明:目前在ios7,ios8上验证有效,注意该UIViewController不能添加到UINavigationController,只能presentViewController方式添加。- (BOOL)shouldAutorotate{ return NO;}- (NSUInteger)sup... 阅读全文

posted @ 2015-03-18 15:57 trako 阅读(250) 评论(0) 推荐(0)

去掉UITableViewController中header的黏性
摘要:转自“http://www.cocoachina.com/bbs/read.php?tid=124803”问题现象多个section的列表上下滚动时,header不会动,并且会覆盖掉cell,想header跟cell一样上下滚动问题解决//去掉UItableview headerview黏性(sti... 阅读全文

posted @ 2015-03-06 10:52 trako 阅读(198) 评论(0) 推荐(0)

No matching provisioning profiles found
摘要:问题现象之前用的真机调试一直都正常,现增加了一台iphone进行真机调试,就是一直提示:No matching provisioning profiles found,重新制作了provisioning profile,问题现象仍然一样。问题解决不经意间发现Certificates的日期明显与我之前... 阅读全文

posted @ 2015-02-28 10:37 trako 阅读(152) 评论(0) 推荐(0)

ios应用图标尺寸要求
摘要:参考官方文档“https://developer.apple.com/library/ios/qa/qa1686/_index.html”注意,需要在Info.plist文件中添加icon到“Icon files”中才生效,测试环境Xcode6.1,ios8512x512iTunesArtworkA... 阅读全文

posted @ 2015-01-22 10:12 trako 阅读(434) 评论(0) 推荐(0)

应用挂起后接受jpush消息没有触发回调问题
摘要:问题现象使用jpush推送消息,当手机端应用已进入后台时,收到消息后不会触发回调,只能点击通知栏的消息后才触发回调。问题解决如果是用jpush,在jpush上发送信息时勾选content-available可用,手机端会走回调didReceiveRemoteNotification-fetchCom... 阅读全文

posted @ 2015-01-21 09:02 trako 阅读(204) 评论(0) 推荐(0)

键盘弹出后,输入框自动弹到最顶部
摘要:- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{ UIScrollView *scrollView = (UIScrollView *)[self.view viewWithTag:WIN_TAG_SCROLLVIEW]; ... 阅读全文

posted @ 2015-01-21 08:59 trako 阅读(283) 评论(0) 推荐(0)

复制文本到粘贴板
摘要:UIPasteboard*pasteboard = [UIPasteboardgeneralPasteboard];pasteboard.string=self.label.text; 阅读全文

posted @ 2015-01-20 15:29 trako 阅读(139) 评论(0) 推荐(0)

ios语音播报TTS
摘要:问题现象客户要求支持离线语音播报文字问题解决ios7版本提供了该接口,目测效果还可以,支持中文,NSString *text = @"南昌阴转多云";AVSpeechSynthesizer *av = [[AVSpeechSynthesizer alloc] init];AVSpeechUttera... 阅读全文

posted @ 2015-01-16 10:53 trako 阅读(266) 评论(0) 推荐(0)

消除部分xcode警告
摘要:问题现象某些时候使用了一些deprecated的方法,每次编译xcode都会有提示,想去掉这些指定遗弃方法使用的提示问题解决#define WC_DeprecatedDeclarationsWarning(stuff) \do { \_Pragma("clang diagnostic push") ... 阅读全文

posted @ 2015-01-13 16:04 trako 阅读(264) 评论(0) 推荐(0)

NSDateFormatter dateFromString nil问题
摘要:问题现象已知服务器返回日期字符串“Thu Jan 01 08:00:00 CST 1970”,通过如下方式转换成时间戳失败(模拟器成功,真机失败),date为nil。 NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [fo... 阅读全文

posted @ 2015-01-09 14:04 trako 阅读(467) 评论(0) 推荐(0)

ios应用上架简单流程 2014-12-5
摘要:其实挺讨厌苹果这一套上架机制,审核周期长,而且网速又慢,但又没办法,只能上架到AppStore,无奈。上架前需要确保应用图标齐全,并在Info.plist中的Icon files添加了png图片,不然上架过程中的Validate通不过;1、上架前,需要Production类型的Certificate... 阅读全文

posted @ 2014-12-05 16:29 trako 阅读(211) 评论(0) 推荐(0)

正则表达式中支持[ ]等转义词
摘要:问题,我想查找诸如13[attach]的字符串(前面数字不定),在如下构建正则时失败,因为在ios中不支持\[转义词,需要使用\\u005B替代NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern... 阅读全文

posted @ 2014-11-13 15:48 trako 阅读(261) 评论(0) 推荐(0)

IOS 关闭键盘 退出键盘 的5种方式(转)
摘要:IOS 关闭键盘 退出键盘 的5种方式转自“http://blog.csdn.net/w88193363/article/details/24423635”分类:iphone2014-04-24 17:032197人阅读评论(0)收藏举报1、点击编辑区以外的地方(UIView)2、点击编辑区域以外的... 阅读全文

posted @ 2014-11-12 11:30 trako 阅读(425) 评论(0) 推荐(0)

去掉浮点多余的0
摘要:当arg为5.000时,用%f输出5.000,想输出5用%g,如下:[NSString stringWithFormat:@"%@:%g, %@:%g", L(@"STR_ID_TOPIC"), dto.topicCount, L(@"STR_ID_REPLY_NUM"), dto.replyCou... 阅读全文

posted @ 2014-11-06 15:27 trako 阅读(193) 评论(0) 推荐(0)

UIButton常用属性
摘要:UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];[button setFrame:CGRectMake(btnX, btnY, btnWidth, btnHeight)];button.layer.border... 阅读全文

posted @ 2014-10-30 11:28 trako 阅读(218) 评论(0) 推荐(0)

xcode6 ios8 的模拟器中的UITextField不弹出键盘
摘要:环境Xcode6.0.1, ios8问题现象在ios7模拟器中正常弹出键盘,但在ios8中不会弹出。解决方法设置模拟器,去掉勾选“connect Hardware keyboard“即可 阅读全文

posted @ 2014-10-28 14:53 trako 阅读(351) 评论(0) 推荐(0)

给UIImageView添加点击事件(转)
摘要:转自“http://blog.csdn.net/jwzbskywz/article/details/7699661”UIImageView *imageview1 = [[UIImageView alloc] initWithFrame:CGRectMake(125, 50, 229, 229)];... 阅读全文

posted @ 2014-10-27 10:50 trako 阅读(273) 评论(0) 推荐(0)

打印UIView视图层次关系(转)
摘要:转自“http://www.cnbluebox.com/?cat=15”感觉在调试的时候很实用,就记下来分享下,以前尽然不知道,还要不停的在控制台打subviews。UIView的方法recursiveDescription,在控制台断点时gdb或者lldb下,打1[view recursiveDe... 阅读全文

posted @ 2014-10-23 10:27 trako 阅读(250) 评论(0) 推荐(0)

1 2 3 下一页

导航