ios
梵虚
万物皆虚,万事皆允
展开
-
IOS-关于委托
写委托的时候,需要注意进行判断if (self.delegate && [self.delegate respondsToSelector:@selector(UpLoadFileFailed:fileConfig:)]) {}原创 2014-04-30 10:45:07 · 473 阅读 · 0 评论 -
IOS-UIImageView 图片自适应大小
imageView.contentMode = UIViewContentModeScaleToFill; imageView.clipsToBounds = YES; imageView.autoresizesSubviews = YES; imageView.autoresizingMask = U原创 2014-08-26 14:57:09 · 4466 阅读 · 0 评论 -
mac os X下使用root用户
在mac os X下使用su指令想暂时切入root用户下,输入密码会发现无法登陆root用户。这是因为默认情况下root用户密码未被设置,先用passwd命令来设置一下:passwd rootChanging password for root.Old Password:New Password:Retype New Password:passwd:转载 2014-10-08 11:03:46 · 638 阅读 · 0 评论 -
iOS-UITableView使用reloadSections刷新section问题
一般使用直接使用#define Secons 5 行数 [famousTangTable reloadSections:[[NSIndexSet alloc] initWithIndex:Secons] withRowAnimation:UITableViewRowAnimationAutomatic];刷新某一行时会使那一行的section消失掉,老外给的解决方法是翻译 2014-12-22 11:57:56 · 15324 阅读 · 0 评论 -
IOS-关于NSString的格式化的一点理解
NSString *string = [NSString stringWithFormat:@"%@ %@",model.fdTalkName,model.fdContent];在格式化字符串的时候,可以给文字加入字体颜色,字体大小等。原创 2015-01-12 16:28:13 · 1031 阅读 · 0 评论 -
IOS-UITableViewCell的渐变色
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ [cell setBackgroundColor:[UIColor clearColor]]; CAGradientLa转载 2014-12-24 23:05:58 · 2538 阅读 · 0 评论 -
IOS-关于第三方解压库ZipArchive解压后中文乱码问题
-(BOOL) UnzipFileTo:(NSString*) path overWrite:(BOOL) overwrite{ BOOL success = YES; int index = 0; int progress = -1; int ret = unzGoToFirstFile( _unzFile ); unsigned char buffer[4096] =原创 2015-01-15 23:00:07 · 1984 阅读 · 0 评论 -
IOS-GCD的一点认识
Objective-C 高级编程 ios与 OS X 多线程和内存管理原创 2015-04-16 09:16:47 · 438 阅读 · 0 评论 -
IOS-IOS8小计
以下转载自http://www.cocoachina.com/special/ios8/App Extensions应用扩展允许开发者扩展应用的自定义功能和内容,能够让用户在使用其他app时使用该项功能。你可以开发一个应用扩展来执行某些特定的任务,用户使用该扩展后就可以在多个上下文环境中执行该任务。iOS 8的应用扩展支持以下扩展点分享通过提供更多分享选项,转载 2015-05-08 15:36:21 · 478 阅读 · 0 评论 -
Swift小计
REPL (Read-Eval-Print Loop “读取-求值-输出”循环,简称REPL) 设置环境:打开终端 sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer运行 xcrun swift覆盖父类中的方法,需要使用 override 关键字@objc用来表示协议是可选的?原创 2015-05-04 09:35:25 · 368 阅读 · 0 评论 -
IOS-UITableView-Cell的重绘-避免出现重叠视图
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier =@"Cell"; UITableViewCell *cell = [tab原创 2014-04-16 16:42:17 · 1204 阅读 · 0 评论 -
IOS-IOS7小计
在用户界面设计中,新增了一个重要的概念:UIKit动力(UIKit Dynamics)。通过UIKit动力,在我们的程序中可以为UIView对象指定动力行为,以及让别的对象遵循UIDynamicItem协议——(遵循该协议的对象称为动力项[dynamic items])。动力行为通过将现实世界中的行为和特征与程序相结合(例如将重力加入程序的动画中),以提供一种增强用户体验的方法。UIKit默认转载 2015-05-08 10:35:51 · 619 阅读 · 0 评论 -
iOS-个人使用的一些第三方库
Masonry相当于一个autoLayout的手到版本,这对于我这种喜欢纯代码的来说相当好用git地址:https://github.com/SnapKit/Masonry使用教程:http://adad184.com/2014/09/28/use-masonry-to-quick-solve-autolayout/SDWebImage非常好用的一个网络图片加载库原创 2015-05-26 11:03:54 · 595 阅读 · 0 评论 -
iOS-关于UINavigationController的title不显示问题
今天在写一个界面的时候碰到了一个奇怪的问题。最开始我写了一个基类BaseViewController,继承自UINavigationController@interface BaseViewController : UINavigationController@end在此基类中,隐藏了NavigationBar@interface BaseViewController ()@e原创 2015-08-10 17:12:01 · 8339 阅读 · 0 评论 -
IOS 图片合成
转自 http://taox.l.blog.163.com/blog/static/48365573201343095857725/1、UIView转换为UIImage UIGraphicsBeginImageContextWithOptions(bgView.bounds.size, NO, bgView.layer.contentsScale); [bg转载 2014-07-03 16:33:23 · 684 阅读 · 0 评论 -
IOS-苹果上架流程 相关信息
Default Language: 默认语言一般选择中文App Name 应用名称SKU Number 用来区分App和查看销量,可以用BundleIdentifier也可以用应用的名称Availability Date:发布日期Price Tier: 价格Discount for Educational Institutions: 教育机构的折扣Specif原创 2014-03-05 10:16:03 · 771 阅读 · 0 评论 -
Xcode5.1.1关于Images.xcassets的一点理解
参照https://developer.apple.com/LIBRARY/IOS/qa/qa1686/_index.html 的图标规范iPhone相关图标Icon-Small@2x 29*29Icon-Small@2x 58*58Icon-Small-40@2x 80*80Icon.com 57*57原创 2014-08-22 15:47:55 · 643 阅读 · 0 评论 -
IOS-iphone真机免证书调试
准备工作:iphone需要越狱。一. 制作假证书1、 打开 Finder->应用程序->实用工具 -> 钥匙串访问 2、单击:"钥匙串访问"选择 "证书" 再选择"创建证书"过程如下图: 只能创建一个iPhone Developer,如有多个,请全删除后再创建。 证书名称必须原创 2013-03-09 18:59:14 · 1129 阅读 · 0 评论 -
IOS-自定义UISegmentedControl
NSArray *arr = [[NSArrayalloc]initWithObjects:@"我的动态",@"好友圈",@"好友列表",nil]; UISegmentedControl *segment = [[UISegmentedControlalloc]initWithItems:arr]; segment.frame = CGRectMake(0,20原创 2014-03-18 00:50:30 · 781 阅读 · 0 评论 -
IOS-圆角矩形
添加链接库QuartzCore.framework添加头文件#import UButtonIcon.layer.cornerRadius =22.5f; //数字根据大小进行微调UButtonIcon.layer.masksToBounds =YES;原创 2014-03-07 10:47:48 · 602 阅读 · 0 评论 -
IOS-播放沙盒目录及本地音频文件
需要添加链接库 AVFoundation.framework, AudioToolbox.frame添加头文件#import #include 设置路径#define MUSICSAVE(MUSICNAME) [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Music"]stri原创 2014-03-06 19:33:57 · 5470 阅读 · 1 评论 -
IOS-UITableView之刷新某一行
NSIndexPath *te = [NSIndexPath indexPathForRow:0 inSection:0];//刷新第一个section的第1行 [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:te,nil] withRowAnimation:UITableViewRowAnimationAutomatic原创 2014-03-06 18:50:03 · 2207 阅读 · 0 评论 -
IOS-多维数组插入数组到最前面
NSMutableIndexSet *indexes = [NSMutableIndexSet indexSetWithIndex:0];[indexes addIndex:0];NSMutableArray *array = [[N原创 2014-04-13 23:23:16 · 5783 阅读 · 0 评论 -
IOS-UITableView相关小计
//设置UITableView分隔线 [tableShowsetSeparatorStyle:UITableViewCellSeparatorStyleSingleLine]; [tableShowsetSeparatorColor:[UIColorcolorWithPatternImage:[UIImageimageNamed:@"mapInfoLine.pn原创 2014-03-17 21:36:17 · 813 阅读 · 0 评论 -
IOS - TabBarController 显示/隐藏第一级页面的TabBar
- (void)setTabBarHidden:(BOOL)hidden{ UIView *tab =self.tabBarController.view; if ([tab.subviewscount] 2) { return; } UIView *view; if ([[tab.subvie转载 2014-06-06 14:25:38 · 909 阅读 · 0 评论 -
IOS-解决自定义UIImagePickerController 后的图片翻转问题
//图片旋转- (UIImage *)fixOrientation:(UIImage *)aImage{ // No-op if the orientation is already correct if (aImage.imageOrientation ==UIImageOrientationUp) return aImage;转载 2014-07-03 10:00:11 · 1028 阅读 · 0 评论 -
IOS-IOS7适配代码
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 if (IOS7_OR_LATER ){ self.edgesForExtendedLayout =UIRectEdgeNone; self.extendedLayoutIncludesOpaqueBars =NO; self.modal原创 2014-05-07 14:19:12 · 531 阅读 · 0 评论 -
IOS-UIWebView 加入 UITableView
webViewShow = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 100)]; webViewShow.scrollView.scrollEnabled = NO; NSURL *url=[NSURL URLWithString:[NSString stringWi原创 2014-07-25 11:11:45 · 1539 阅读 · 0 评论 -
IOS-截取一个视图的大小里的图像
UIView *UImageTotal = [[UIView alloc] initWithFrame:UTableViewShow.frame]; UImageTotal = UcollectionView.viewForBaselineLayout; UIGraphicsBeginImageContextWithOptions(UImageTotal.boun转载 2014-07-30 15:10:42 · 660 阅读 · 0 评论 -
IOS7新特性-右滑返回上级页面
添加委托 UIGestureRecognizerDelegate原创 2014-08-18 21:18:51 · 655 阅读 · 0 评论 -
IOS-小技巧
NSString *versionNum = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey];原创 2014-04-16 19:23:31 · 534 阅读 · 0 评论