摘要:scrollView.subviews.map { (var view) -> () in if (view is UIButton) { view.removeFromSuperview() }}
阅读全文
摘要:iOS Simulator -> Hardware -> KeyboardUncheck "Connect Hardware Keyboard"
阅读全文
摘要:如果URL中带空格,在浏览器中可以显示,但是如果访问比如UIImage 获取图片的时候就会出现BAD URL.解决:NSString* urlText = @"70.84.58.40/projects/igolf/TipThumb/GOLF 58B.jpg";NSString* urlTextEscaped = [urlText stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
阅读全文
摘要:这个最典型的就是电话本,然后根据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
阅读全文
摘要:idfriendiduser应该使用[user objectForKey:@"id"][friend objectForKey:@"id"]替换user.id;friend.id;
阅读全文
摘要: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
阅读全文