使用GCD异步下载图片,优化
摘要:本来在下载完成之后,在UIImageWriteToSavedPhotosAlbum 里面响应 image: (UIImage *) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo 这个函数,然后来更新UI的,但是操作比较繁琐,而且UI的更新总是无法同步。所以采用GCD的方式,来...
阅读全文
posted @
2012-05-29 16:44
easonoutlook
阅读(976)
推荐(0)
TTRequestLoader max content size issue
摘要:报错为: TTRequestLoader connection:didReceiveResponse:](354): TTDASSERT failed: 0 == _queue.maxContentLength || contentLength <=_queue.maxContentLength 解决方法: // If you hit this assertion it's because a m...
阅读全文
posted @
2012-05-29 12:32
easonoutlook
阅读(195)
推荐(0)
#import 与 #include的区别,以及 @class
摘要:#import In the C language, the #include pre-compile directive always causes a file's contents to be inserted into the source at that point. Objective-C has the equivalent #import directive except ea...
阅读全文
posted @
2012-05-28 23:41
easonoutlook
阅读(1198)
推荐(0)
Three20对图片进行缓存之后,利用缓存的图片来进行显示的方式
摘要:1、首先缓存图片,等待后面利用本地url来取 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ TTURLCache *cache = [TTURLCache sharedCache]; for (NSDictionary *item in...
阅读全文
posted @
2012-05-28 19:41
easonoutlook
阅读(186)
推荐(0)
程序启动时隐藏状态栏,进入应用程序之后显示状态栏
摘要:http://www.gocalf.com/blog/iphone-dev-hide-status-bar.html 1、在info.plist里面 Status bar is initially hidden 设置为 YES 2、在appDelagate里面 设置 [application setStatusBarHidden:NO withAnimation:UIStatusBarAni...
阅读全文
posted @
2012-05-28 11:18
easonoutlook
阅读(889)
推荐(0)
XCode 的Tip 修改 MycompanyName
摘要:大家在新建文件的时候默认在文件的开关都会生成这样的注释: /* * * * Created by XX on 08-9-4. * Copyright 2008 __MyCompany__. All rights reserved. * */ 每次要拖动改__MyCompany__很麻烦,可以直接在命令行下输入: defaults write com.apple.xcode PBXCu...
阅读全文
posted @
2012-05-27 23:59
easonoutlook
阅读(149)
推荐(0)
程序中得到当前的界面语言设置
摘要:我找到获得界面语言设置的方法了: NSUserDefaults* defs = [NSUserDefaults standardUserDefaults]; NSArray* languages = [defs objectForKey:@"AppleLanguages"]; NSString* preferredLang = [languages objectAtIndex:0...
阅读全文
posted @
2012-05-27 23:21
easonoutlook
阅读(152)
推荐(0)
UITextField里面的text垂直居中以及最右侧放图片
摘要:最右侧加图片是以下代码, UIImageView *imgv=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"right.png"]]; text.rightView=imgv; text.rightViewMode = UITextFieldViewModeAlways; 如果是在最左侧加图片就换成:tex...
阅读全文
posted @
2012-05-25 10:01
easonoutlook
阅读(230)
推荐(0)
自定义UITextField的文本内容位置
摘要:textRectForBounds:Returns the drawing rectangle for the text field’s text.- (CGRect)textRectForBounds:(CGRect)boundsParametersboundsThe bounding rectangle of the receiver.Return ValueThe computed draw...
阅读全文
posted @
2012-05-24 19:06
easonoutlook
阅读(180)
推荐(0)
UISearchBar的使用心得
摘要:UISearchBar是无法修改其 textField的大小的 http://stackoverflow.com/questions/556814/changing-the-size-of-the-uisearchbar-textfield The text field used in UISearchBar is a subclass of UITextField called UISearc...
阅读全文
posted @
2012-05-24 18:42
easonoutlook
阅读(558)
推荐(0)
10 个免费的 C/C++ 集成开发环境
摘要:http://cnbeta.com/articles/188721.htm 集成开发环境(IDE)可以给程序员提供很大的帮助。大多数的IDE包含编译器和解释器。例如微软的 Visual Studio 本身内置的编译器和解释就是很好的例子,Eclipse 是另一个很好的例子。鼓励程序员使用IDE的主要原因是开发软件应用程序的各个组成部分之间可方便的进行切换。 一般一个特定的IDE是负责处理一种编...
阅读全文
posted @
2012-05-23 19:25
easonoutlook
阅读(258)
推荐(0)
设置UIView阴影shadow 边框 边框颜色
摘要:http://blog.sina.com.cn/s/blog_677089db0100us05.html http://hi.baidu.com/popln/blog/item/a8f3921e2944701f304e15c3.html // Implement viewDidLoad to do additional setup after loading the view, typical...
阅读全文
posted @
2012-05-23 17:51
easonoutlook
阅读(443)
推荐(0)
Mac 下终端中删除文件的命令
摘要:rm -rf three20 http://www.flutterstudio.com/internet/2610.html rm 删除命令。即remove的缩写,它后面有两个参数。-r 删除文件夹内的子文件夹及内容,一般情况下rm只能删 除文件或者空的文件夹。-f 强制删除参数如果需要了解rm命令的更多参数。请输入:man rm
阅读全文
posted @
2012-05-21 23:46
easonoutlook
阅读(601)
推荐(0)
用MPMoviePlayerController做在线音乐播放
摘要:http://blog.csdn.net/x1135768777/article/details/7505903 MPMoviePlayerController 与AVAudioPlayer有点类似,前者播放视频,后者播放音频,不过也有很大不同,MPMoviePlayerController 可以直接通过远程URL初始化,而AVAudioPlayer则不可以。不过大体上用起来感觉差不多。 在这...
阅读全文
posted @
2012-05-14 19:12
easonoutlook
阅读(286)
推荐(0)
5种方法在mac系统修改hosts文件
摘要:sudo vi /etc/hosts 然后提示输入系统密码 hosts文件就自动打开了 接着输入 i 进入编辑模式 将添加的网站,ip拷贝进去 编辑完成之后,按esc,输入 : wq 这样就更改完成了. w! 或者 wq! 进行强制写入然后退出 http://www.douban.com/group/topic/7726277/
阅读全文
posted @
2012-05-14 14:28
easonoutlook
阅读(206)
推荐(0)
TableView有些属性的修改只能在init里面
摘要:self.tableView.rowHeight = kThumbnailRowHeight; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
阅读全文
posted @
2012-05-11 15:13
easonoutlook
阅读(139)
推荐(0)
UIScrollView的正确使用方法
摘要:scrollView 的ContentSize一定要比 它的frame大,否则无法响应滑动的事件 http://www.iphonedevsdk.com/forum/iphone-sdk-development/102099-uiscrollview-tabbar-application.html Let's say you put a scroll view on the screen,...
阅读全文
posted @
2012-05-10 15:32
easonoutlook
阅读(229)
推荐(0)
iOS 调用浏览器 打开链接的方式
摘要:[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com/"]]; 记住前面的http:// 以及后面的 / 否则无法调用打开,很郁闷
阅读全文
posted @
2012-05-09 17:07
easonoutlook
阅读(426)
推荐(0)
关于给navigationBar加上 addSubview的问题
摘要:http://stackoverflow.com/questions/1553118/adding-image-to-navigation-bar loadView里面 无法添加,只能在 viewWillAppear里面进行添加
阅读全文
posted @
2012-05-09 15:55
easonoutlook
阅读(340)
推荐(0)
TTButton的使用小结
摘要:http://stackoverflow.com/questions/6434911/ttbutton-not-shown This code snippet looks fine. Where are you declaring the "forwardActionButton" style? It's not a three20 existing TTStyle as far as I k...
阅读全文
posted @
2012-05-08 19:45
easonoutlook
阅读(157)
推荐(0)
TTButton 的正确使用的方法
摘要:TTButton* button =[TTButton buttonWithStyle:@"forwardActionButton:" title:@"Login"];[button setFrame:CGRectMake(245,160,65,33)];[self.view addSubview:button];不要忘记了 @"forwardActionButton:" 里面的冒号
阅读全文
posted @
2012-05-08 19:10
easonoutlook
阅读(171)
推荐(0)
Xcode删除断点的方法
摘要:在断点处 鼠标右键->edit breakpoint 选中,删除所有断点就可以,而且我发现此问题引起的原因是在连续几个句子中设完断点后,而我们又将这段代码删除引起的, 对应的位置进行处理,不然有些断点设置了,删除了原有的代码,后面就会有问题,死活找不到原因
阅读全文
posted @
2012-05-07 16:38
easonoutlook
阅读(407)
推荐(0)
UIImageView上面不能加载button
摘要:UIImageView上面不能加载button 否则button的 action无法响应
阅读全文
posted @
2012-05-04 12:01
easonoutlook
阅读(149)
推荐(0)
使用缓存到本地的图片对initWithUrl的进行初始化
摘要:NSString *imageB64 = [NSString stringWithFormat:@"%@",[uneImage imageB64]];NSData *dataImageB64 = [NSData dataFromBase64String:imageB64];UIImage *imagePNG = [UIImage imageWithData:dataImageB64];NSStri...
阅读全文
posted @
2012-05-03 23:04
easonoutlook
阅读(409)
推荐(0)
TTThumbsViewController 由 4张 改为 3张的方式 增补
摘要:TTThumbCell 里面要改, TTThumbDataSource里面也要改
阅读全文
posted @
2012-05-02 09:46
easonoutlook
阅读(138)
推荐(0)
extThree20XML extThree20JSON 引入到工程中的方式
摘要:今天尝试在Xcode中添加Three20框架,过程如下: 1、打开Xcode,创建一个新工程,工程文件夹要和下载下来的three20文件夹放在同一个路径下 2、应用程序--实用工具--终端 3、因为我的工程文件夹和three20文件夹都放在桌面,所以要先在终端输入“cd Desktop/”,回车 4、输入“python three20/src/scripts/ttmodule.py -p Thre...
阅读全文
posted @
2012-05-02 09:13
easonoutlook
阅读(202)
推荐(0)
TTThumbsViewController 由 4张 改为 3张的方式
摘要:TTThumbsViewController 编写相册的时候非常方便,但是有时需要修改为3张图片的展示方式 TTThumbsViewController 的cell TTThumbsTableViewCell //static const CGFloat kSpacing = 4; static const CGFloat kSpacing = 5; static const CGFlo...
阅读全文
posted @
2012-05-01 20:45
easonoutlook
阅读(151)
推荐(0)