2015年12月

2015-12-28-- 今天我降班了,原因是字典和数组传值迷糊了

2015-12-28-- 今天我降班了,原因是字典和数组传值迷糊了
然后来了新的班级,重新开始学习OC,可是,来到这个班级我还是有
一种智商被压制的感觉,上课进程一塌糊涂,然后,我就开始蛋疼了,
弄得好尴尬,而且重新读档一个月,又开始学习类和对象,啊....
有一种要疯了的感觉,感觉和他们不在一个频道,不知道来年的四月
份能不能结束.太慢了!
之前的班级感觉智商是被他们压制的,而在现在的班级智商是被他
们沉默的.啊......唉

2015-12-24-Xib Xib 使用

//
// AppDelegate.h
// UI14_Xib
//
// Created by YIem on 15/12/24.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end


//
// AppDelegate.m
// UI14_Xib
//
// Created by YIem on 15/12/24.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "AppDelegate.h"

import "ViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
    // Override point for customization after application launch.

    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];

    ViewController *movieVC = [[ViewController alloc] init];
    UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:movieVC];
    navi.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:1000];
    UITabBarController *tabBarVC = [[UITabBarController alloc] init];
    tabBarVC.viewControllers = @[navi];
    self.window.rootViewController = tabBarVC;

    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



//
// ViewController.h
// UI14_Xib
//
// Created by YIem on 15/12/24.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface ViewController : UIViewController

@end


//
// ViewController.m
// UI14_Xib
//
// Created by YIem on 15/12/24.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "ViewController.h"

import "MyView.h"

@interface ViewController ()

@end

@implementation ViewController

  • (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = @"Xib";
    
    // Xib 使用
    // 参数1. Xib文件名
    // 参数2. Xib文件拥有者
    // 参数3. nil
    MyView *view = [[[NSBundle mainBundle] loadNibNamed:@"MyView" owner:self options:nil] lastObject];
    view.aLabel.backgroundColor = [UIColor redColor];
    [self.view addSubview:view];
    //

    }

  • (void)didReceiveMemoryWarning {

    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.

    }

@end



//
// MyView.h
// UI14_Xib
//
// Created by YIem on 15/12/24.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface MyView : UIView
// 脱线
@property (weak, nonatomic) IBOutlet UILabel *aLabel;
@property (weak, nonatomic) IBOutlet UITextField *aTextField;
@end


//
// MyView.m
// UI14_Xib
//
// Created by YIem on 15/12/24.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "MyView.h"

@interface MyView ()
@property (weak, nonatomic) IBOutlet UIButton *aButton;

@end

@implementation MyView

  • (IBAction)buttonClick:(UIButton *)sender {

    NSLog(@"滴滴滴" );

    }

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.

  • (void)drawRect:(CGRect)rect {

    // Drawing code

    }

*/

@end



Block传值Block传值Block传值Block传值

//
// AppDelegate.h
// UI13_Block传值
//
// Created by YIem on 15/12/23.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end


//
// AppDelegate.m
// UI13_Block传值
//
// Created by YIem on 15/12/23.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "AppDelegate.h"

import "ViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    ViewController *root = [[ViewController alloc]init];
    UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:root];
    UITabBarController *tab = [[UITabBarController alloc]init];
    root.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:1000];
    tab.viewControllers = @[navi];
    self.window.rootViewController = tab;

    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




































- 阅读剩余部分 -

2015-12-24-TableView 数组

//
// AppDelegate.h
// UI13_练习
//
// Created by YIem on 15/12/23.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (retain, nonatomic) UIWindow *window;

@end


//
// AppDelegate.m
// UI13_练习
//
// Created by YIem on 15/12/23.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "AppDelegate.h"

import "ViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

  • (void)dealloc
    {
    [_window release];
    [super dealloc];
    }
  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    [self.window makeKeyAndVisible];
    ViewController *rooVC = [[ViewController alloc]init];
    UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:rooVC];
    self.window.rootViewController = navi;
    [navi release];
    [rooVC release];

    [_window release];
    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



