随笔分类 -  CocoaTouch

1 2 下一页

IOS RSA 加密方式
摘要:采用RSA加密方式,主要是生成公钥和私钥,公钥用来加密,私钥用来解密,至于其中如何实现的,网上有很多原理。参见如下:https://github.com/jslim89/RSA-objcPS:生成私钥$ openssl genrsa -out private_key.pem 512生成公钥$ ope... 阅读全文

posted @ 2015-06-24 21:31 小浪鼓 阅读(343) 评论(0) 推荐(0) 编辑

Swift 通用类型和通用函数 | Generic type and function
摘要:如果你想交换两个变量的值:1. 整型func swapTwoInts(inout a: Int, inout b: Int) {let temporaryA = aa = bb = temporaryA}2. 字符串func swapTwoStrings(inout a: String, inout... 阅读全文

posted @ 2015-06-22 14:37 小浪鼓 阅读(574) 评论(0) 推荐(0) 编辑

swift 如何删除subviews
摘要:scrollView.subviews.map { (var view) -> () in if (view is UIButton) { view.removeFromSuperview() }} 阅读全文

posted @ 2015-06-18 09:42 小浪鼓 阅读(1273) 评论(0) 推荐(0) 编辑

No Assistant Results
摘要:由于修改一些文件名字等会导致这个不工作。"Organizer" / "Projects" / 选择你的项目. "Delete" . 阅读全文

posted @ 2014-08-01 23:06 小浪鼓 阅读(551) 评论(0) 推荐(0) 编辑

URL中的空格
摘要:如果URL中带空格,在浏览器中可以显示,但是如果访问比如UIImage 获取图片的时候就会出现BAD URL.解决:NSString* urlText = @"70.84.58.40/projects/igolf/TipThumb/GOLF 58B.jpg";NSString* urlTextEscaped = [urlText stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 阅读全文

posted @ 2013-12-24 12:44 小浪鼓 阅读(595) 评论(0) 推荐(0) 编辑

史上最简洁的UITableView Sections 展示包含NSDicionary 的NSArray
摘要:这个最典型的就是电话本,然后根据A-Z分组, 当然很多例子,不过现在发现一个很简洁易懂的:1. 准备数据,定义一个dictionary来显示所有的内容,这个dictionary对应的value全是数组也就是:A -> A1, A2...B -> B1, B2......NSMutableDictionary *sections;2. 创建所有的KeysBOOL found; // Loop through the books and create our keys for (NSDictionary *book in self.books) //self.books 就是包含NSD 阅读全文

posted @ 2013-11-14 17:43 小浪鼓 阅读(1329) 评论(0) 推荐(0) 编辑

UITableView 显示在statusbar 下面
摘要:IOS 6 升到 IOS7 之后出现的状况新建一个工程,删除默认的ViewController,拖拽一个TableViewController到storyboard。即使没有勾选"Extend Edges Under {Top, Bottom, Opaque} Bars"或者self.edgesForExtendedLayout=UIRectEdgeNone;self.extendedLayoutIncludesOpaqueBars=NO;self.automaticallyAdjustsScrollViewInsets=NO;UITableView都会在status ba 阅读全文

posted @ 2013-11-11 21:24 小浪鼓 阅读(5675) 评论(0) 推荐(0) 编辑

Git ignore UserInterfaceState.xcuserstate
摘要:git rm --cached ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstategit commit -m "Removed file that shouldn't be tracked" 阅读全文

posted @ 2013-11-11 19:40 小浪鼓 阅读(1248) 评论(0) 推荐(0) 编辑

Implicit conversion from enumeration type 'enum CGImageAlphaInfo' to different enumeration type 'CGBitmapinfo' (aka) 'enum CGBitmapInfo')
摘要:The constants for specifying the alpha channel information are declared with the CGImageAlphaInfo type but can be passed to this parameter safely.Just use a cast to suppress the warning:CGBitmapInfo bitmapInfo =(CGBitmapInfo) kBitmapInfo; 阅读全文

posted @ 2013-11-02 23:20 小浪鼓 阅读(2149) 评论(0) 推荐(0) 编辑

IOS 6 和 IOS7 UITableViewCell上添加控件的获取
摘要:假设每个cell上面都有UIButton,怎么判断哪个Cell上的按钮被按下了呢?IOS6上-(IBAction)btnClick:(id)sender{ UIButton *btn = (UIButton *)sender; UITableViewCell *cell = [btn superView]; NSIndexPath *index = [self.tableView indexPathForCell:cell]; xxxx}IOS7上同样的方式你会发现btn的superView变成了UITableViewCellScrollView,那么IOS7怎么获取呢?可以按照这样的... 阅读全文

posted @ 2013-10-30 23:33 小浪鼓 阅读(5248) 评论(0) 推荐(0) 编辑

IOS 7 更改导航栏文字到白色
摘要:To hide status bar in any viewcontroller:-(BOOL) prefersStatusBarHidden{ return YES;}To change the status bar text to white color.set UIViewControllerBasedStatusBarAppearance to NO on .plist file first, then added this method:-(UIStatusBarStyle)preferredStatusBarStyle{ return UIStatusBarStyleL... 阅读全文

posted @ 2013-10-16 17:40 小浪鼓 阅读(1664) 评论(3) 推荐(1) 编辑

Mac Lion Configure Apache
摘要:mkdir ~/Sitesecho "My site works" > ~/Sites/index.html.ensudo vi /etc/apache2/httpd.conf#LoadModule php5_module libexec/apache2/libphp5.sotoLoadModule php5_module libexec/apache2/libphp5.so在/etc/apache2/下应该有一个用户配置文件,如果你是升级到Lion的你不会有,如果不存在的话就建立一个sudo vi /etc/apache2/users/.conf输入/Sites/& 阅读全文

posted @ 2013-10-15 16:18 小浪鼓 阅读(376) 评论(0) 推荐(0) 编辑

facebook login issue
摘要:If enable the facebook account in settings, when change account can't open the session.-(void)fbResync{ ACAccountStore *accountStore; ACAccountType *accountTypeFB; if ((accountStore = [[ACAccountStore alloc] init]) && (accountTypeFB = [accountStore accountTypeWithAccountTypeIdentifier:AC 阅读全文

posted @ 2013-08-29 08:28 小浪鼓 阅读(686) 评论(0) 推荐(0) 编辑

改变presentModalView大小
摘要:rc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; rc.modalPresentationStyle = UIModalPresentationFormSheet; [self presentModalViewController:rc animated:YES]; rc.view.superview.frame = CGRectMake(0, 0, 200, 200); 阅读全文

posted @ 2013-07-19 13:09 小浪鼓 阅读(276) 评论(0) 推荐(0) 编辑

FATAL ERROR: The persistent cache of section information does not match the current configu...
摘要:FATAL ERROR: The persistent cache of section information does not match the current configuration. You have illegally mutated the NSFetchedResultsController's fetch request, its predicate, or its sort descriptor without either disabling caching or using +deleteCacheWithName: NSError *error =... 阅读全文

posted @ 2013-06-01 17:30 小浪鼓 阅读(452) 评论(0) 推荐(0) 编辑

ios 向上和向下取整
摘要:向上:A被除数,B除数。(A+B-1)/B向下:floor() 阅读全文

posted @ 2013-04-01 18:23 小浪鼓 阅读(2772) 评论(0) 推荐(0) 编辑

Remove IOS icon glossy effect
摘要:直接上图: 阅读全文

posted @ 2013-02-09 13:05 小浪鼓 阅读(181) 评论(0) 推荐(0) 编辑

facebook api: faUnsupported get request 错误
摘要:这样的链接:http://graph.facebook.com/coorslight不工作,但是http://graph.facebook.com/cocacola确可以,为什么呢?因为facebook设置了年龄,前面的需要17岁以上(喝酒问题)解决:http://graph.facebook.com/coorslight?access_token=xxxxxx 阅读全文

posted @ 2013-01-15 13:42 小浪鼓 阅读(309) 评论(0) 推荐(0) 编辑

自定义 UITableViewCell
摘要:自定义Cell当然很简单,subclass UITableViewCell,分2种,一种自己定义Nib文件,一种不使用Nib文件:当然依照个人选择,我喜欢少写代码,使用Nib文件。1. 添加文件继承自 UITableViewCell。2. 使用Nib文件。添加User Interface -> View 文件,IB拖拽一个TableViewCell控件(删除原来的View)。3. 对自定义的Cell进行自定义,当然像你设计的那样的设计。4. 这里我主要说在 UITableView的delegate方法中的使用1)不使用nib文件,当然很简单了- (UITableViewCell *)ta 阅读全文

posted @ 2013-01-11 00:05 小浪鼓 阅读(402) 评论(0) 推荐(0) 编辑

UISearchDisplayController animate Cancel button
摘要:FUCK, SHIT, etc. 一系列脏话,日了等。为啥,因为烦的要命。主要是碰到了一个问题,我要在UIsearchBar的左边加一个按钮,这样UISearchBar的width就变小窄了。但是每次点击Cancel的时候,UISearBar又填充了整个视图的宽度。如下图:解决方法:-(void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController*)controller{// animate the search bar to the left ie. x=0[UIView animateWithDuration: 阅读全文

posted @ 2013-01-07 17:01 小浪鼓 阅读(882) 评论(0) 推荐(0) 编辑

1 2 下一页

导航

点击右上角即可分享
微信分享提示