摘要:
1.由于使用了私有方法activeInstancedismissKeyboard@try { Class UIKeyboardImpl = NSClassFromString(@"UIKeyboardImpl"); id activeInstance = [UIKeyboardImpl performSelector:@selector(activeInstance)]; [activeInstance performSelector:@selector(dismissKeyboard)]; } @catch (NSException *exception) { NSLog 阅读全文
摘要:
有个插件 iPhone Simulator Capture,可以对模拟器窗口录视频iPhone-Simulator Cropper:下载地址:http://iphonedevelopertips.com/tools/capture-screenshots-of-the-iphone-simulator-with-iphone-simulator-cropper.html 阅读全文
摘要:
NSStringEncodingenc=CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);NSString*retStr=[[NSStringalloc]initWithData:dataencoding:enc];附:编码集列表CFStringEncodingconstants for encodings that may be supported by CFString.enum {kCFStringEncodingMacRoman= 0L,kCFStringEncodingMacJapane 阅读全文
摘要:
扫描wifi信息:http://code.google.com/p/uwecaugmentedrealityproject/http://code.google.com/p/iphone-wireless/条形码扫描:http://zbar.sourceforge.net/iphone/sdkdoc/install.htmltcp/ip的通讯协议:http://code.google.com/p/cocoaasyncsocket/voip/sip:http://code.google.com/p/siphon/http://code.google.com/p/asterisk-voicema. 阅读全文
摘要:
在程序中如何把两张图片合成为一张图片- (UIImage *)addImage:(UIImage *)image1 toImage:(UIImage *)image2 {UIGraphicsBeginImageContext(image1.size);// Draw image1[image1 drawInRect:CGRectMake(0, 0, image1.size.width, image1.size.height)];// Draw image2[image2 drawInRect:CGRectMake(0, 0, image2.size.width, image2.size.hei 阅读全文
摘要:
UIImageView *imageView = [self getYourImageView];imageView.image = [self getYourImage];imageView.userInteractionEnabled = YES;UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(yourHandlingCode:)];[imageView addGestureRecognizer:singleTap];[singl 阅读全文
摘要:
//得到当前的日期NSDate *date = [NSDate date];NSLog(@"date:%@",date);//得到(24 * 60 * 60)即24小时之前的日期,dateWithTimeIntervalSinceNow:NSDate *yesterday = [NSDate dateWithTimeIntervalSinceNow: -(24 * 60 * 60)];NSLog(@"yesterday:%@",yesterday);NSDateFormatter *formatter =[[[NSDateFormatter alloc] 阅读全文
摘要:
[textView resignFirstResponder]; @try { Class UIKeyboardImpl = NSClassFromString(@"UIKeyboardImpl"); id activeInstance = [UIKeyboardImpl performSelector:@selector(activeInstance)]; [activeInstance performSelector:@selector(dismissKeyboard)]; } @catch (NSException *exception) { NSLog(@" 阅读全文
摘要:
- (void)onSwitchViews:(id)sender { if (secondViewController == nil) { ContitionSelectorPage *tempViewController = [[ContitionSelectorPage alloc] initWithFrame: CGRectMake(0, 44, self.view.frame.size.width, self.view.frame.size.height-44) ]; secondViewController = [tempViewController retain]; [tempV. 阅读全文
摘要:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; NSString *yourPosition = [prefs stringForKey:@"position"]; NSLog(@"Your position is: %@",yourPosition); //To set a default NSString *newPosition = @"here"; [prefs setObject: newPosition forKey:@"positio 阅读全文