06 2012 档案
摘要:http://blog.cnrainbird.com/index.php/2012/05/31/guan_yu_git_de_submodule/搞开发的都大都知道章鱼猫吧(github,哈哈~~)。里面有各种智慧的结晶合理利用,事半功倍。可是最近发现里面稍微复杂一些的工程都开始整submodule了。无论是直接zip下载,还是clone的,submodule都是空的,这样的运行肯定会提示缺少文件撒。以icyleaf的ShareKit为例,里面依懒了JSONKit等其它开源工程。这种情况下怎么办呢?还是直接命令行吧。打开终端(terminal)找个地儿执行以下命令:[rainbird@loca
阅读全文
摘要:Mac OS Terminal 基本指令(全)Mac OS X 启用超级用户的方法Root user,又名超级用户,是一个权力最高的Unix 账户,Root 的账户能在整个系统里任何部份进行任何“操作”,包括:拷贝档案、移动/移除档案、执行程序等。所以,通常 Root 的账户都只会指派给高级专业的用户使用。因此,苹果把Root user 隐藏在MacOS X 里。但有时候我们不得不启用Root用户以便于实现某些操作,可以通过以下三种方法把启动Root账户。方法一:把Mac OS X 的安装光盘放入到光驱中,用光盘启动系统,在安装菜单里选择“Password Reset”选项,便能更改你的密码和
阅读全文
摘要:NSURL* nurl=[[NSURLalloc]initWithString:[urlStringstringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
阅读全文
摘要:-(void)setContentInset:(UIEdgeInsets)s{ UIEdgeInsets insets = s; if(s.bottom>8) insets.bottom = 0; insets.top = 0; [super setContentInset:insets];}http://www.hanspinckaers.com/multi-line-uitextview-similar-to-smshttp://stackoverflow.com/questions/3696443/remove-bottom-space-from-uitextview
阅读全文
摘要:写入plist文件NSString *plistPath = @"/private/var/mobile/Media/iTunes_Control/iTunes/Ringtones.plist"; NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath]; [[dictionary objectForKey:@"Ringtones"] setObject:ringtones forKey:ringName]; if (![d
阅读全文
摘要:float coordinate =2.0f;[nodeScrollView setContentOffset:CGPointMake(460* coordinate,0) animated:YES];http://stackoverflow.com/questions/4436745/uiscrollview-with-next-and-previous-button-actionfor (UIView *view in [[self superview] subviews]) { if ([view isKindOfClass:[UIScrollView class]]) { ...
阅读全文
摘要:NSFileManager *fileManager = [NSFileManagerdefaultManager];[fileManager contentsOfDirectoryAtPath:resourcePath error:nil]DLog(@"files is %@",[fileManager contentsOfDirectoryAtPath:resourcePath error:nil]);打印结果files is ( "20120606125656860.m4r", "20120606125709704.m4r",
阅读全文
摘要:这个问题的实质应该是在非主线程中 直接修改 界面。如果把alertView 发在主线程调用就ok了。==============非主线程[self performSelectorOnMainThread:@selector(onResp*****eInMainThread) withObject:nil waitUntilDone:YES];============= 主线程-(void)onResp*****eInMainThread{[waitingBackView removeFromSuperview];UIAlertView *alert = [[UIAlertView alloc]
阅读全文
摘要:static RootViewController *sharedRootController = nil;+(RootViewController *) sharedController{@synchronized(self){if (sharedRootController == nil) {sharedRootController = [[[self alloc] init] autorelease];}}return singleController;}+(id) allocWithZone:(NSZone *)zone{@synchronized(self){if (sharedRo
阅读全文
摘要:Filename Dimensi*****Default-Portrait.png * 768w x 1004hDefault-PortraitUpsideDown.png 768w x 1004hDefault-Landscape.png ** 1024w x 748hDefault-LandscapeLeft.png 1024w x 748hDefault-LandscapeRight.png 1024w x 748hDefault.png Not recommended
阅读全文
摘要:- (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
阅读全文
摘要:如果AViewContorller通过addSubview增加BViewController的view到界面中,当旋转iphone时,AViewController可以接到shouldAutorotateToInterfaceOrientation和- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration消息,但是在BViewController中是没有办法接到这个二个消息的(目前我发现是这样的),但是如果是通
阅读全文
摘要:NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];NSArray* languages = [defs objectForKey:@"AppleLanguages"];NSString* preferredLang = [languages objectAtIndex: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
阅读全文
摘要:[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
阅读全文
摘要: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的文件不能控
阅读全文
浙公网安备 33010602011771号