ios成长之每日一遍(day 1)
Hello world开始。
这里不讨论如何创建项目导入项目。由于趁上班时间打酱油所以也不谈细节, 只谈具体项目的实现与关键流程的解析, 只供本人实际程况使用。不喜请移驾。
首先来谈谈 AppDelegate.h与AppDelegate.m 文件
AppDelegate.h:
#import <UIKit/UIKit.h> @class BIDViewController; // 声明引用的文件 @interface BIDAppDelegate : UIResponder <UIApplicationDelegate> // 实现UIApplicationDelegate协议中的方法,用于处理UIApplication接收的事件 @property (strong, nonatomic) UIWindow *window; // UIView的子类, 是所有UIView的根,管理和协调的应用程序的显示 @property (strong, nonatomic) BIDViewController *viewController; @end
AppDelegate.m:
#import "BIDAppDelegate.h" #import "BIDViewController.h" @implementation BIDAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // 初始化UIWindow
// Override point for customization after application launch.
self.viewController = [[BIDViewController alloc] initWithNibName:@"BIDViewController" bundle:nil]; // 初始化BIDViewController并且指定controller的xib文件, xib文件就是布局文件
self.window.rootViewController = self.viewController; // 指定window的根视图控制器
[self.window makeKeyAndVisible]; // 让window显示在屏幕上
return YES;
} - (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
} - (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
} - (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
} - (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
} - (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
} @end
由于是hello world, BIDViewController也没有什么东西, 只是一个简单的文本, 因此就不挪来说了, 至此第一篇ios的开端已经结束。
ios成长之每日一遍(day 1)的更多相关文章
- ios成长之每日一遍(day 8)
这几天都有一些任务要跟, 把ios的学习拉后, 看看要抓紧咯, 看看轮到的学习的是UITableView. BIDAppDelegate.h #import <UIKit/UIKit.h> ...
- ios成长之每日一遍(day 5)
iOS 屏幕方向那点事儿http://zhenby.com/blog/2013/08/20/talk-ios-orientation/ 针对当前的屏幕方向进行对应的代码布局 BIDViewContro ...
- ios成长之每日一遍(day 3)
今天要介绍一下更多的控键使用, 当然也会对上一篇说的控件做一个巩固, 所以这一篇涉及到的控键会包括 UIImage.UITextField.UIButton.UILabel.UISwitch.以及 U ...
- ios成长之每日一遍(day 7)
今天到UITabBarController 结合 UIPickView, 这里一共有5个实现, 由浅到易. 其实在IB上面使用UITabBarController很简单, 就像平常拖控件一样拖到界面上 ...
- ios成长之每日一遍(day 6)
toolBar上的View Switcher BIDAppDelegate.h #import <UIKit/UIKit.h> @class BIDSwitchViewController ...
- ios成长之每日一遍(day 4)
今天, 主要讲四种常见的问题, 废话不多说了, 直接开始. 自动布局:这个我发现有一篇文章写得非常好, 直接表明出地http://www.cocoachina.com/applenews/devnew ...
- ios成长之每日一遍(day 2)
接着下来简单说说Label(相当于android的textview)和button的使用, 由于都是与上篇的AppDelegate一致, 所以这一篇就说说ViewController与xib的使用呗. ...
- iOS:从头捋一遍VC的生命周期
一.介绍 UIViewController是iOS开发中的核心控件,没有它那基本上任何功能都无法实现,虽然系统已经做了所有控件的生命维护,但是,了解它的生命周期是如何管理还是非常有必要的.网上有很多教 ...
- IOS成长之路-用NSXMLParser实现XML解析
再次对xml进行解析,又有了些理解,如果有不对的地方,请给小弟指出,谢谢! <?xml version="1.0" encoding="UTF-8"?&g ...
随机推荐
- c语言字符串函数大全(转)
函数名: stpcpy 功 能: 拷贝一个字符串到另一个 用 法: char *stpcpy(char *destin, char *source); 程序例: #include <stdio. ...
- 【redis】3.Spring 集成注解 redis 项目配置使用
spring-data-redis 项目,配合 spring 特性并集成 Jedis 的一些命令和方法. 配置redis继承到spring管理项目,使用注解实现redis缓存功能. 参考:http: ...
- [转] offsetParent 到底是哪一个?
正文 不同情况 没有已定位的父节点,且自身position:relative的DIV元素的offsetParent为BODY 没有已定位的父节点,且自身position: absolute的DIV元素 ...
- [转]Javascript原型继承
真正意义上来说Javascript并不是一门面向对象的语言,没有提供传统的继承方式,但是它提供了一种原型继承的方式,利用自身提供的原型属性来实现继承.Javascript原型继承是一个被说烂掉了的话题 ...
- python程序后台运行的实现
后台运行work()方法. work.py # -*- coding:utf-8 -*- def work(): print "running" import time time. ...
- 003.NFS配置实例
一 NFS常见服务管理 1.1 启动NFS [root@imxhy ~]# systemctl start nfs #CentOS7.x系列启动 [root@imxhy ~]# service nfs ...
- 统计Mongo数组中相同对象的属性之和
统计Mongo数组中相同对象的属性之和 需求 需要统计app端用户的行为,按天分表,存入mongo.每次用户进行操作的时候,将数据存入app本地,下次用户启动的时候,提交存入mongo,删除app本地 ...
- 如何将你的github仓库部署到github pages
很多时候我都在思考一个问题,我们每天遇到各种各样的问题,然后我们需要不断google.百度,达到我们解决问题的目的.但是在这个过程中,我们总是能够见到,对于同一个问题,总是有大量错误.copy的博客. ...
- Java中实现多线程的两种方式之间的区别
Java提供了线程类Thread来创建多线程的程序.其实,创建线程与创建普通的类的对象的操作是一样的,而线程就是Thread类或其子类的实例对象.每个Thread对象描述了一个单独的线程.要产生一个线 ...
- 【WIN10】WIN2D——圖像處理
源碼下載:http://yunpan.cn/c3iNuHFFAcr8h 访问密码 8e48 還是先來看下截圖: 實現了幾個效果:放大.縮小.旋轉.左右翻轉.上下翻轉,亮度變化.灰度圖.對比度.高斯模 ...