上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 23 下一页

2014年1月17日

摘要: 在文件xxxViewController.m中,// 添加前进按钮UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"Forward2" style:UIBarButtonItemStylePlain target:self action:@selector(forwardButtonPressed:)];self.navigationItem.rightBarButtonItem = rightButton; // 隐藏返回按钮UIBarButtonItem *leftButton 阅读全文
posted @ 2014-01-17 16:50 trako 阅读(823) 评论(0) 推荐(0) 编辑
摘要: 移除子视图两种方法方法1:for (int loop = 0; loop < [subViews count]; loop++){ UIView *subView = [subViews objectAtIndex:loop]; [subView removeFromSuperview];}方法2:NSArray *subViews = [subView subviews];if([subViews count] != 0){ [subViews makeObjectsPerformSelector:@selector(removeFromSuperview)];} 阅读全文
posted @ 2014-01-17 14:13 trako 阅读(436) 评论(0) 推荐(0) 编辑

2014年1月15日

摘要: NSDateFormatter *format = [[NSDateFormatter alloc] init];[format setDateFormat:@"yyyy-mm-dd hh:mm:ss"];NSString *strDate = [format stringFromDate:[NSDate date]];DLog(@"%@", strDate);其中DLog定义#ifdef DEBUG #define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCT 阅读全文
posted @ 2014-01-15 09:32 trako 阅读(229) 评论(0) 推荐(0) 编辑

2014年1月14日

摘要: 【问题现象】创建自定义storyboard,添加ViewController之后通过instantiateViewControllerWithIdentifier方法创建ViewController异常。【问题分析】原始代码:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ // Override point for customization after application launch. self.window = [ 阅读全文
posted @ 2014-01-14 15:57 trako 阅读(1184) 评论(0) 推荐(0) 编辑

2014年1月10日

摘要: 使用UIWebView显示html,提示:err is Error Domain=WebKitErrorDomain Code=101 “The operation couldn’t be completed. (WebKitErrorDomain error 101.)”NSString *path = [[NSBundle mainBundle] pathForResource:@"vhugo" ofType:@"epub"];NSURL *url = [NSURL URLWithString:[path stringByAddingPercentE 阅读全文
posted @ 2014-01-10 13:11 trako 阅读(737) 评论(0) 推荐(0) 编辑
摘要: - (void)drawRect:(CGRect)rect{ [self showPage:m_currentPageIndex];}- (void)showPage:(int)pageIndex{ CGContextRef cntxRef = UIGraphicsGetCurrentContext(); CGPDFPageRef page = CGPDFDocumentGetPage (m_docRef, pageIndex);// 2 // Quartz画图得坐标系统是以左下角为开始点,但iphone视图是以左上角为开始点 CGContextTranslateCTM(cntxRef, 0. 阅读全文
posted @ 2014-01-10 13:07 trako 阅读(440) 评论(0) 推荐(0) 编辑

2014年1月8日

摘要: 当使用NSLog打印时,不论是Debug模式还是Release模式,均会打印出来,并且无法找到是哪个类哪个方法,如下方式可参考解决这两个问题。#ifdefDEBUG#defineDLog(fmt,...)NSLog((@"%s[Line%d]"fmt),__PRETTY_FUNCTION__,__LINE__,##__VA_ARGS__);#else#defineDLog(fmt,...)#endif测试,在CViewController.m文件中代码:DLog(@"load %d", 3);打印结果:2014-01-0809:25:11.589Prot 阅读全文
posted @ 2014-01-08 09:26 trako 阅读(166) 评论(0) 推荐(0) 编辑

2013年12月26日

摘要: [NSThreadsleepForTimeInterval:1]; // 单位秒 阅读全文
posted @ 2013-12-26 10:46 trako 阅读(219) 评论(0) 推荐(0) 编辑
摘要: zh转自“http://blog.csdn.net/likendsl/article/details/8568961”在iOS中有几种方法来解决多线程访问同一个内存地址的互斥同步问题:方法一,@synchronized(id anObject),(最简单的方法)会自动对参数对象加锁,保证临界区内的代码线程安全@synchronized(self){//这段代码对其他@synchronized(self)都是互斥的//self指向同一个对象}方法二,NSLockNSLock对象实现了NSLocking protocol,包含几个方法:lock,加锁unlock,解锁tryLock,尝试加锁,如果 阅读全文
posted @ 2013-12-26 10:43 trako 阅读(162) 评论(0) 推荐(0) 编辑

2013年12月25日

摘要: 转自“http://addls.com/in-house-%E5%8F%91%E5%B8%83-ipa.html”企业版IDP,即iOS Development Enterprise Program。注意是$299/Year那种,并不是$99/Year的那种。这种方式的IDP其最大的好处在于:可以发布“In House”应用。这种应用使用一种叫做“In House Distribution Provisioning Profile”的文件进行发布,不能发布到Apple Shop进行销售,也不需要经过Apple的评审。你可以把“In House”应用通过任何方式发布给你的企业员工、用户及其他你认 阅读全文
posted @ 2013-12-25 16:33 trako 阅读(284) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 23 下一页

导航