#import "TableViewController.h"
#import "InsertViewController.h"
#import "DataHandel.h"
#import "book.h"
#import "MJRefresh.h"
@interface TableViewController ()
{
NSMutableArray *tableArr;
}
@implementation TableViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"图书列表";
//导航栏右按钮 t t d s s s d s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s d d d
UIBarButtonItem *right = [[UIBarButtonItem alloc]initWithTitle:@"+" style:UIBarButtonItemStylePlain target:self action:@selector(addBook)];
self.navigationItem.rightBarButtonItem = right;
[self setUpRefresh];
}
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
tableArr = [[DataHandel sharedFMDB]selectAll];
NSLog(@"%@",tableArr);
[self.tableView reloadData];
}
-(void)setUpRefresh
{
[self.tableView addHeaderWithTarget:self action:@selector(headerRefreshBook) dateKey:@"table"];
self.tableView.headerPullToRefreshText = @"下拉刷新";
}
-(void)headerRefreshBook
{
book *b = [[book alloc]init];
b.name = @"张超的操蛋人生";
b.author = @"熊哥";
b.price = @"100";
[[DataHandel sharedFMDB]insertBook:b];
[tableArr insertObject:b atIndex:0];
[self.tableView reloadData];
[self.tableView headerEndRefreshing];
}
-(void)addBook
{
InsertViewController *insert = [[InsertViewController alloc]init];
[self.navigationController pushViewController:insert animated:YES];
}
#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return tableArr.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *str = @"sd";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:str];
if (!cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:str];
}
book *b = [tableArr objectAtIndex:indexPath.row];
cell.textLabel.text = b.name;
cell.detailTextLabel.text = [NSString stringWithFormat:@"作者:%@ 价格:%@",b.author,b.price];
return cell;
}
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
book *b = [tableArr objectAtIndex:indexPath.row];
[[DataHandel sharedFMDB]deleteBook:b];
[tableArr removeObjectAtIndex:indexPath.row];
[self.tableView reloadData];
}
@end
#import <UIKit/UIKit.h>
@interface InsertViewController : UIViewController
@property (strong, nonatomic) IBOutlet UITextField *name;
@property (strong, nonatomic) IBOutlet UITextField *author;
@property (strong, nonatomic) IBOutlet UITextField *price;
- (IBAction)save:(id)sender;
@end
#import "AppDelegate.h"
#import "TableViewController.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
TableViewController *tab = [[TableViewController alloc] initWithStyle:UITableViewStylePlain];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:tab];
self.window.rootViewController = nav;
return YES;
}
#import "AppDelegate.h"
#import "TableViewController.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
TableViewController *tab = [[TableViewController alloc] initWithStyle:UITableViewStylePlain];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:tab];
self.window.rootViewController = nav;
return YES;
}
#import "AppDelegate.h"
#import "TableViewController.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
TableViewController *tab = [[TableViewController alloc] initWithStyle:UITableViewStylePlain];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:tab];
self.window.rootViewController = nav;
return YES;
}
#import "AppDelegate.h"
#import "TableViewController.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
TableViewController *tab = [[TableViewController alloc] initWithStyle:UITableViewStylePlain];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:tab];
self.window.rootViewController = nav;
return YES;
}
#import "AppDelegate.h"
#import "TableViewController.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
TableViewController *tab = [[TableViewController alloc] initWithStyle:UITableViewStylePlain];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:tab];
self.window.rootViewController = nav;
return YES;
}
#import "InsertViewController.h"
#import "DataHandel.h"
#import "book.h"
@interface InsertViewController ()
@end
@implementation InsertViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
/**
* 添加方法
*
*/
- (IBAction)save:(id)sender
{
book *b = [[book alloc] init];
b.name = self.name.text;
b.author = self.author.text;
b.price = self.author.text;
[[DataHandel sharedFMDB]insertBook:b];
[self.navigationController popToRootViewControllerAnimated:YES];
[[[UIAlertView alloc]initWithTitle:@"添加成功" message:nil delegate:nil cancelButtonTitle:@"确定" otherButtonTitles: nil]show];
}
@end
#import <Foundation/Foundation.h>
#import "FMDatabase.h"
#import "book.h"
@interface DataHandel : NSObject
+(instancetype)sharedFMDB;
-(void)insertBook:(book *)bo;
-(void)deleteBook:(book *)bo;
-(NSMutableArray *)selectAll;
@end
#import "DataHandel.h"
static DataHandel *data = nil;
static FMDatabase *fmdb = nil;
@implementation DataHandel
/**
* 单例
*/
+(instancetype)sharedFMDB
{
if (data == nil) {
data = [[DataHandel alloc] init];
[data initFMDB];
}
return data;
}
+(instancetype)allocWithZone:(struct _NSZone *)zone
{
if (!data) {
data = [super allocWithZone:zone];
}
return data;
}
-(id)mutableCopy
{
return self;
}
-(id)copy
{
return self;
}
//创建数据库
-(void)initFMDB
{
NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)lastObject];
//*********************************** 换成自己名字**************************//
NSString *path = [docPath stringByAppendingPathComponent:@"zhouwenhuan.sqlite"];
NSLog(@"%@",path);
fmdb = [FMDatabase databaseWithPath:path];
if ([fmdb open]) {
[fmdb executeUpdate:@"CREATE TABLE book(idd INTEGER PRIMARY KEY AUTOINCREMENT , name TEXT, author TEXT, price TEXT)"];
[fmdb close];
}
else
NSLog(@"创建数据表失败");
}
/**
* 查
*
* @return 所查出来的数组返回
*/
-(NSMutableArray *)selectAll
{
NSMutableArray *arr = [NSMutableArray array];
[fmdb open];
FMResultSet *fmSet = [[FMResultSet alloc]init];
fmSet = [fmdb executeQuery:@"SELECT * FROM book"];
while ([fmSet next]) {
int idd = [fmSet intForColumn:@"idd"];
NSString *name = [fmSet stringForColumn:@"name"];
NSString *author = [fmSet stringForColumn:@"author"];
NSString *price = [fmSet stringForColumn:@"price"];
book *b = [[book alloc]init];
b.idd = idd;
b.name = name;
b.author = author;
b.price = price;
NSLog(@"id = %d",idd);
[arr addObject:b];
}
[fmdb close];
return arr;
}
/**
* 增
*
* @param book Model类
*/
-(void)insertBook:(book *)bo
{
BOOL flag = false;
NSArray *arrBook = [self selectAll];
for (book *b in arrBook) {
if ([b.name isEqualToString:bo.name ] && [b.author isEqualToString:bo.author] && [b.price isEqualToString:bo.price]) {
flag = true;
}
}
if (flag) {
NSLog(@"数据相同");
}
else
{
[fmdb open];
BOOL addFlag = [fmdb executeUpdate:@"INSERT INTO book VALUES(null,?,?,?)",bo.name,bo.author,bo.price ];
if (addFlag) {
NSLog(@"添加成功");
}
else
{
NSLog(@"添加失败");
}
[fmdb close];
}
}
/**
* 删
*
* @param book Model类
*/
-(void)deleteBook:(book *)bo
{
[fmdb open];
NSString *sql = [NSString stringWithFormat:@"DELETE FROM book WHERE idd = %d",bo.idd];
BOOL deleteFlag = [fmdb executeUpdate:sql];
if (deleteFlag) {
NSLog(@"删除成功");
}
else
NSLog(@"删除失败");
[fmdb close];
}
@end
#import <Foundation/Foundation.h>
@interface book : NSObject
@property (nonatomic,strong) NSString *name;
@property (nonatomic,strong) NSString *author;
@property (nonatomic,strong) NSString *price;
@property (nonatomic,assign) int idd;
@end
#import "AppDelegate.h"
#import "TableViewController.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
TableViewController *tab = [[TableViewController alloc] initWithStyle:UITableViewStylePlain];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:tab];
self.window.rootViewController = nav;
return YES;
}
AppDelegate.h
AppDelegate.m
XiaoXiViewController.h
XiaoXiViewController.m
HaoYouViewController.h
HaoYouViewController.m
DongTaiViewController.h
DongTaiViewController.m
TiaoViewController.h
TiaoViewController.m
TiaoViewController.xib
AppDelegate.h
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;
@end
AppDelegate.m
#import "AppDelegate.h"
#import "XiaoXiViewController.h"
#import "HaoYouViewController.h"
#import "DongTaiViewController.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];
XiaoXiViewController *xiao = [[XiaoXiViewController alloc]init];
UINavigationController *Nav = [[UINavigationController alloc]initWithRootViewController:xiao];
UITabBarItem *item = [[UITabBarItem alloc]initWithTitle:@"消息" image:[UIImage imageNamed:@"tab_recent_press@2x"] selectedImage:[UIImage imageNamed:@"tab_recent_press@2x"]];
Nav.tabBarItem = item;
HaoYouViewController *hao = [[HaoYouViewController alloc]init];
UINavigationController *Nav1 = [[UINavigationController alloc]initWithRootViewController:hao];
UITabBarItem *item1 = [[UITabBarItem alloc]initWithTitle:@"好友" image:[UIImage imageNamed:@"tab_buddy_press@2x"] selectedImage:[UIImage imageNamed:@"tab_buddy_press@2x"]];
Nav1.tabBarItem = item1;
DongTaiViewController *dong = [[DongTaiViewController alloc]init];
UINavigationController *Nav2 = [[UINavigationController alloc]initWithRootViewController:dong];
UITabBarItem *item2 = [[UITabBarItem alloc]initWithTitle:@"动态" image:[UIImage imageNamed:@"tab_qworld_press@2x"] selectedImage:[UIImage imageNamed:@"tab_qworld_press@2x"]];
Nav2.tabBarItem = item2;
UITabBarController *tab = [[UITabBarController alloc]init];
tab.viewControllers = @[Nav,Nav1,Nav2];
self.window.rootViewController = tab;
[self.window makeKeyAndVisible];
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:.
// Saves changes in the application's managed object context before the application terminates.
[self saveContext];
}
#pragma mark - Core Data stack
@synthesize managedObjectContext = _managedObjectContext;
@synthesize managedObjectModel = _managedObjectModel;
@synthesize persistentStoreCoordinator = _persistentStoreCoordinator;
- (NSURL *)applicationDocumentsDirectory {
// The directory the application uses to store the Core Data store file. This code uses a directory named "---.QQ" in the application's documents directory.
return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}
- (NSManagedObjectModel *)managedObjectModel {
// The managed object model for the application. It is a fatal error for the application not to be able to find and load its model.
if (_managedObjectModel != nil) {
return _managedObjectModel;
}
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"QQ" withExtension:@"momd"];
_managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
return _managedObjectModel;
}
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
// The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it.
if (_persistentStoreCoordinator != nil) {
return _persistentStoreCoordinator;
}
// Create the coordinator and store
_persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"QQ.sqlite"];
NSError *error = nil;
NSString *failureReason = @"There was an error creating or loading the application's saved data.";
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) {
// Report any error we got.
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
dict[NSLocalizedDescriptionKey] = @"Failed to initialize the application's saved data";
dict[NSLocalizedFailureReasonErrorKey] = failureReason;
dict[NSUnderlyingErrorKey] = error;
error = [NSError errorWithDomain:@"YOUR_ERROR_DOMAIN" code:9999 userInfo:dict];
// Replace this with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
return _persistentStoreCoordinator;
}
- (NSManagedObjectContext *)managedObjectContext {
// Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.)
if (_managedObjectContext != nil) {
return _managedObjectContext;
}
NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
if (!coordinator) {
return nil;
}
_managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
[_managedObjectContext setPersistentStoreCoordinator:coordinator];
return _managedObjectContext;
}
#pragma mark - Core Data Saving support
- (void)saveContext {
NSManagedObjectContext *managedObjectContext = self.managedObjectContext;
if (managedObjectContext != nil) {
NSError *error = nil;
if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) {
// Replace this implementation with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
}
}
@end
XiaoXiViewController.h
#import <UIKit/UIKit.h>
@interface XiaoXiViewController : UIViewController
@end
XiaoXiViewController.m
#import "XiaoXiViewController.h"
#import "TiaoViewController.h"
@interface XiaoXiViewController ()<UITableViewDataSource,UITableViewDelegate,UISearchBarDelegate,UISearchResultsUpdating,UISearchBarDelegate>
{
UITableView *_table;
NSArray *imgArr;
NSArray *perArr;
NSArray *arr;
NSArray *subArr;
UISearchBar *search;
UISearchDisplayController *_display;
}
@end
@implementation XiaoXiViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"消息";
self.view.backgroundColor = [UIColor whiteColor];
arr = @[@"信息",@"对话"];
UISegmentedControl *segCtrl = [[UISegmentedControl alloc]initWithItems:arr];
segCtrl.layer.cornerRadius=6;
segCtrl.layer.masksToBounds=YES;
[segCtrl addTarget:self action:@selector(clickSeg:) forControlEvents:UIControlEventValueChanged];
segCtrl.selectedSegmentIndex=0;
self.navigationItem.titleView=segCtrl;
UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
[btn1 setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
btn1.frame=CGRectMake(10, 10, 40, 40);
btn1.layer.cornerRadius=20;
btn1.layer.masksToBounds=YES;
UIBarButtonItem *l=[[UIBarButtonItem alloc]initWithCustomView:btn1];
self.navigationItem.leftBarButtonItem=l;
UIBarButtonItem *r=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(click1)];
// 添加右侧按钮
self.navigationItem.rightBarButtonItem=r;
// 设置表格
_table=[[UITableView alloc]initWithFrame:CGRectMake(0,0,[UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) style:UITableViewStylePlain];
_table.delegate=self;
_table.dataSource=self;
_table.rowHeight=60;
perArr=@[@"小阿布",@"大白",@"陌陌",@"皮卡丘",@"丘比特",@"张百万",@"张有才",@"科比"];
imgArr=@[@"1.jpg",@"1.jpg",@"1.jpg",@"1.jpg",@"1.jpg",@"1.jpg",@"1.jpg",@"1.jpg"];
subArr=@[@"大好时光",@"晴空万里",@"大好时光",@"晴空万里",@"大好时光",@"晴空万里",@"大好时光",@"晴空万里"];
[self.view addSubview:_table];
//搜索条
search=[[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 40)];
// 设置提示文字
search.placeholder=@"搜索";
// 设置 搜索框颜色
search.barTintColor=[UIColor colorWithRed:32.0/255 green:178.0/255 blue:170.0/255 alpha:0.25];
// 设置代理
search.delegate=self;
// 初始化搜索控制器
_display=[[UISearchDisplayController alloc]initWithSearchBar:search contentsController:self];
// 设置代理
_display.searchResultsDelegate=self;
_display.searchResultsDataSource=self;
// 给表格添加搜索
_table.tableHeaderView=search;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 8;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// 有复用池时
static NSString *cellId=@"cellId";
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
// UITableViewCellStyleSubtitle
cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellId];
}
// 设置主标题
cell.textLabel.text=perArr[indexPath.row];
cell.textLabel.font=[UIFont systemFontOfSize:16];
cell.textLabel.textColor=[UIColor redColor];
// 设置副标题
cell.detailTextLabel.text=subArr[indexPath.row];
cell.detailTextLabel.font=[UIFont systemFontOfSize:12];
cell.detailTextLabel.textColor=[UIColor grayColor];
// 设置图片
cell.imageView.image=[UIImage imageNamed:[imgArr objectAtIndex:indexPath.row]];
// imageView的圆角
cell.imageView.layer.cornerRadius=30;
cell.imageView.layer.masksToBounds=YES;
// 时间按钮
UIButton *btntime=[UIButton buttonWithType:UIButtonTypeRoundedRect];
[btntime setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
btntime.frame=CGRectMake(200, 10, 100, 20);
[btntime setTitle:@"05:20" forState:UIControlStateNormal];
btntime.alpha=0.6;
cell.accessoryView=btntime;
return cell;
}
-(void)click1
{
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"提示" message:@"添加好友" delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil];
alert.alertViewStyle=UIAlertViewStylePlainTextInput;
[alert show];
}
//设置分段控件的方法
-(void)clickSeg:(UISegmentedControl *)ss
{
if (ss.selectedSegmentIndex==1) {
// 隐藏 桌面
_table.hidden=YES;
TiaoViewController *tiao = [[TiaoViewController alloc]init];
[self.navigationController pushViewController:tiao animated:YES];
}else
{
_table.hidden=NO;
}
}
//点击单元格时触发的方法
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row==0) {
// 跳转到下个界面
TiaoViewController *jump=[[TiaoViewController alloc]init];
[self.navigationController pushViewController:jump animated: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
HaoYouViewController.m
#import "HaoYouViewController.h"
@interface HaoYouViewController ()
@end
@implementation HaoYouViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"好友";
self.view.backgroundColor = [UIColor blueColor];
}
- (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
DongTaiViewController.m
#import "DongTaiViewController.h"
@interface DongTaiViewController ()
@end
@implementation DongTaiViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"动态";
self.view.backgroundColor = [UIColor yellowColor];
}
- (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