//
// ViewController.h
// UI13_练习
//
// Created by YIem on 15/12/23.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface ViewController : UIViewController

@end


//
// ViewController.m
// UI13_练习
//
// Created by YIem on 15/12/23.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "ViewController.h"

import "SecondViewController.h"

@interface ViewController ()<UITableViewDataSource, UITableViewDelegate, PassDelegate>
@property (nonatomic, retain) UITableView *tableView;
@property (nonatomic, retain) NSMutableArray *dataArr;
@property (nonatomic, retain) NSIndexPath *index;
@end

@implementation ViewController

  • (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"练习";

    // tableView
    self.tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
    _tableView.dataSource = self;
    _tableView.delegate = self;
    [self.view addSubview:_tableView];
    [_tableView release];

    [self dataHanler];
    }

  • (void)dataHanler
    {
    self.dataArr = [@[@"a", @"b", @"c", @"d", @"e"] mutableCopy];
    }
  • (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
    return _dataArr.count;
    }
  • (UITableViewCell )tableView:(UITableView )tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {

    cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"
            ];

    }
    cell.textLabel.text = _dataArr[indexPath.row];
    return cell;
    }

  • (void)tableView:(UITableView )tableView didSelectRowAtIndexPath:(NSIndexPath )indexPath
    {
    SecondViewController *secVC = [[SecondViewController alloc]init];
    secVC.str = _dataArr[indexPath.row];
    self.index = indexPath;
    secVC.delegate = self;
    [self.navigationController pushViewController:secVC animated:YES];
    }
  • (void)passValue:(NSString *)string
    {
    [self.dataArr addObject:string];
    [self.tableView reloadData];

    }

  • (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
    }

@end



//
// SecondViewController.h
// UI13_练习
//
// Created by YIem on 15/12/23.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@protocol PassDelegate <NSObject>

-(void)passValue:(NSString *)string;

@end
@interface SecondViewController : UIViewController
@property (nonatomic, copy) NSString *str;
@property (nonatomic, assign) id<PassDelegate>delegate;
@end


//
// SecondViewController.m
// UI13_练习
//
// Created by YIem on 15/12/23.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "SecondViewController.h"

@interface SecondViewController ()
@property (nonatomic, retain)UITextField *textField;
@end

@implementation SecondViewController

  • (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.textField = [[UITextField alloc]init];
    _textField.text = self.str;
    _textField.frame = CGRectMake(10, 100, 100, 100);
    _textField.backgroundColor = [UIColor redColor];
    [self.view addSubview:_textField];
    [_textField release];
    
    // button
    UIButton *back = [UIButton buttonWithType:UIButtonTypeSystem];
    back.backgroundColor = [UIColor yellowColor];
    back.frame = CGRectMake(10, 200, 220, 200);
    [back addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:back];
    

    }

  • (void)back
    {

    [self.delegate passValue:_textField.text];
    [self.navigationController popViewControllerAnimated:YES];

    }

  • (void)didReceiveMemoryWarning {

    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.

    }

/*

pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation

  • (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.

    }

*/

@end

2015-12-24-TavleView编辑

//
// AppDelegate.h
// UI12_TavleView编辑
//
// Created by YIem on 15/12/22.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (retain, nonatomic) UIWindow *window;

@end


//
// AppDelegate.m
// UI12_TavleView编辑
//
// Created by YIem on 15/12/22.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "AppDelegate.h"

import "ViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

  • (void)dealloc
    {
    [_window release];
    [super dealloc];
    }
  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    ViewController *rootVC = [[ViewController alloc]init];
    UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:rootVC];
    self.window.rootViewController = navi;

    [rootVC release];
    [navi release];

    [_window release];
    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






































- 阅读剩余部分 -

2015-12-24-UITableVIewController

//
// AppDelegate.h
// UI12_UITableVIewController
//
// Created by YIem on 15/12/22.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end


//
// AppDelegate.m
// UI12_UITableVIewController
//
// Created by YIem on 15/12/22.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "AppDelegate.h"

