- 博客(44)
- 资源 (2)
- 收藏
- 关注
原创 使用ffmpeg转码
先从 www.ffmpeg.org下载ffmpeg然后:/Users/mac/Desktop/SnowLeopard_Lion_Mountain_Lion_Mavericks_12.12.2015/ffmpeg -i d0019utlj48.mp4 -acodec libvorbis d0019utlj48.ogg 注:ffmpeg在电脑上的位置 -i 源视频的名字 -acodec...
2015-12-24 14:04:37
245
原创 block语法
How Do I Declare A Block in Objective-C?[b]As a local variable:[/b]1.returnType (^blockName)(parameterTypes) = ^returnType(parameters) {...};2.@property (nonatomic, copy) returnType (^...
2015-12-11 10:34:03
146
原创 禁止WebView长按事件
在webViewDidFinishLoad调用:- (void)webViewDidFinishLoad:(UIWebView *)webView{ NSArray *subViewArray = webView.subviews; for (UIView *view in subViewArray) { NSArray* arra...
2015-11-04 16:05:24
947
原创 一个公共的TableView,然后不会为每个TableView加delegate和datasource
.h//// PublicTableView.h// JointCrm//// Created by Mac on 15/10/27.// Copyright © 2015年 Mac. All rights reserved.//#import typedef void(^TableBlock)(UITableView *tableView,NS...
2015-10-27 10:46:52
173
原创 记录一些不错的文章
好久没有写ios了,这篇文章主要是记录一些看到的不错的文章:1.解决请求并发的问题。http://www.cocoachina.com/ios/20151009/13579.html2.layer相关的东西http://www.cocoachina.com/ios/20141022/10005.html3.自动布局Auto Layout 使用心得(一)—— 初体...
2015-10-09 20:04:16
112
原创 封装录音View
使用方法: 直接把XHRecrodView添加到controller可实现像微信那样的语音通话 // 添加录音view XHRecrodView* recrodView = [[XHRecrodView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(_textview.frame) + 20, SCREEN_WIDTH, 100...
2015-06-26 16:13:59
122
原创 AFNetWorking请求WebService
.h#import typedef void(^SuccessBlock)(NSString *dataString);typedef void(^FialdBlock)(NSString *dataString);@interface HttpRequest : NSObject+(void)requestWtihParams:(NSDictionary *)...
2015-06-15 17:22:52
202
原创 压缩图片,如果图片大于100kb,就循环压缩
// 压缩图片,如果图片大于100kb,就循环压缩+ (NSData *)compressionWithImage:(UIImage *)image{ // 先按宽度压缩 UIImage *newImage = [image resizeImageGreaterThan:480]; NSData *data; float qual...
2015-06-02 10:37:44
665
原创 weakSelf
快速的定义一个weakSelf 当然是用于block里面啦#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;
2015-05-11 14:44:44
153
原创 UINavigationItem 位置问题
解决ios7 UINavigationItem 位置偏移问题#import @interface UINavigationItem (Spacing)-(void)mySetLeftBarButtonItem:(UIBarButtonItem*)barButton;-(void)mySetRigthBarButtonItem:(UIBarButtonItem*)barBut...
2015-05-06 14:09:07
142
原创 把图片压缩到指定大小(kb)
UIImage *image=[UIImage imageNamed:@"xxoo.jpeg"]; NSData *imageData=UIImageJPEGRepresentation(image, 1.f); CGFloat size=40.f;// kb CGFloat scale=size/(imageData.length/1024); NSDa...
2015-01-19 16:32:04
1807
获取当前时间属于该月的第几周
+(NSInteger) indexWeekOfDateInMonth:(NSDate*)date_{ NSCalendar *calendar = [NSCalendar currentCalendar]; NSDateComponents* components = [calendar components:NSYearCalendarUnit| NSMon...
2015-01-06 15:04:20
469
原创 iOS开发的一些奇巧淫技
iOS开发的一些奇巧淫技 [color=red][b]http://www.cocoachina.com/ios/20141229/10783.html[/b][/color]TableView不显示没内容的Cell怎么办?类似这种,我不想让下面那些空的显示.01.png很简单.self.tableView.tableFooterView ...
2014-12-31 11:13:20
168
原创 iOS中使用block进行网络请求回调
转自: http://www.tuicool.com/articles/JFRfmq//// HttpRequest.h// UseBlockCallBack//// Created by Michael on 2/13/14.// Copyright (c) 2014 EIMS. All rights reserved.//#import ...
2014-06-23 16:26:09
277
原创 设置TabBar选中与未选中图片
-(void)settingTabbarController{ self.tabBarViewControoler.tabBar.selectionIndicatorImage = [UIImage imageNamed:@"tabbar_selected"]; for (int i = 0; i < self.tabBarViewControoler.tabBar.items...
2014-04-29 18:07:33
323
原创 自定义的NavigationBar,我觉得还不错
地址1:http://code.cocoachina.com/detail/199714/CustomNavigationBar地址2:https://github.com/jimple/CustomNavigationBar
2014-04-28 18:03:26
93
UITableView点击展开cell
1.定义控制cell的两个变量 //最近打开的index int currentClickIndex; //是否打开cell BOOL isOpenCell;2.给变量赋值- (void)viewDidLoad{ [super viewDidLoad]; currentClickIndex = -1; ...
2014-04-25 15:14:32
197
分享一个非常好的东西
http://makeappicon.com/ 传一个1024*1024的图片上去,会生成各种尺寸的Icon,包括android,ios6,ios7!!
2014-04-09 17:44:39
102
原创 ios开发申请发布证书和发布应用到app store
1.http://www.360doc.com/content/13/1224/09/14615320_339677793.shtml 2.http://my.oschina.net/joanfen/blog/133642
2014-03-21 11:03:42
115
原创 转 ios中对于tabBar选中图片设置的问题
http://blog.youkuaiyun.com/kevinwlc/article/details/21467499//核心代码UIimage* imageNormal = [UIImage imageNamed:@"tabhost_three_bg_nor"];UIimage* imageSelected = [UIImage imageNamed:@"tabhost_three_bg_...
2014-03-20 15:54:08
242
原创 解决onclik ontouch冲突简单办法
转:http://www.rapidsnail.com/Tutorial/t/2012/1018/30/15343/the-android-ontouch-and-onclick-conflict-processing.aspxpublic boolean onTouch(View V, MotionEvent event) { if (event.getAction() == ...
2013-09-22 16:19:22
126
原创 cocos2d-iphone粒子效果
cocos2d-iphone粒子效果转自 http://www.2cto.com/kf/201303/196945.html
2013-06-03 14:35:44
94
原创 ios 监听设备方向发生改变
1.添加监听函数[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self ...
2013-05-17 14:25:26
347
原创 转【Cocos2d-x游戏引擎开发笔记(4)】系统动画
http://blog.youkuaiyun.com/zhy_cheng/article/details/8271154
2013-03-28 17:16:21
96
原创 cocos-2d 跨平台GB2312转UTF8
android默认的字体是GB2312,在xcode中,转换成UFT-8char* HelloWorld::G2U(const char* gb2312) { int len = MultiByteToWideChar(CP_ACP, 0, gb2312, -1, NULL, 0); wchar_t* wstr = new wchar_t[len+1]; me...
2013-03-28 16:52:22
127
原创 创建应用快捷方式,且点击快捷方式回到应用,而不是重新启动应用!!
private void createShortCut() { Intent shortcutIntent = new Intent(Intent.ACTION_MAIN); shortcutIntent.setClassName(this, this.getClass().getName()); shortcutIntent.setFlags(Intent.FLAG_ACT...
2012-12-12 16:38:47
131
原创 PopupWindow+ListView 关于listview选中和pop外部点击隐藏
// 声明一个弹出框 popupWindow = new PopupWindow(layout, 250, layout_height); popupWindow.setFocusable(true); // popupWindow+listview,实现listview选中事件和pop点击隐藏的效果,必须加这行代码。 好jb邪恶 popupWindow.setBackgr...
2012-08-24 11:37:37
160
原创 ios中添加外部字体。。。
/* *查找ios所支持的所有字体 *使用外部字体的作法: * 1.导入.ttf字体 * 2.在plist中添加Fonts provided by application(类型为array) * 3.把导入的.ttf文件添加到array中的item中 * 4.把外部字体文字的名字带到日志中去查找ios支持的字体,相对应...
2012-08-21 17:08:09
127
原创 scrollview+listview的高度自动适应
很多时间我们在scorllview中嵌入listview的时候,都只能看到listview显示一行数据,而我们的要求是显示多行,即我们数据的行数,那么请看下面的代码: int totalHeight = 0;//总的高度 for (int i = 0; i < initData(0).size(); i++) { //initData(0).size()...
2012-05-30 17:41:19
187
原创 XCode4如何解决调试程序时,忽然崩溃,而找不到崩溃的代码
http://blog.youkuaiyun.com/diyagoanyhacker/article/details/6666047
2012-03-15 17:20:53
98
原创 IOS 截屏
UIGraphicsBeginImageContext (CGSize)截图 ,是从屏幕原点开始截取size大小的图片如何截取任意起点开始 size 大小的图片,办法就是用CGContextTranslateCTM转换原点坐标//导入头文件//创建一个基于位图的图形上下文并指定大小为CGSizeMake(200,400)UIGraphicsBeginImageContext(CGS...
2012-03-12 10:26:40
215
原创 转换东一到东八相差八小时时间
+(NSDate *)convertDateToLocalTime:(NSDate *)forDate { NSTimeZone *nowTimeZone = [NSTimeZone localTimeZone]; int timeOffset = [nowTimeZone secondsFromGMTForDate:forDate]; NSDate *n...
2012-02-01 14:09:23
201
原创 iphone序列化文件
#pragma -#pragma 序列化列表+ (BOOL)saveMatchListToFile:(NSArray*)newMathcList { NSString *mathcListFile = [[PlayViewController getLocalMatchList] stringByAppendingFormat:@"matchList.arch", nil];...
2012-01-18 16:08:20
160
原创 正则的使用(转) 开发小技巧http://blog.youkuaiyun.com/doubleuto/article/details/6098876
NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+//.[A-Za-z]{2,4}"; NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
2012-01-06 10:23:15
107
原创 UITextField 只输入数据和小数点
#define NUMBERS @"0123456789.\n" //匹配的字符,可以加入你想要的字符- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ NSCharacter...
2011-11-25 17:19:22
94
原创 core date排序
//排序条件NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc]initWithKey:@"updateDate" ascending:YES]; //根据updateDate来排序,ascending:YES==》升序 //添加多个排序条件! NSArray *sortDescriptors ...
2011-11-25 10:45:32
88
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人