文章分类 -  objective - c

摘要:@implementation UINavigationItem (margin)#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_6_1- (void)setLeftBarButtonItem:(UIBarButtonItem *)_leftBarButtonItem{ if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { UIBarButtonItem *negativeSeperator = [[UIBarButtonItem alloc... 阅读全文
posted @ 2013-10-25 16:32 Alien.chang 阅读(66) 评论(0) 推荐(0)
摘要:在UIViewController中添加- (void) viewDidLayoutSubviews{ if(floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) { CGRect viewBounds = self.view.bounds; CGFloat topBarOffset = self.topLayoutGuide.length; viewBounds.origin.y = topBarOffset * -1; self.view... 阅读全文
posted @ 2013-10-25 13:51 Alien.chang 阅读(102) 评论(0) 推荐(0)
摘要://初始化textfield并设置位置及大小 UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)];//设置边框样式,只有设置了才会显示边框样式 text.borderStyle = UITextBorderStyleRoundedRect; typedef enum { UITextBorderStyleNone, UITextBorderStyleLine, UITextBorderStyleBezel, UITextBorderStyleRoundedRect } ... 阅读全文
posted @ 2013-10-23 16:10 Alien.chang 阅读(64) 评论(0) 推荐(0)
摘要:最近ios7正式发布了,作为一名"优秀"移动互联网开发者,必须跟上技术发展的脚步。不说废话。从Xcode4升级到Xcode5最大的问题就是Xcode5的模拟器无法使用,当然升级的前提是系统先升级。模拟器无法使用的原因无非就是Xcode4有残留,没有彻底拆卸。这里我推荐一个软件"cleanMyMac",但一定要用英文版,中文版总是会出现一系列的问题。清除后查看“关于本机 - 更多信息 - 系统报告 -软件 - Developer”如果没有Xcode的信息就对了,再次升级Xcode5,OK,可以用了 阅读全文
posted @ 2013-10-23 16:09 Alien.chang 阅读(88) 评论(0) 推荐(0)
摘要:UIDatePicker *datePickerNSDate *date = [datedatePicker]; 阅读全文
posted @ 2013-10-23 16:08 Alien.chang 阅读(333) 评论(0) 推荐(0)
摘要:首先打开类文件,也就是.m文件,在implement后面右键类名->Refactor->Rename 阅读全文
posted @ 2013-10-23 16:06 Alien.chang 阅读(100) 评论(0) 推荐(0)
摘要:我们从Eclipse、visiual statio走来,刚接触Xcode,却发现不能在工程中新建文件夹,真得不能吗?其实也是有其他办法的,first,你可以在Finder中新建文件夹然后拖到工程中,当然,这种办法太傻。second,工程,右键,new group。 如此简单,紧紧就是换个名字,但新手一般都会迷惑。 阅读全文
posted @ 2013-10-23 16:04 Alien.chang 阅读(136) 评论(0) 推荐(0)