08 2013 档案
摘要:- (void)showTaped{ /* dispatch_get_global_queue dispatch_get_main_queue dispatch_queue_create dispatch_get_current_queue dispatch_queue_get_label dispatch_set_target_queue dispatch_main */ //卡UI// dispatch_async(dispatch_get_main_queue(), ^{// [sel...
阅读全文
摘要:一:std:编译器错误解决二:错误提示"std::string::find_first_of(char const*, unsigned long, unsigned long) const", referenced from: split_string(std::string const&, std::string const&) in libopencv_core.a(cmdparser.o) "std::string::find_first_of(char, unsigned long) const", referenced fro
阅读全文
摘要:一:修改 .vimrc即可二:set nocompatible " 关闭 vi 兼容模式syntax on " 自动语法高亮colorscheme molokai " 设定配色方案set number " 显示行号set cursorline " 突出显示当前行set ruler " 打开状态栏标尺set shiftwidth=4 " 设定 > 命令移动时的宽度为 4set softtabstop=4 " 使得按退格键时可以一次删掉 4 个空格set tabstop=4 " 设定 tab 长度为 4
阅读全文
摘要:一:终端进入cd /usr/share/vim/二:sudo vim vimrc三:添加syntax enablesyntax on四:保存退出
阅读全文
摘要:一:使用 cocoaPod错误The platform of the target `Pods` (iOS 4.3) is not compatible with `AFNetworking (1.3.2)` which has a minimum requirement of OS X 10.7 - iOS 5.0.二:解决方案 打开项目中 Podfile 文件 修改其 iOS平台为对应平台
阅读全文
摘要:+ (KKTextHUB *)sharedTextHUB{ static KKTextHUB *sharedHub = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedHub = [[self alloc]initWithFrame:CGRectMake(0, 0, 0, 0)]; }); return sharedHub;}
阅读全文
摘要:- (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); UIGraphicsPushContext(context); CGRect boxRect = CGRectMake(0, 0, 90,90); float radius = 10.0f; CGContextBeginPath(context); CGContextMoveToPoint(context, CGRectGetMinX(boxRect) + radius, ...
阅读全文
摘要:一、到http://regexkit.sourceforge.net/下载RegexKitLite类,添加到项目中;因为RegexKitLite使用ICU库,所以需要动态链接到/usr/lib/libicucore.dylib库当中去,否则你会得到13个错误。具体Dynamically linked to /usr/lib/libicucore.dylib方法如下1.进入菜单Project->Edit Project Settings2.在搜索框内输入linker搜索,找到”Other Linker Flags”选项。加入一个新的标签,名为-licucore。(这样可能更好:工程中添加l
阅读全文
摘要:一: NSDateFormatter *dateFormater = [[NSDateFormatter alloc]init]; [dateFormater setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSTimeZone* localzone = [NSTimeZone localTimeZone]; NSTimeZone* GTMzone = [NSTimeZone timeZoneForSecondsFromGMT:0]; [dateFormater setTimeZone:GTMzone]; [dateForm...
阅读全文
摘要:UISlider *aslider = [[UISlider alloc]initWithFrame:kCR(50, 50, 200, 200)]; [aslider setValue:0.5]; [aslider setThumbImage:[UIImage imageNamed:@"ssuibian .png"] forState:UIControlStateNormal]; [aslider setThumbImage:[UIImage imageNamed:@"ssuibian .png"] forState:UIControlStateHigh
阅读全文
摘要:方法一: UILabel *mindName = [[UILabel alloc]initWithFrame:kCR(0, 0, 25,40)]; mindName.text = @"苏\n小\n明"; mindName.numberOfLines = [mindName.text length]; 方法二:// NSString *text = @"一";// NSString *strText = @"苏得强";// UIFont *font = [UIFont systemFontO...
阅读全文
摘要:1:假如有6个图片:那个,Scrollview的大小加 7 个图片的大小2: //ImageScrollView; UIScrollView *imageScroll = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 320, 210)]; imageScroll.bounces = YES; imageScroll.pagingEnabled = YES; imageScroll.userInteractionEnabled = YES; imageScroll.showsVerticalScrollI...
阅读全文
摘要:SEL selAction =NSSelectorFromString([actionArrayobjectAtIndex:indexArray]);[item addTarget:self action:selAction];Objective-C在编译的时候,会根据方法的名字(包括参数序列),生成一个用 来区分这个方法的唯一的一个ID,这个ID就是SEL类型的。我们需要注意的是,只要方法的名字(包括参数序列)相同,那么它们的ID都是相同的。就是 说,不管是超类还是子类,不管是有没有超类和子类的关系,只要名字相同那么ID就是一样的。我们可以方便的通过方法的名字,获取到方法的ID也就是我们所说
阅读全文
摘要:- (float) heightForTextView: (UITextView *)textView WithText: (NSString *) strText{ float fPadding = 10.0; CGSize constraint = CGSizeMake(textView.contentSize.width - fPadding, CGFLOAT_MAX); CGSize size = [strText sizeWithFont: textView.fontconstrainedToSize:constraint lineBreakMode:NSLineBreakB...
阅读全文
摘要:一:添加通知//数字键盘添加完成 [[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(keyboardWillShow:) name:UIKeyboardDidShowNotificationobject:nil];二:数字键盘出现添加//键盘处理- (void)keyboardWillShow:(NSNotification *)note{ UIButton *doneButton = [UIButton buttonWithType:UIButtonTypeCustom]; doneB...
阅读全文
摘要:一:添加通知监测键盘高度变化 [selfkeyBoardAutoSize];二:动态改变高度#pragma mark keyboard height auto/* NSNotificationCenter:键盘出现、消失时的通知 UIKeyboardWillShowNotification; UIKeyboardDidShowNotification; UIKeyboardWillHideNotification; UIKeyboardDidHideNotification; */- (void) keyBoardAutoSize{ [[NSNotificationCenter d...
阅读全文
摘要:titleLabel.font = [UIFontboldSystemFontOfSize:16];
阅读全文