05 2012 档案
摘要:本来在下载完成之后,在UIImageWriteToSavedPhotosAlbum 里面响应image: (UIImage*) imagedidFinishSavingWithError: (NSError*) error contextInfo: (void*) contextInfo这个函数,然后来更新UI的,但是操作比较繁琐,而且UI的更新总是无法同步。所以采用GCD的方式,来完成,非常顺畅。- (void)downloadImageToPhotoAlbum{ [self.viewaddSubview:downloadingView]; dispatch_async(dispatch..
阅读全文
摘要:报错为:TTRequestLoader connection:didReceiveResponse:](354): TTDASSERT failed: 0 == _queue.maxContentLength || contentLength <=_queue.maxContentLength解决方法:// If you hit this assertion it's because a massive file is about to be downloaded. // If you're sure you want to do this, add the follow
阅读全文
摘要:#importIn the C language, the#includepre-compile directive always causes a file's contents to be inserted into the source at that point. Objective-C has the equivalent#importdirective except each file is included only once per compilation unit, obviating(去除) the need forinclude guards.for exampl
阅读全文
摘要:1、首先缓存图片,等待后面利用本地url来取dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ TTURLCache *cache = [TTURLCache sharedCache]; for (NSDictionary *item in results) { if (![cache hasDataForKey:[item objectForKey:@"thumb_url"] expires:3000]) { [cache stor...
阅读全文
摘要:http://www.gocalf.com/blog/iphone-dev-hide-status-bar.html1、在info.plist里面 Status bar is initially hidden 设置为 YES2、在appDelagate里面 设置[application setStatusBarHidden:NOwithAnimation:UIStatusBarAnimationFade]; 即可。App启动时就隐藏状态栏用了上面的方法之后,App在运行过程中,状态栏确实被隐藏起来了,但是我发现在App启动的那个瞬间,还是可以看到状态栏的,然后一闪即过。虽然时间很短暂,看着还是
阅读全文
摘要:大家在新建文件的时候默认在文件的开关都会生成这样的注释:/**** Created by XX on 08-9-4.* Copyright 2008 __MyCompany__. All rights reserved.**/每次要拖动改__MyCompany__很麻烦,可以直接在命令行下输入: defaults write com.apple.xcode PBXCustomTemplateMacroDefiniti***** '{ ORGANIZATIONNAME = "cryfish"; }'重启XCode,这样新建文件的J__MyCompany__就自
阅读全文
摘要:我找到获得界面语言设置的方法了:NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];NSArray* languages = [defs objectForKey:@"AppleLanguages"];NSString* preferredLang = [languages objectAtIndex:0];
阅读全文
摘要:最右侧加图片是以下代码,UIImageView *imgv=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"right.png"]];text.rightView=imgv;text.rightViewMode = UITextFieldViewModeAlways;如果是在最左侧加图片就换成:text.leftView=imgv;text.leftViewMode = UITextFieldViewModeAlways;UITextField继承自 UIControl,此类中有一个属性contentVert
阅读全文
摘要:textRectForBounds:Returns the drawing rectangle for the text field’s text.- (CGRect)textRectForBounds:(CGRect)boundsParametersboundsThe bounding rectangle of the receiver.Return ValueThe computed drawing rectangle for the label’s text.DiscussionYou should not call this method directly. If you want t
阅读全文
摘要:UISearchBar是无法修改其 textField的大小的http://stackoverflow.com/questions/556814/changing-the-size-of-the-uisearchbar-textfieldThe text field used in UISearchBar is a subclass of UITextField called UISearchBarTextField.AFAIK, there's no way to resize a UISearchBarTextField using the public API, and thep
阅读全文
摘要:http://cnbeta.com/articles/188721.htm集成开发环境(IDE)可以给程序员提供很大的帮助。大多数的IDE包含编译器和解释器。例如微软的 Visual Studio 本身内置的编译器和解释就是很好的例子,Eclipse 是另一个很好的例子。鼓励程序员使用IDE的主要原因是开发软件应用程序的各个组成部分之间可方便的进行切换。一般一个特定的IDE是负责处理一种编程语言,但也有一些支持多种编程语言的 IDE,例如 NetBeans,Microsoft Visual Studio,MyEclipse,WinDev和Xcode等等。IDE 的宗旨是提供了一个强大和易于使用
阅读全文
摘要:http://blog.sina.com.cn/s/blog_677089db0100us05.htmlhttp://hi.baidu.com/popln/blog/item/a8f3921e2944701f304e15c3.html// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.- (void)viewDidLoad {[super viewDidLoad];self.view.backgroundColor=[UIColor whiteColor];UI
阅读全文
摘要:rm -rf three20http://www.flutterstudio.com/internet/2610.htmlrm 删除命令。即remove的缩写,它后面有两个参数。-r 删除文件夹内的子文件夹及内容,一般情况下rm只能删 除文件或者空的文件夹。-f 强制删除参数如果需要了解rm命令的更多参数。请输入:man rm
阅读全文
摘要:http://blog.csdn.net/x1135768777/article/details/7505903MPMoviePlayerController 与AVAudioPlayer有点类似,前者播放视频,后者播放音频,不过也有很大不同,MPMoviePlayerController 可以直接通过远程URL初始化,而AVAudioPlayer则不可以。不过大体上用起来感觉差不多。在这之前当然要包含库文件的#import<MediaPlayer/MediaPlayer.h>1.创建MPMoviePlayerController 类通过一个NSURL来初始化,这个URL可以使本地
阅读全文
摘要:sudo vi /etc/hosts然后提示输入系统密码hosts文件就自动打开了接着输入 i进入编辑模式将添加的网站,ip拷贝进去编辑完成之后,按esc,输入 : wq这样就更改完成了.w! 或者 wq! 进行强制写入然后退出http://www.douban.com/group/topic/7726277/
阅读全文
摘要:self.tableView.rowHeight = kThumbnailRowHeight;self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
阅读全文
摘要:scrollView 的ContentSize一定要比 它的frame大,否则无法响应滑动的事件http://www.iphonedevsdk.com/forum/iphone-sdk-development/102099-uiscrollview-tabbar-application.htmlLet's say you put a scroll view on the screen, and it is 100x100. If the content size is also 100x100, why would it scroll? You can already see ever
阅读全文
摘要:[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com/"]];记住前面的http:// 以及后面的 / 否则无法调用打开,很郁闷
阅读全文
摘要:http://stackoverflow.com/questions/1553118/adding-image-to-navigation-barloadView里面 无法添加,只能在 viewWillAppear里面进行添加
阅读全文
摘要:http://stackoverflow.com/questions/6434911/ttbutton-not-shownThis code snippet looks fine. Where are you declaring the "forwardActionButton" style? It's not a three20 existing TTStyle as far as I know. Any custom styles should be in a style sheet class and should be loaded in the app d
阅读全文
摘要:TTButton* button =[TTButton buttonWithStyle:@"forwardActionButton:" title:@"Login"];[button setFrame:CGRectMake(245,160,65,33)];[self.view addSubview:button];不要忘记了@"forwardActionButton:" 里面的冒号
阅读全文
摘要:在断点处 鼠标右键->edit breakpoint 选中,删除所有断点就可以,而且我发现此问题引起的原因是在连续几个句子中设完断点后,而我们又将这段代码删除引起的,对应的位置进行处理,不然有些断点设置了,删除了原有的代码,后面就会有问题,死活找不到原因
阅读全文
摘要:UIImageView上面不能加载button否则button的 action无法响应
阅读全文
摘要:NSString *imageB64 = [NSString stringWithFormat:@"%@",[uneImage imageB64]];NSData *dataImageB64 = [NSData dataFromBase64String:imageB64];UIImage *imagePNG = [UIImage imageWithData:dataImageB64];NSString *tempURL = [[TTURLCache sharedCache] storeTemporaryImage:imagePNG toDisk:NO];MockPhoto
阅读全文
摘要:TTThumbCell 里面要改, TTThumbDataSource里面也要改
阅读全文
摘要:今天尝试在Xcode中添加Three20框架,过程如下:1、打开Xcode,创建一个新工程,工程文件夹要和下载下来的three20文件夹放在同一个路径下2、应用程序--实用工具--终端3、因为我的工程文件夹和three20文件夹都放在桌面,所以要先在终端输入“cd Desktop/”,回车4、输入“python three20/src/scripts/ttmodule.py -p Three20Test/Three20Test.xcodeproj Three20”,回车这里“Three20Test/Three20Test.xcodeproj”是我建的工程名5、输入“python three20
阅读全文
摘要:TTThumbsViewController 编写相册的时候非常方便,但是有时需要修改为3张图片的展示方式TTThumbsViewController 的cell TTThumbsTableViewCell//static const CGFloat kSpacing = 4;static const CGFloat kSpacing = 5;static const CGFloat kDefaultThumbSize = 100;//static const CGFloat kDefaultThumbSize = 75;一个用于设置空隙,一个用于设置 图片的宽度TTThumbsViewCon
阅读全文
浙公网安备 33010602011771号