import "MyTableViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

  • (void)dealloc
    {
    [_window release];
    [super dealloc];
    }
  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];

    MyTableViewController *myVC = [[MyTableViewController alloc]init];
    UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:myVC];
    self.window.rootViewController = navi;
    [navi release];
    [myVC release];

    [_window release];

    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






































- 阅读剩余部分 -

2015-12-24-RegisterCell注册cell重用池

//
// AppDelegate.h
// UI12_RegisterCell
//
// Created by YIem on 15/12/22.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (retain, nonatomic) UIWindow *window;

@end


//
// AppDelegate.m
// UI12_RegisterCell
//
// Created by YIem on 15/12/22.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "AppDelegate.h"

import "ViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

  • (void)dealloc
    {
    [_window release];
    [super dealloc];
    }
  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    [self.window makeKeyAndVisible];
    ViewController *rootVC = [[ViewController alloc]init];
    UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:rootVC];
    self.window.rootViewController = navi;
    [navi release];
    [rootVC release];

    [_window release];
    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








































- 阅读剩余部分 -

2015-12-24-UI12_限时练习

//
// AppDelegate.h
// UI12_限时练习
//
// Created by Marry W. on 15/12/22.
// Copyright © 2015年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (retain, nonatomic) UIWindow *window;

@end







- 阅读剩余部分 -

UITablView综合练习

//
// AppDelegate.h
// UI11_UITablView综合练习
//
// Created by YIem on 15/12/21.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (retain, nonatomic) UIWindow *window;

@end







- 阅读剩余部分 -

2015-12-24-// 目标: 数组+字典 -> 数组 + model对象

//
// AppDelegate.h
// UI11_练习2
//
// Created by YIem on 15/12/21.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (retain, nonatomic) UIWindow *window;

@end


//
// AppDelegate.m
// UI11_练习2
//
// Created by YIem on 15/12/21.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "AppDelegate.h"

import "ViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

  • (void)dealloc
    {
    [_window release];
    [super dealloc];
    }
  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    ViewController *rootVC = [[ViewController alloc] init];
    UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:rootVC];
    self.window.rootViewController = navi;
    [rootVC release];
    [navi release];

    [_window release];
    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








































- 阅读剩余部分 -

iOS导航栏 添加图片 添加背景图片-iOS-UI

iOS导航栏 添加图片
iOS导航栏 添加背景图片

UI导航栏 添加图片

UI导航栏 添加背景图片

[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"bg_nav"] forBarMetrics:0];

TableViewCell自定义Cell

//
// RootViewController.m
// UI10_自定义Cell
//
// Created by Marry W. on 12/18/15.
// Copyright (c) 2015 蓝鸥. All rights reserved.
//

import "RootViewController.h"

warning 1.导入cell头文件

import "MyTableViewCell.h"

import "MyTableViewCell2.h"

@interface RootViewController () <UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, retain) NSArray *arr;
@end

@implementation RootViewController

  • (void)dealloc
    {

    [_arr release];
    [super dealloc];

    }










- 阅读剩余部分 -

UITableView练习

//
// RootViewController.m
// UI10_练习
//
// Created by YIem on 15/12/18.
// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "RootViewController.h"

import "MyTableViewCell.h"

@interface RootViewController ()<UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, retain)NSArray *arr;
@property (nonatomic, retain)UITableView *tableView;
@end

@implementation RootViewController

  • (void)dealloc
    {

    [_arr release];
    [super dealloc];

    }











- 阅读剩余部分 -

UI10_UITableView2

//
// RootViewController.m
// UI10_UITableView2
//
// Created by Marry W. on 12/18/15.
// Copyright (c) 2015 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

import "RootViewController.h"

import "NSString+Characters.h"

@interface RootViewController () <UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, retain) NSMutableArray *arr;// 保存key
@property (nonatomic, retain) NSMutableDictionary *contactDic;// 保存所有联系人
@property (nonatomic, retain) UITableView *tableView;

@end

@implementation RootViewController

  • (void)dealloc
    {

    [_arr release];
    [super dealloc];

    }











- 阅读剩余部分 -