- 博客(22)
- 资源 (1)
- 收藏
- 关注
转载 本地化多语言支持
1.在Supporting Files文件夹右键,NewFile… -> iOS -> Resources -> String Files,命名为Localizable.strings2.选中Localizable.strings 点击 XCode-> View-> Utilities -> File Inspector,在Localization中点+添加语言比如中文英文
2015-09-30 13:24:51 426
转载 键盘的相关处理
一、KeyBoardTopBar类文件 1)KeyBoardTopBar.h头文件#import @interface KeyBoardTopBar : NSObject {UIToolbar *view; //工具条 NSArray *textFields;
2015-09-30 13:21:54 370
转载 截屏并保存
UIView *view = [[[[[UIApplication sharedApplication] windows] objectAtIndex:1] subviews] lastObject];//获得某个window的某个subView NSInteger index = 0;//用来给保存的png命名for (UIView *subView in [view subviews]
2015-09-30 13:13:12 331
转载 NSTimer相关
创建一个 Timer+ scheduledTimerWithTimeInterval: invocation: repeats:+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)ti invocation:(NSInvocation *)invocation repeats:(BOOL)yesOrNo;+ sche
2015-09-30 11:40:50 265
原创 tableview的相关属性
添加数据源, 由三个函数来回答数据绑定的请求:numberOfSectionsInTableView, numberOfRowsInSection 和 cellForRowAtIndexPath.用numberOfSectionsInTableView方法来返回table中有几个组.- (NSInteger)numberOfSectionsInTableView:(UITableView
2015-09-30 11:39:42 337
转载 数组相关的处理方法
/*******************************************************************************************NSArray/*---------------------------创建数组------------------------------*///NSArray *array = [[NSArray all
2015-09-30 11:35:04 305
转载 字符串相关的方法的总结
//一、NSString/*----------------创建字符串的方法----------------*/ //1、创建常量字符串。NSString *astring = @"This is a String!";//2、创建空字符串,给予赋值。NSString *astring = [[NSString alloc] init];astring = @"This is a
2015-09-30 11:33:39 320
原创 iOS 文件操作(NSFileManager)结合相册选取、保存、和读取
#import @interface ViewController : UIViewController @property (retain, nonatomic) IBOutlet UIImageView *imageView; @property (retain, nonatomic) UIButton *saveToFileButton; //打开相册
2015-09-30 10:55:22 1447
原创 判断输入的手机号和价格是否合法
/////手机号码的有效性判断//检测是否是手机号码-(BOOL)isMobileNumber:(NSString*)mobileNum{/***手机号码*移动:134[0-8],135,136,137,138,139,150,151,157,158,159,182,187,188*联通:130,1
2015-09-29 14:35:21 498
原创 面试题搜集的比较好的链接
http://blog.sina.com.cn/s/blog_77e5f1990101cdiv.htmlhttp://www.90159.com/2015/07/26/71/http://www.jianshu.com/p/4fea8fa60d75http://www.360doc.com/content/14/0522/10/8772388_379844601.shtml#685
2015-09-29 14:33:19 324
原创 版本检测更新 调用AppStore 显示自己的app
#pragma mark - 检查更新 - (void)checkUpdateWithAPPID:(NSString *)APPID { //获取当前应用版本号 NSDictionary *appInfo = [[NSBundle mainBundle] infoDictionary]; NSString *currentVersion = [a
2015-09-29 14:24:32 381
原创 NSOperation && NSOperationQueue
if ([self.navigationController.navigationBar respondsToSelector:@selector( setBackgroundImage:forBarMetrics:)]){ NSArray *list=self.navigationController.navigationBar.subviews; for (id
2015-09-29 11:41:51 412
原创 杂乱小知识点总结
http://ios-iphone.diandian.com/post/2012-03-26/18119641数组中存储数据查询NSMutableDictionary *userDic1 = [NSMutableDictionary dictionaryWithCapacity:10]; NSMutableDictionary *userDic2 = [NSMutableDiction
2015-09-29 11:36:20 487
原创 给普通的view添加边框和背景 (关于layer的一些属性)
UIImageView *imgvPhoto = [UIImageView alloc] init];//添加边框 CALayer *layer = [_imgvPhoto layer]; layer.borderColor = [[UIColor whiteColor] CGColor]; layer.borderWidth = 5.0f;//添加四个边
2015-09-29 10:32:45 336
原创 搜集的一些好的框架和 技术大牛的博客
教程网站http://www.raywenderlich.com/objc.iohttps://www.objc.io/objc.io 中问http://objcio.cn/忘记什么时候收藏的了http://tutsplus.com/设计https://designcode.io/subjective-Chttp://subjc.com/NSHiph
2015-09-29 10:14:34 4060
原创 tableView 去掉多余的行数 && iOS 中直接用WebView 加载pdf doc docx 等文件
//去掉底部多余的表格线[tableView setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];//最后一行分隔线顶头显示static void setLastCellSeperatorToLeft(UITableViewCell* cell){ if ([cell respondsToSelector:@
2015-09-25 10:44:49 1422
原创 iOS 中背景图片的设置
一般我们设置背景图片有两种方法://不释放内存,比较占内存,有缓存,加载常用的图片UIImage *image = [UIImage imageNamed:FileName];//会释放内存,没有缓存 比较适合加载大的图片UIImage *image = [UIImage imageWithContentsOfFile:path];
2015-09-25 10:38:25 555
原创 Cocopods的基本介绍与使用:
1.什么是CocoaPods?2.如何下载和安装CocoaPods?3.如何使用CocoaPods? 1.CocoaPods是什么? 首先,当我们开发程序的时候,会经常使用第三方的开源类库。比如JSONKit、AFNetWorking等。可能某个类库的使用又使用到了另外的类库,我们就得麻烦去下载另外一个类库,这样会很麻烦。其次,很多的第三方库可能会有更新,那样我
2015-09-23 14:04:21 483
原创 iOS 隐藏状态栏
iOS 8 设置隐藏状态栏:1.只在当前控制器中设置状态栏: [[UIApplication sharedApplication] setStatusBarHidden:TRUE];2.设置全局的隐藏状态栏: 在info.plist上添加一项:Status bar is initially hidden,value为YES; 完后在MainAppDelegate.mm的-
2015-09-23 11:10:02 1141
原创 数据存储
plist数据存储: 1.获取沙盒路径 NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask,YES)lastObject]; 2.拼接文件名 path = [path stringBy
2015-09-22 15:27:07 314
原创 随机数的问题
随机数的问题: arc4random() int a = arc4random()%3; 一般是取余求随机数 arc4random_uniform() int a = arc4random_uniform(23); 生成 23以下的随机数生成随机的颜色: - (UIColor *)colorRandom {
2015-09-22 15:20:36 375
原创 iOS 开发中关于弹窗的几种方式
常见的几种弹窗方式总结:1.IOS8以前的方式: UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"提示" message:@"输入的数字不合理" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:nil, nil]; [alertView show
2015-09-22 14:50:13 8118
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人