摘要: - (void) performDismiss: (NSTimer *)timer{[baseAlert dismissWithClickedButtonIndex:0 animated:NO];//important[baseAlert release];baseAlert = NULL;}- (void) presentSheet{baseAlert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"\nMessage to user with asynchronous information&qu 阅读全文
posted @ 2012-06-03 23:10 worldworld 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 如果AViewContorller通过addSubview增加BViewController的view到界面中,当旋转iphone时,AViewController可以接到shouldAutorotateToInterfaceOrientation和- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration消息,但是在BViewController中是没有办法接到这个二个消息的(目前我发现是这样的),但是如果是通 阅读全文
posted @ 2012-06-03 23:05 worldworld 阅读(142) 评论(0) 推荐(0) 编辑
摘要: NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];NSArray* languages = [defs objectForKey:@"AppleLanguages"];NSString* preferredLang = [languages objectAtIndex:0]; 阅读全文
posted @ 2012-06-03 18:10 worldworld 阅读(205) 评论(0) 推荐(0) 编辑
摘要: pageEnable属性 设置为YES的话后自动滚到下一页不会停在中间, 至于怎么判断当前页号 那只能根据页的frame 和 控件的 offset来判断了CGFloat pageWidth = ImageScrollView.frame.size.width;page = floor((ImageScrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1;NSLog(@"Image: %d",page) ;得到当前pag 阅读全文
posted @ 2012-06-03 00:49 worldworld 阅读(369) 评论(0) 推荐(0) 编辑
摘要: [fmt setDateFormat:@"yyyy/MM/dd hh:mm:ss:SSS"]; NSString *string=[fmt stringFromDate:nsDate];NSDateFormatter *dateFormatter = [[[NSDateFormatteralloc] init] autorelease]; [dateFormatter setDateFormat:@"yyyyMMddhhmmssSSS"]; return [dateFormatter stringFromDate:[NSDate date]];NSCal 阅读全文
posted @ 2012-06-01 18:24 worldworld 阅读(226) 评论(0) 推荐(0) 编辑
摘要: iphone OS主要提供以下4种播放音频的方法。Sestem Sound Services、AVAudioPlayer类、Audio Queue Services、OpenAL1.Sestem Sound ServicesSestem Sound Services是最底层的也是最简单的声音播放服务,调用AudioServicesPlaySystemSound这个方法就可以播放一些简单的音频文件,使用此方法只适合播放一些很小的提示或警告音,因为他有很多限制:{声音长度要小于30秒In linear PCM或者IMA4(IMA/ADPCM)格式的打包成.caf,.aif,或者.wav的文件不能控 阅读全文
posted @ 2012-06-01 16:09 worldworld 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 本来在下载完成之后,在UIImageWriteToSavedPhotosAlbum 里面响应image: (UIImage*) imagedidFinishSavingWithError: (NSError*) error contextInfo: (void*) contextInfo这个函数,然后来更新UI的,但是操作比较繁琐,而且UI的更新总是无法同步。所以采用GCD的方式,来完成,非常顺畅。- (void)downloadImageToPhotoAlbum{ [self.viewaddSubview:downloadingView]; dispatch_async(dispatch.. 阅读全文
posted @ 2012-05-29 16:44 worldworld 阅读(501) 评论(0) 推荐(0) 编辑
摘要: 报错为: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 阅读全文
posted @ 2012-05-29 12:32 worldworld 阅读(235) 评论(0) 推荐(0) 编辑
摘要: #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 阅读全文
posted @ 2012-05-28 23:41 worldworld 阅读(2538) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2012-05-28 19:41 worldworld 阅读(323) 评论(0) 推荐(0) 编辑