EnamelPot

自律在于今天和明天之间

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

摘要: 、 阅读全文
posted @ 2013-12-09 13:42 EnamelPot 阅读(183) 评论(0) 推荐(0) 编辑

2013年12月11日

摘要: NSLog的格式如下所示: %@ 对象 %d, %i 整数 %u 无符整形 %f 浮点/双字 %x, %X 二进制整数 %o 八进制整数 %zu size_t %p 指针 %e 浮点/双字 (科学计算) %g 浮点/双字 %s C 字符串 %.*s Pascal字符串 %c 字符 %C unichar %lld 64位长整数(long long) %llu 无符64位长整数 %Lf 64位双字 阅读全文
posted @ 2013-12-11 14:29 EnamelPot 阅读(138) 评论(0) 推荐(0) 编辑

摘要: ---恢复内容开始---1.NSString 静态字符串1.1赋值int main(int argc, const char * argv[]){ @autoreleasepool { //经典的字符串赋值 NSString *str0 = @"Name: "; //字符串赋值 参数中只可以写一个字符串 和第一种很像 NSString *str1 = [NSString stringWithString:@"Enamel Pot "]; //字符串格式化合并 ... 阅读全文
posted @ 2013-12-11 13:57 EnamelPot 阅读(400) 评论(0) 推荐(0) 编辑

摘要: Objective-C语言可以在Array数组中放任意类型的数据,值得注意的是只能放指向这个对象的指针,如果直接放int ,char,double 等等,是不行的.1.NSArray 不可变数组使用NSArray关键字创建一个不可变的数组,一旦初始化完毕后这个数组的元素是不可以在动态的添加与删除。1.1创建数组//结尾的nil 表示结束 NSArray *array= [NSArray arrayWithObjects:@"雨松", @"MOMO",@"哇咔咔",myClass,nil]; 1.2数组长度int count = [ar 阅读全文
posted @ 2013-12-11 13:32 EnamelPot 阅读(311) 评论(0) 推荐(0) 编辑

2013年12月9日

摘要: UINavigationController的结构最朴素的说,UINavigationController就是一个容器,设置它的RootViewController,即设定了第一个vc,随后push一个新vc即入栈,pop便出栈,值得注意到是pop可以到任意层的vc。1.创建一个NavigationController 并设定RootViewControllerself.window.rootViewController=[[UINavigationController alloc]initWithRootViewController:[[AViewController alloc]initW 阅读全文
posted @ 2013-12-09 16:44 EnamelPot 阅读(367) 评论(0) 推荐(0) 编辑

摘要: UITabBarController的结构1.创建一个UITabBarControllerUITabBarController通常作为rootViewController,且不能添加到别的container viewController中。最常见的创建UITabBarController的地方就是在application delegate中的applicationDidFinishLaunching:方法中。//1.创建一个UITabBarController对象(这个自建类继承子UITabBarController)RootViewController *tabView=[RootViewC 阅读全文
posted @ 2013-12-09 16:22 EnamelPot 阅读(361) 评论(0) 推荐(0) 编辑

摘要: 1.在ios5中,ViewController中新添加1个属性和5个方法@property(nonatomic,readonly) NSArray *childViewControllers- (void)addChildViewController:(UIViewController *)childController- (void) removeFromParentViewController- (void)transitionFromViewController::::::- (void)willMoveToParentViewController:(UIViewController * 阅读全文
posted @ 2013-12-09 15:50 EnamelPot 阅读(1935) 评论(0) 推荐(0) 编辑

摘要: 1.presentViewController新建2个viewcontroller a和ba弹出b 则a为presenting view controller b为presented view controller-(void)someButtonClicked { [self presentViewController:self.aVC animated:YES completion:^{ }]; } 2.Modal Presentation Styles(弹出风格)设置presented VC的modalPresentationStyle属性UIModalPresentat... 阅读全文
posted @ 2013-12-09 15:40 EnamelPot 阅读(557) 评论(0) 推荐(0) 编辑

摘要: 1在Info.plist中设置UIViewControllerBasedStatusBarAppearance 为NO2 在需要改变状态栏颜色的ViewController中在ViewDidLoad方法中增加:[ [UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];如果需要在全部View中都变色,可以写在父类的相关方法中。 阅读全文
posted @ 2013-12-09 13:51 EnamelPot 阅读(166) 评论(0) 推荐(0) 编辑

摘要: 1 //得到名为Main的storyboard的实例2 [UIStoryboard storyboardWithName:@"Main" bundle:nil];3 //得到名为aaa的VC实例 也就是说在storyboard中设置的VC其实是你已链接类的一个实例4 [storyboard instantiateViewControllerWithIdentifier:@"aaa"];5 6 //洁一些7 UIViewController *someVC = [self.storyboard instantiateViewControllerWithId 阅读全文
posted @ 2013-12-09 13:48 EnamelPot 阅读(205) 评论(0) 推荐(0) 编辑