摘要: make clean./configure --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc'--sysroot=/Applications/Xcode.app/Contents/Developer/ 阅读全文
posted @ 2013-02-02 22:16 Mr.Songz 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 1:如果程序没有启动,在这里获得- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions{NSDictionary*apsDict = [[launchOptionsobjectForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"]objectForKey:@"aps"];NSString*apn = [NSStringstringWith 阅读全文
posted @ 2012-08-16 10:17 Mr.Songz 阅读(208) 评论(0) 推荐(0) 编辑
摘要: iOS4.0开始支持multitasking,这是一件令人振奋的消息。但对程序员们来说,却未必如此。苹果至今不在SDK中提供退出应用程序的API。要退出程序,必须通过Home键。但从iOS4.0开始,按Home键iOS用suspend(挂起)代替了terminate(退出)。这个情况可以通过Info.plist设置改变,如果你将 UIApplicationExitsOnSuspend或者Applicationdos not run in background设置为true(注意不是YES),那么当按下Home键后,程序就会退出而不是挂起。例如,在程序OpenUrl中,我们在程序一启动,就调用S 阅读全文
posted @ 2012-08-15 18:22 Mr.Songz 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 一个View Controller A,弹出了一个Modal View Controller B,B又弹出了一个Modal ViewController C⋯⋯and so on。如果你在第n个Modal View Controller的时候,想回到第一个View Controller A,或者它前面的第m个ModalView Controller C,那怎么办?你一定想,一层层地解散呗。没错,我一开始也是这样干的:在C里解散D,在B里解散C,在A里解散B。那么你会获得一个“试图解散当前未显示的View Controller”错误。苹果的思维非同凡响,其实你只需要解散一个Modal View 阅读全文
posted @ 2012-08-15 18:08 Mr.Songz 阅读(215) 评论(0) 推荐(0) 编辑
摘要: +(NSMutableArray*)kuaisuMethodTest:(NSMutableArray*)dataArraylow:(int)lowIndexhigh:(int)highIndex{//NSMutableArray*data=[[NSMutableArrayalloc]initWithObjects:@"5",@"4",@"2",@"8",@"1",@"7",@"9",@"6",nil];if(lowIndex<hi 阅读全文
posted @ 2012-08-13 18:28 Mr.Songz 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 苹果SDK自带的就有密码保护,使用方法很简单,如下:1、引入Security.frameWork框架。2、引入头文件:SFHKeychainUtils.h.3、存密码:[SFHFKeychainUtilsstoreUsername:@"dd"andPassword:@"aa"forServiceName:SERVICE_NAMEupdateExisting:1error:nil];[SFHFKeychainUtilsdeleteItemForUsername:@"dd"andServiceName:SERVICE_NAMEerror: 阅读全文
posted @ 2012-08-13 10:34 Mr.Songz 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1 //方法一: 2 - (NSUInteger)wordCount:(NSString *)str { 3 NSUInteger words = 0; 4 NSScanner *scanner = [NSScanner scannerWithString: str]; 5 6 // Look for spaces, tabs and newlines 7 NSCharacterSet *whiteSpace = [NSCharacterSet whitespaceAndNewlineCharacterSet]; 8 while ([scanner scanUpToC... 阅读全文
posted @ 2012-08-10 17:19 Mr.Songz 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 1 +(BOOL)CheckPhoneNumInput:(NSString *)_text{2 NSString *Regex =@"(13[0-9]|14[57]|15[012356789]|18[02356789])\\d{8}";3 NSPredicate *mobileTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", Regex];4 return [mobileTest evaluateWithObject:_text];5 } 阅读全文
posted @ 2012-08-10 17:14 Mr.Songz 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 一个view上有好多输入框,只需调用: [self.view endEditing:YES]; 阅读全文
posted @ 2012-08-10 17:12 Mr.Songz 阅读(264) 评论(0) 推荐(0) 编辑
摘要: #ifdef __OPTIMIZE__ #define NSLog(...) #endif注:以上代码需要修改发布模式为Release, (以Xcode4.2为例 做法如) Edit Scheme> Run xxx(程序名) > Destination 改成你要发布的iOS Device 或 模拟器 >info 选项卡 > build configuration > Release 选项 阅读全文
posted @ 2012-08-10 17:06 Mr.Songz 阅读(223) 评论(0) 推荐(0) 编辑