摘要:
/* ZXMacro.h 使用方法: *需要时import *添加到-Prefix.pch文件中,所有类中都可以使用 http://zhangxi.me https://github.com/zhangxigithub/ZXMicro 2013.3.26 *///------------------------------------Debug/Release#ifdef DEBUG//Debug模式//...#else//发布模式//...//屏蔽NSLog#define NSLog(...) {};#endif//------------------------------------Si 阅读全文
posted @ 2013-09-26 12:30
天下.无贼
阅读(189)
评论(0)
推荐(0)
摘要:
//arc4random() 比较精确不需要生成随即种子//通过arc4random() 获取0到x-1之间的整数的代码如下:int value = arc4random() % x;//获取1到x之间的整数的代码如下:int value = (arc4random() % x) + 1;//CCR... 阅读全文
posted @ 2013-09-26 12:23
天下.无贼
阅读(161)
评论(0)
推荐(0)
摘要:
解决iOS 6.0 下 在输入中文时 按下锁屏键 导致的闪退问题最近 QA报Bug,为UITextField 输入中文后,按下锁屏键 程序会闪退,网上大概搜索了下,上述代码可以解决问题。 1 (void)applicationDidEnterBackground:(UIApplication *)application { 2 3 UIDevice * device = [UIDevice currentDevice]; 4 BOOL backgroundSupported = NO; 5 if ([device respondsToSelector:@selector(i... 阅读全文
posted @ 2013-09-26 12:15
天下.无贼
阅读(136)
评论(0)
推荐(0)
摘要:
[[NSString stringWithUTF8String:__FILE__] lastPathComponent]:文件名__LINE__:行号[NSString stringWithUTF8String:__PRETTY_FUNCTION__]:方法名1 #define JYLOG( s, ... ) NSLog( @"%@ %@", [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithUTF8String:__PRETTY_FUNCT 阅读全文
posted @ 2013-09-26 12:11
天下.无贼
阅读(155)
评论(0)
推荐(0)
摘要:
#import #import #define IFPGA_NAMESTRING @"iFPGA"#define IPHONE_1G_NAMESTRING @"iPhone 1G"#define IPHONE_3G_NAMESTRING @"iPhone 3G"#define IPHONE_3GS_NAMESTRING @"iPhone 3GS" #define IPHONE_4_NAMESTRING @"iPhone 4" #define IPHONE_4S_NAMESTRING @" 阅读全文
posted @ 2013-09-26 12:08
天下.无贼
阅读(247)
评论(0)
推荐(0)
摘要:
代码 //给文本输入框后面加入空白 _txtAccount.rightView = _btnDropDown; _txtAccount.rightViewMode = UITextFieldViewModeAlways; //给文本输入框前面加入空白 CGRect frame = [_txtAccount frame]; frame.size.width = 5; UIView *leftview = [[UIView alloc] initWithFrame:frame]; _txtAccount.leftViewMode = UITextFieldViewModeAlways; _txt. 阅读全文
posted @ 2013-09-26 12:06
天下.无贼
阅读(324)
评论(0)
推荐(0)
摘要:
#importa1=@"This is a1";a2=@"This is a2";a3=@"This is a3";for(inti =0; i <3; i++) {NSString*var = [NSStringstringWithFormat:@"a%d",i +1];Ivarivar =object_getInstanceVariable(self,var.UTF8String,NULL);NSString*str = (NSString*)object_getIvar(self, ivar);NSLo 阅读全文
posted @ 2013-09-26 12:05
天下.无贼
阅读(611)
评论(0)
推荐(0)
摘要:
//定义一个消息中心[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; //addObserver:注册一个观察员name:消息名称- (void)keyboardWillShow:(NSNotification *)note {// create custom buttonUIButton *doneButton = [UIButton buttonWithTyp 阅读全文
posted @ 2013-09-26 12:04
天下.无贼
阅读(130)
评论(0)
推荐(0)
摘要:
CGSize titleBrandSizeForHeight = [titleBrand.text sizeWithFont:titleBrand.font];CGSize titleBrandSizeForLines = [titleBrand.text sizeWithFont:titleBrand.font constrainedToSize:CGSizeMake(infoWidth, MAXFLOAT) lineBreakMode:UILineBreakModeWordWrap];titleBrand.numberOfLines = ceil(titleBrandSizeForLine 阅读全文
posted @ 2013-09-26 12:04
天下.无贼
阅读(197)
评论(0)
推荐(0)
摘要:
-(NSString *) getWeek:(NSDate *) d { NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; unsigned units = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekdayCalendarUnit; NSDateComponents *components = [calendar components:units fromDate:. 阅读全文
posted @ 2013-09-26 12:03
天下.无贼
阅读(267)
评论(0)
推荐(0)
摘要:
//[ViewController writeWithFormat:@"1", @"2", @"3", nil];+ (void)__methodName__:(NSObject*)string, ...NS_REQUIRES_NIL_TERMINATION // 结尾请带上一个nil{va_lis... 阅读全文
posted @ 2013-09-26 12:02
天下.无贼
阅读(178)
评论(0)
推荐(0)
摘要:
/**< 自定义queue,默认串行: NULL == DISPATCH_QUEUE_SERIAL*//**< label:标签,用于标注queue*/// dispatch_queue_t queue = dispatch_queue_create("label", NULL);//// dispatch_async(queue, ^{// NSLog(@"test");// });/**< 自定义queue,并行或串行: DISPATCH_QUEUE_CONCURRENT或DISPATCH_QUEUE_SERIAL*/// disp 阅读全文
posted @ 2013-09-26 11:55
天下.无贼
阅读(179)
评论(0)
推荐(0)
摘要:
本文提供的是对AFNetWorking库的进一步封装,包括一个处理请求的HCHttpManager,它继承于AFHTTPClient; 1 #import "AFHTTPClient.h" 2 #import "HCHttpCmd.h" 3 4 @interface HCHttpManager : AFHTTPClient 5 { 6 NSMutableArray *_cmds; 7 } 8 9 @property (nonatomic, retain) NSMutableArray *cmds;10 11 + (HCHttpManager *)shar 阅读全文
posted @ 2013-09-26 10:53
天下.无贼
阅读(3219)
评论(0)
推荐(0)

浙公网安备 33010602011771号