- 博客(83)
- 资源 (5)
- 收藏
- 关注
原创 资料分享:UIDocumentPickerViewController 分享超过30M的视频文件,应用闪退
// fileData 不断输出,卡住主线程,从而导致崩溃EBLog(@"---fileName:%@ fileData:%@",fileName,fileData);// 输出语句踩雷// fileData 过大,不断输出十六进制字符串,导致主线程卡住[fileCoordinator coordinateReadingItemAtURL:targetUrl options:0 error:&error byAccessor:^(NSURL *newURL) { EBLog(@.
2022-02-22 20:54:55
509
转载 vim更改缩进空格数和TAB键缩进数
打开/etc/virc附加如下内容:set tabstop=4 set shiftwidth=4 "设定 Tab 键缩进的空格数set tabstop=4 "设定编辑器将多少空格视为一个缩进set shiftwidth=4
2015-11-25 12:15:56
1167
原创 iOS 证书
其中Bundle Identifier为苹果的AppID,必须与应用发布是配置的Profile关联的AppID一致;Version为应用版本号,在App Store中显示的版本号,推荐与manifest.json中version下的name值一致;Build为编译版本号,App Store判断升级使用,推荐与manifest.json中version下的code值一致。
2015-08-25 15:07:57
568
原创 uitextfiled 输入 过滤
// 空格过滤-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ NSString *str = textField.text; NSCharacterS
2015-08-20 17:51:36
489
原创 UITableView 删除cell 的问题
// 错误写法-(void)deleteTabelCellAction:(NSIndexPath *)indexPath{ [_tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; [_questionArray removeObjectAtIn
2015-08-19 14:42:10
509
原创 IOS 中设置UITextView 显示文本的光标
textView.selectedRange=NSMakeRange(0,0) ; //起始位置textView.contentInset = UIEdgeInsetsMake(-24, -6, 0, 0); // 内容的位置 第一个textfield return 之后,第二个textview 获取
2015-08-19 10:15:16
2891
原创 While reading XXX pngcrush caught libpng error: N
While reading /XXX/XXX/XXX/img1.png pngcrush caught libpng error: Not a PNG filCould not find file: /Users/XXX/Library/Developer/Xcode/DerivedData/CookBookDemo-cnttcobrbmvbddeiesgsxnfwihfe/Build/Produ
2015-08-18 16:22:59
609
原创 tableview 索引条问题
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index// 有问题的写法#pragma mark -- 创建 section-(NSArray *)sectionIndexTitle
2015-08-13 17:31:28
1273
原创 git 基本使用
初始化一个Git仓库,使用git init命令。添加文件到Git仓库,分两步:第一步,使用命令git add ,注意,可反复多次使用,添加多个文件;第二步,使用命令git commit,完成。
2015-08-11 16:49:10
379
转载 malformed or corrupted AST file: 'Unable to load module "/Users/yx/Library/Developer/Xcode/DerivedDa
使用不同版本的XCode出现的问题:atal error: malformed or corrupted AST file: 'Unable to load module "/Users/yx/Library/Developer/Xcode/DerivedData/ModuleCache/1KA884DWE9ZMV/UIKit-2P3JYM7GVC64.pcm": module fil
2015-08-11 14:50:41
589
原创 nsdictionary ,nsarray 和 json 字符串 的转换
一,提交数据: foudation 类型转 json 字符串 1.字符拼接方法NSMutableString *listStr = [[NSMutableString alloc] initWithString:@"["]; for (NSString *t
2015-08-06 17:37:02
508
转载 Xcode 中放置图片的位置,Images.xcassets 和直接放在源文件目录中的区别
1.Images.xcassets中的素材(1)只支持png格式的图片(2) 图片只支持[UIImage imageNamed]的方式实例化,但是不能从Bundle中加载。[使用[NSBundle MainBundle] pathForResources 拿不到 images.xcassets里面图片的路径](3) 在编译时,Images.xcassets中的所有
2015-08-04 10:13:38
9974
原创 UIActionSheet
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet{ NSArray *subViews = actionSheet.subviews; for (UIView *subViwe in actionSheet.subviews) { if ([subViwe
2015-07-29 16:02:53
448
转载 xxx is not in the sudoers file.This incident will be reported.的解决方法
xxx is not in the sudoers file.This incident will be reported.的解决方法1.切换到root用户下,怎么切换就不用说了吧,不会的自己百度去.2.添加sudo文件的写权限,命令是:chmod u+w /etc/sudoers3.编辑sudoers文件vi /etc/sudoers找到这行 root ALL
2015-07-16 14:31:10
1884
原创 uitoolbar item 自动调整布局
//创建barbuttonitem,样式是flexible,这个种barbuttonitem用于两个barbuttonitem之间 //调整两个item之间的距离.flexible表示距离是动态的,fixed表示是固定的 UIBarButtonItem *flexible = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:
2015-07-09 17:29:44
1740
转载 数据库操作添加数据 出错 unrecognized token:
在sqlite3插入数据表时,出现的错误: DB Error: 1 "unrecognized token: "522ee9ace4b0600fb8ffde24"" 解决方法:插入的字符串需加引号'NSString *sql_insert1 = [NSStringstringWithFormat:@"INSERT INTO %@ (%@,%@,%@,%@) VALUES
2015-04-22 17:27:57
11000
转载 h' file not found”, ShareSDK的路径,
换了电脑 访问/Users/zksd/Desktop/....../ShareSDK ;路径错了ShareSDK的路径, targets的building里面有个search paths,在那里设置sharesdk的路径 Lexical or Preprocessor Issue '***.h' file not found 这样的错
2015-04-15 11:14:55
7565
转载 sharesdk WeiboSDK registerApp:kAppKey 崩溃
使用xcode6.1创建的项目, 添加新浪SDK,运行[WeiboSDK registerApp:kAppKey];这一步崩溃,抛出以下*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM weibosdk_WBSDKJSONString]:
2015-04-15 10:36:41
3704
原创 UIWebView 播放gif 动画
CGSize enterGifSize = [UIImage imageNamed:@"extra_service_entering.gif"].size; CGRect frame = CGRectMake((IPHONE_WIDTH - enterGifSize.width)/2, CGRectGetMaxY(logoIV.frame) + 30, enterGifSize.
2015-04-08 17:23:59
723
原创 UITableViewCell 间距问题
-(void)setFrame:(CGRect)frame{ if ([self.reuseIdentifier isEqualToString:@"PersonalPageVC_CellID1"]) { frame.origin.y += kTopInsect; frame.size.height -= 2*kTopInsect;
2015-03-27 14:30:03
554
原创 数组内容排序
// 按数组内容从小到大排序infoModel.fundPriceArray = [array sortedArrayWithOptions:NSSortStable usingComparator:^NSComparisonResult(id obj1, id obj2) { if ([obj1 f
2015-03-17 09:30:54
531
转载 UITextView placeholder 设置
UITextView上如何加上类似于UITextField的placeholder呢,其实在UITextView上加上一个UILabel或者UITextView,如果用UILable的话,会出现一个问题就是当placeholder的文字过长导致换行的时候就会出现问题,而用UITextView则可以有效避免此问题。- (BOOL)textView:(UITextView *)textView s
2015-03-09 16:15:32
696
原创 登录界面多个账户信息存储问题
方法一:使用归档:其实质就是读写文件操作,(归档,解档:archive,unarchive)// 归档+ (NSData *)archivedDataWithRootObject:(id)rootObject;+ (BOOL)archiveRootObject:(id)rootObject toFile:(NSString *)path;// 解档+ (id)unarchiveObj
2015-02-26 17:17:10
1588
原创 cell 控制子控件的显示和隐藏
-(void)showRightDot:(BOOL)isShow{ UIImageView *dotView = [self.contentView viewWithTag:701]; if (isShow) { if (!dotView) { dotView = [[UIImageView alloc] ini
2015-02-10 15:30:44
1715
原创 梦
昨晚,梦到在熟悉的 806 教室考试数学,第一次考砸了,第二次同样的题目,还是考砸了。罗爹:太浮躁,这么浮躁怎么行。 语气中没有责骂,更多是担心,与叹息,我应该懂的,也知道自己要怎么做。不忘初心,方得始终。
2015-02-10 09:14:37
412
转载 block 循环引用的问题
ARC的本质ARC是编译器(时)特性,而不是运行时特性,更不是垃圾回收器(GC)。不同于XCode4可以在创建工程时选择关闭ARC,XCode5在创建的工程是默认开启ARC,没有可以关闭ARC的选项。如果需要对特定文件开启或关闭ARC,可以在工程选项中选择Targets -> Compile Phases -> Compile Sources,在里面找到对应文件
2015-02-09 16:55:10
1033
原创 获取 UITableView 单个cell 的坐标点位置
聊天界面中,长按某个对话,弹出窗口,可以进行选中,复制。 该弹出窗口的坐标确定 用以下方法- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ CGRect popoverRect = [tableView convertRect:[tableVie
2015-02-09 14:30:56
1870
原创 手机清除缓存
- (void)clearCachesAction{ //删除本地缓存 NSLog(@"删除本地缓存...."); [self.hudManager With_label:@"正在删除" duration:30]; // 获取Caches目录路径 NSArray *paths = NSSearchPathForDirectoriesInDomain
2015-02-09 09:42:41
566
原创 UITextField 限制输入数字及小数点
#define kNumbersPeriod @"0123456789."-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ NSCharacterSet
2015-02-07 12:22:04
503
转载 ios7的UITableView实现ios6的圆角效果
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ if ([cell respondsToSelector:@selector(tintColor)]) { if (tableVie
2015-02-07 12:01:49
1139
原创 UINavigationContoller 多级页面 越级跳转 内存释放问题
在 arc 模式下 从第一个页面逐步 push 至第四个页面,再从第四个页面 ,直接 pop 到第一个页面,则第二,第三个页面自动被释放,不需要手动释放。pop 到第第一个页面时,第四个, 第三个,第二个 界面均已出栈 在手动管理下,必须找到第二,第三个页面,并且将其置空,否则 ,内存泄漏
2015-02-06 15:39:58
954
原创 UITableView 选中单元格 全都可以选
//// AddVisitTimeVC.m// com.yx129.yxClientDoctor3//// Created by yx on 15/1/30.// Copyright (c) 2015年 Guangzhou Yixiang Internet Technology Development Limited. All rights reserved.//#defi
2015-02-03 16:23:34
521
原创 cell 复用问题 cell中控件单选,多选,带标签图的不可选中
//// AddVisitTimeVC.h// com.yx129.yxClientDoctor3//// Created by yx on 15/1/30.// Copyright (c) 2015年 Guangzhou Yixiang Internet Technology Development Limited. All rights reserved.//#impo
2015-02-02 11:33:41
1202
原创 UITableView 上滑动 隐藏搜索框,下滑,显示搜索框
//// AuthSelectDoctorVC.m// com.yx129.yxClientDoctor3//// Created by yx on 15/1/4.// Copyright (c) 2015年 Guangzhou Yixiang Internet Technology Development Limited. All rights reserved.//#d
2015-01-29 17:52:05
4997
原创 UITabbar
@interface MainVC : UITabBarController@end- (void)viewDidLoad{ [super viewDidLoad]; if (SystemVersion > 6.0) [UITextField appearance].tintColor = [UIColor grayColor];
2015-01-23 11:29:14
459
原创 UISearchBar 的使用
//// AddDiseaseSubjectViewController.m// com.yx129.yxClientDoctor3//// Created by yx on 14/12/4.// Copyright (c) 2014年 Guangzhou Yixiang Internet Technology Development Limited. All rights re
2015-01-09 10:20:36
605
原创 用 UITextField 自定义UISearchBar 监听输入字符串改变的问题
用 UITextField 自定义的 UISearchBar 没有如下的 UISearchBar 中的协议方法- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText UITextField 中只有协议方法:-(BOOL)textField:(UITextField
2015-01-09 10:00:21
2955
原创 SearchBar 的触发事件
//-(BOOL)searchBar:(UISearchBar *)searchBar shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text//{//// if (![_keyword isEqualToString:_MySearchBar.text]) {// //
2015-01-07 18:11:16
880
转载 UITextfield placeholder
textField.placeholder = @"username is in here!"; [textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"]; [textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:
2014-12-09 19:46:55
490
原创 uitextField 收键盘操作
#pragma mark - 收键盘-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [self.view endEditing:YES]; // 当多个textfield 时,不可用 这种方法// [_acountTF resignFirstResponder];//
2014-12-09 16:58:14
538
仿 iphone 界面删除应用图标抖动
2014-10-19
韵达物流管理系统
2013-12-17
瑟夫死亡游戏代码
2013-11-16
仿XP画图板.rar
2013-08-25
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人