基本靜態TableView的實作方法
1. 根據上一篇將MyTableViewController.m中以下所標記的程式碼,全部移除或Mark起來
/*
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
// Return the number of rows in the section.
//return 0;
return [myData count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = (NSString *)[myData objectAtIndex:indexPath.row];
return cell;
}
*/
2.
將Storyboard下的TableView設成Static Cell
3. 增加圖片檔到Project上,讓Table上可以出現圖案。
4. 設定Storyboard中的TableViewCell,根據紅框的部分設定就會有圖上的效果,其它項目也可自行設定。
5. 基本設定完成,Run一下來看結果
TableViewCell的構造
2012年8月25日 星期六
UITableView基本使用(一)
一個自己實驗的範例包含靜態與動態形式
Xcode版本4.4.1
動態基本實作如下
1.開一個Project, 使用Single View Application,然後取名稱如下
2. 完成後的檔案列表,注意到MyTableViewController的Class是繼承自UIViewController
3. 我們產生一個新的UITableViewController Class檔來取代MyTableViewController.h/m,最後要選擇 Replace來取代原始檔案

5. 在完成TableViewController的取代之後,要將它設成Root,如圖
6. 並且要將Class設成與MyTableViewController.m同一個
7. 完成以上基本設定後,只要在MyTableViewController.m下加入以下的程式碼,就會得到動態的TableView的效果了。(注意藍色部分)
@interface MyTableViewController ()
@end
NSArray *myData;
@implementation MyTableViewController
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
myData = [[NSArray alloc] initWithObjects:@"First",@"Second",@"Third",@"Fourth",@"Fifth", nil];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
// Return the number of rows in the section.
//return 0;
return [myData count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = (NSString *)[myData objectAtIndex:indexPath.row];
return cell;
}
8.這是額外加的效果,當你按了某個Item,就會出現相關的訊息。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSUInteger row = [indexPath row];
NSString *rowValue = [myData objectAtIndex:row]; //用 NSString 去記錄使用者點選的 row
NSString *message = [[NSString alloc] initWithFormat:@"你選擇了 %@",rowValue];
//用一個 alert 去告訴使用者現在正在點選的 Row
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"展示結果" message:message delegate:nil cancelButtonTitle:@"結束" otherButtonTitles:nil];
[alert show];
//[message release];
//[alert release];
//讓選取的效果消失
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
Xcode版本4.4.1
動態基本實作如下
1.開一個Project, 使用Single View Application,然後取名稱如下
2. 完成後的檔案列表,注意到MyTableViewController的Class是繼承自UIViewController
3. 我們產生一個新的UITableViewController Class檔來取代MyTableViewController.h/m,最後要選擇 Replace來取代原始檔案

4. 取代完成後,需要將Storyboard內的ViewController也換成TableViewController,如圖新增一個 TableViewController,然後將左邊原始的ViewController刪除。

6. 並且要將Class設成與MyTableViewController.m同一個
7. 完成以上基本設定後,只要在MyTableViewController.m下加入以下的程式碼,就會得到動態的TableView的效果了。(注意藍色部分)
@interface MyTableViewController ()
@end
NSArray *myData;
@implementation MyTableViewController
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
myData = [[NSArray alloc] initWithObjects:@"First",@"Second",@"Third",@"Fourth",@"Fifth", nil];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
// Return the number of rows in the section.
//return 0;
return [myData count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = (NSString *)[myData objectAtIndex:indexPath.row];
return cell;
}
8.這是額外加的效果,當你按了某個Item,就會出現相關的訊息。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSUInteger row = [indexPath row];
NSString *rowValue = [myData objectAtIndex:row]; //用 NSString 去記錄使用者點選的 row
NSString *message = [[NSString alloc] initWithFormat:@"你選擇了 %@",rowValue];
//用一個 alert 去告訴使用者現在正在點選的 Row
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"展示結果" message:message delegate:nil cancelButtonTitle:@"結束" otherButtonTitles:nil];
[alert show];
//[message release];
//[alert release];
//讓選取的效果消失
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
2012年8月23日 星期四
使用 Storyboard Segue 實作頁面切換(四)
現在要回傳Page2的資料到Page1
1. 首先在SecondPageViewController.h上加入紅色部分的程式碼,我們希望將Page2的資料通過一個Function來傳送。因此採用delegate的機制,將Function建制在Page1上,而傳送的資料變數在page2上。
@protocol Page2Delegate
-(void) passValue:(NSString *)value;
@end
@interface SecondPageViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *Page2TextField;
@property (strong) NSString *dataString;
@property (weak) id<Page2Delegate> delegate;
2. 加入以下程式碼(紅色部分)到SecondPageViewController.m
@implementation SecondPageViewController
@synthesize delegate;
@synthesize Page2TextField;
- (IBAction)backToPage1:(id)sender {
[self dismissViewControllerAnimated:YES completion:^{}];
[delegate passValue:Page2TextField.text];
}
3. 針對TextField,如果有需要處理一下,就比照Page1的做法加入程式碼
- (IBAction)returnEnterPress2:(id)sender {
[Page2TextField resignFirstResponder];
}
4. Page1上的FirstPageViewController.h需要稍加修改,來接受資料
#import "SecondPageViewController.h"
@interface FirstPageViewController : UIViewController <Page2Delegate>
5. 當然FirstPageViewController.m也需要修改
- (void) passValue:(NSString *)value
{
Page1TextField.text = value;
}
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
id secondCon = segue.destinationViewController;
[secondCon setValue:Page1TextField.text forKey:@"dataString"];
[secondCon setValue:self forKey:@"delegate"];
}
6. 完成後的結果如下
到Page2後,修改TextField的內文,就會再傳回到Page1
Page1接收後,顯示結果
1. 首先在SecondPageViewController.h上加入紅色部分的程式碼,我們希望將Page2的資料通過一個Function來傳送。因此採用delegate的機制,將Function建制在Page1上,而傳送的資料變數在page2上。
@protocol Page2Delegate
-(void) passValue:(NSString *)value;
@end
@interface SecondPageViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *Page2TextField;
@property (strong) NSString *dataString;
@property (weak) id<Page2Delegate> delegate;
2. 加入以下程式碼(紅色部分)到SecondPageViewController.m
@implementation SecondPageViewController
@synthesize delegate;
@synthesize Page2TextField;
- (IBAction)backToPage1:(id)sender {
[self dismissViewControllerAnimated:YES completion:^{}];
[delegate passValue:Page2TextField.text];
}
3. 針對TextField,如果有需要處理一下,就比照Page1的做法加入程式碼
- (IBAction)returnEnterPress2:(id)sender {
[Page2TextField resignFirstResponder];
}
4. Page1上的FirstPageViewController.h需要稍加修改,來接受資料
#import "SecondPageViewController.h"
@interface FirstPageViewController : UIViewController <Page2Delegate>
5. 當然FirstPageViewController.m也需要修改
- (void) passValue:(NSString *)value
{
Page1TextField.text = value;
}
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
id secondCon = segue.destinationViewController;
[secondCon setValue:Page1TextField.text forKey:@"dataString"];
[secondCon setValue:self forKey:@"delegate"];
}
6. 完成後的結果如下
到Page2後,修改TextField的內文,就會再傳回到Page1
Page1接收後,顯示結果
使用 Storyboard Segue 實作頁面切換(三)
切換時如何從Page1轉移資料到Page2
1. 承接前篇的實作,然後在兩個Page上都加入TextField,並且調整頁面如圖
2. 設定Page1的Class為FirstPageViewController
3. 將Page1上的TextField拉到FirstPageViewController.h上去註冊,名稱設為Page1TextField
4. 拖拉TextField到FirstPageViewController.m上,以形成一個Action,取名為returnKeyEnter,並加入程式碼,用來縮小鍵盤之用。
5. 在FirstPageViewController加入以下程式碼,用來將Page1上TextField的文字傳送到Page2上的TextField
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
id secondCon = segue.destinationViewController;
[secondCon setValue:Page1TextField.text forKey:@"dataString"];
}
6. 現在開始來做Page2的接收端,將下面程式碼加到SecondPageViewController.h
@property (strong) NSString *dataString;
7. 修改SecondPageViewController.m中的ViewDidLoad,加入紅色的程式碼。
- (void)viewDidLoad
{
[super viewDidLoad];
Page2TextField.text = self.dataString;
// Do any additional setup after loading the view.
}
8. 到此已經基本完成了,Run一下結果如下圖
將TextField輸入一些文字,如圖例的 Send Data to Page2
Page2所得到的畫面如下
1. 承接前篇的實作,然後在兩個Page上都加入TextField,並且調整頁面如圖
2. 設定Page1的Class為FirstPageViewController
3. 將Page1上的TextField拉到FirstPageViewController.h上去註冊,名稱設為Page1TextField
4. 拖拉TextField到FirstPageViewController.m上,以形成一個Action,取名為returnKeyEnter,並加入程式碼,用來縮小鍵盤之用。
5. 在FirstPageViewController加入以下程式碼,用來將Page1上TextField的文字傳送到Page2上的TextField
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
id secondCon = segue.destinationViewController;
[secondCon setValue:Page1TextField.text forKey:@"dataString"];
}
6. 現在開始來做Page2的接收端,將下面程式碼加到SecondPageViewController.h
@property (strong) NSString *dataString;
7. 修改SecondPageViewController.m中的ViewDidLoad,加入紅色的程式碼。
- (void)viewDidLoad
{
[super viewDidLoad];
Page2TextField.text = self.dataString;
// Do any additional setup after loading the view.
}
8. 到此已經基本完成了,Run一下結果如下圖
將TextField輸入一些文字,如圖例的 Send Data to Page2
Page2所得到的畫面如下
使用TextField實作文字輸入(二)
前篇的鍵盤縮回方式是使用Return鍵,但我們通常習慣使用點到空白處就會縮回,以下是實作方法
1. 先將Page View的UIView改成UIControl,如圖,將滑鼠點在空白的Page View上,就可看到右邊的上邊有一個UIView,將它改成UIControl,這樣Page View才會對滑鼠有反應。
2. 使用滑鼠從Page View的空白處拖拉一個Action到右邊,
3. 對Action加入程式碼,控制將鍵盤縮回。
- (IBAction)onBackgroundHit:(id)sender {
[MyTextField resignFirstResponder]; //因為是針對TextFiled
}
4. 完成了,再Run一次,這次可以點空白處來縮回鍵盤了。
1. 先將Page View的UIView改成UIControl,如圖,將滑鼠點在空白的Page View上,就可看到右邊的上邊有一個UIView,將它改成UIControl,這樣Page View才會對滑鼠有反應。
2. 使用滑鼠從Page View的空白處拖拉一個Action到右邊,
3. 對Action加入程式碼,控制將鍵盤縮回。
- (IBAction)onBackgroundHit:(id)sender {
[MyTextField resignFirstResponder]; //因為是針對TextFiled
}
4. 完成了,再Run一次,這次可以點空白處來縮回鍵盤了。
使用TextField實作文字輸入(一)
一個自己實驗的範例
使用TextFiled輸入文字,然後經由Button,將文字傳送到Label上顯示
Xcode版本4.4.1
1. 開啟一個新Project,命名為TextFiledTest,Template使用Single View Application,產生的檔案列表如圖
2. 將Button, Label, TextField排列到Page 上
3. 將Button, Label, TextField分別註冊到TextFieldTestViewController.h上(使用Control鍵及滑鼠左鍵拖拉[左到右])
4. 將TextFieldTestViewController.m上面加上一個Button的Action(使用拖拉方式)
5. 另外再加上一個TextField的Action(同樣使用拖拉方式)
6. 然後在這兩個Action內加入控制程式碼如下
- (IBAction)saveDataToLabel:(id)sender {
MyLabel.text = MyTextField.text;//將TextField的文字轉移到Label
}
- (IBAction)returnTextField:(id)sender {
[sender resignFirstResponder]; // 當輸入文字到TextField時,在鍵入return鍵後,鍵盤會縮回去
}
7. 完成了,試Run一下吧
使用TextFiled輸入文字,然後經由Button,將文字傳送到Label上顯示
Xcode版本4.4.1
1. 開啟一個新Project,命名為TextFiledTest,Template使用Single View Application,產生的檔案列表如圖
2. 將Button, Label, TextField排列到Page 上
3. 將Button, Label, TextField分別註冊到TextFieldTestViewController.h上(使用Control鍵及滑鼠左鍵拖拉[左到右])
4. 將TextFieldTestViewController.m上面加上一個Button的Action(使用拖拉方式)
5. 另外再加上一個TextField的Action(同樣使用拖拉方式)
6. 然後在這兩個Action內加入控制程式碼如下
- (IBAction)saveDataToLabel:(id)sender {
MyLabel.text = MyTextField.text;//將TextField的文字轉移到Label
}
- (IBAction)returnTextField:(id)sender {
[sender resignFirstResponder]; // 當輸入文字到TextField時,在鍵入return鍵後,鍵盤會縮回去
}
7. 完成了,試Run一下吧
2012年8月22日 星期三
使用 Storyboard Segue 實作頁面切換(二)
上一篇所用的方式每一次的切換都會產生新的UIViewController,並不是真正的回到Page1。現在來實做真正回去Page1的方法,也就是暫時Disable SecondPageViewController來做到回去Page1的方式。
1. 先加一個新的Class檔案
2.將檔名取為SecondPageViewController
3. 產生後的檔案列表
4. 將storyboard上Page2的Class Name改成SecondPageViewController,這樣程式檔就與Page2聯結起來。
5. 將Page2上的Button拖拉到程式碼上面來完成一個聯結,並取名為backToPage1
6. 完成後如圖
7. 加入disable Page2的程式碼
- (IBAction)backToPage1:(id)sender {
[self dismissViewControllerAnimated:YES completion:^{}];
}
8.這樣就大功告成 ,試著Run,就會得到如同前篇的效果,但其內涵卻是不同。
1. 先加一個新的Class檔案
2.將檔名取為SecondPageViewController
3. 產生後的檔案列表
4. 將storyboard上Page2的Class Name改成SecondPageViewController,這樣程式檔就與Page2聯結起來。
5. 將Page2上的Button拖拉到程式碼上面來完成一個聯結,並取名為backToPage1
6. 完成後如圖
7. 加入disable Page2的程式碼
- (IBAction)backToPage1:(id)sender {
[self dismissViewControllerAnimated:YES completion:^{}];
}
8.這樣就大功告成 ,試著Run,就會得到如同前篇的效果,但其內涵卻是不同。
使用 Storyboard Segue 實作頁面切換(一)
一個自己實驗的範例包含靜態與動態形式
Xcode版本4.4.1
先實作最基本的Segue方式
1. 開一個新專案
2. 將專案名稱設為TwoPageTest,將第一個Class設為FirstPage
3. 完成後的基本檔名
4. 將Storyboard新增加一個ViewController
5. 為兩個Page各增加一個Button及一個Label,如圖
6.使用Control鍵及滑鼠左鍵從左邊Page1的Button,拖拉一個Segue到右邊Page的空白處,選擇Model模式
7. 同樣方法將右邊的Button也設定Segue到左邊空白處
8. 完成了最基本的Two Page切換的設計了,使用Run來看看結果吧,按Button的話會在兩個頁面之間切換。
Xcode版本4.4.1
先實作最基本的Segue方式
1. 開一個新專案
2. 將專案名稱設為TwoPageTest,將第一個Class設為FirstPage
4. 將Storyboard新增加一個ViewController
5. 為兩個Page各增加一個Button及一個Label,如圖
6.使用Control鍵及滑鼠左鍵從左邊Page1的Button,拖拉一個Segue到右邊Page的空白處,選擇Model模式
7. 同樣方法將右邊的Button也設定Segue到左邊空白處
8. 完成了最基本的Two Page切換的設計了,使用Run來看看結果吧,按Button的話會在兩個頁面之間切換。
viewDidLoad and viewDidUnload的關係
參考
http://www.cnblogs.com/wwwkhd/archive/2011/03/14/1983192.html
由init、loadView、viewDidLoad、viewDidUnload、dealloc的關係說起
init方法
在init方法中實例化必要的對象(遵從LazyLoad思想)
init方法中初始化ViewController本身
loadView方法
當view需要被展示而它卻是nil時,viewController會調用該方法。 不要直接調用該方法。
如果手工維護views,必須重載重寫該方法
如果使用IB維護views,必須不能重載重寫該方法
loadView和IB構建view
你在控制器中實現了loadView方法,那麼你可能會在應用運行的某個時候被內存管理控制調用。 如果設備內存不足的時候, view 控制器會收到didReceiveMemoryWarning的消息。 默認的實現是檢查當前控制器的view是否在使用。 如果它的view不在當前正在使用的view hierarchy裡面,且你的控制器實現了loadView方法,那麼這個view將被release, loadView方法將被再次調用來創建一個新的view。
viewDidLoad方法
viewDidLoad 此方法只有當view從nib文件初始化的時候才被調用。
重載重寫該方法以進一步定制view
在iPhone OS 3.0及之後的版本中,還應該重載重寫viewDidUnload來釋放對view的任何索引
viewDidLoad後調用數據Model
viewDidUnload方法
當系統內存吃緊的時候會調用該方法(注:viewController沒有被dealloc)
內存吃緊時,在iPhone OS 3.0之前didReceiveMemoryWarning是釋放無用內存的唯一方式,但是OS 3.0及以後viewDidUnload方法是更好的方式
在該方法中將所有IBOutlet(無論是property還是實例變量)置為nil(系統release view時已經將其release掉了)
在
該方法中釋放其他與view有關的對象、其他在運行時創建(但非系統必須)的對象、在viewDidLoad中被創建的對象、緩存數據等release對
像後,將對象置為nil(IBOutlet只需要將其置為nil,系統release view時已經將其release掉了)
一般認為viewDidUnload是viewDidLoad的鏡像,因為當view被重新請求時,viewDidLoad還會重新被執行
viewDidUnload中被release的對象必須是很容易被重新創建的對象(比如在viewDidLoad或其他方法中創建的對象),不要release用戶數據或其他很難被重新創建的對象
dealloc方法
viewDidUnload和dealloc方法沒有關聯,dealloc還是繼續做它該做的事情
參考圖從APPLE文件上截出
原文資料
|
Task
|
Methods
|
Discussion
|
|
Allocating critical
data structures
required by your
view controller
|
Initialization methods
|
Your custom initialization method (whether it is named
init or something else) is always responsible for
putting your view controller object in a known good
state. This includes allocating whatever data structures
are needed to ensure proper operation.
|
|
Creating your view
objects
|
loadView
|
Overriding the loadView method is required only if
you intend to create your views programmatically. If
you are using storyboards, the views are loaded
automatically from the storyboard file.
|
|
Allocating or
loading data to be
displayed in your
view
|
viewDidLoad
|
Typically, data objects are provided by configuring
your view controller’s properties. Any additional data
objects your view controller wants to create should
be done by overriding the viewDidLoad method. By
the time this method is called, your view objects are
guaranteed to exist and to be in a known good state.
|
|
Releasing
references to view
objects
|
viewDidUnload
dealloc
|
If you maintain strong references to any view objects
in your view hierarchy using outlets or other instance
variables in your class, you must always release those
references when the views are no longer needed. You
release a view object by setting your outlet or variable
to nil. For more information about when views get
released, see “Understanding How Views Are Loaded
and Unloaded” (page 57).
|
|
eleasing data
that is not needed
when your view is
not displayed
|
viewWillUnload
viewDidUnload
|
You can use the viewDidUnload method to
deallocate any data that is view specific and that can
be re-created easily enough if the view is loaded into
memory again. If re-creating the data might be too
time-consuming, though, you do not have to release
the corresponding data objects here. Instead, you
should consider releasing those objects in your
didReceiveMemoryWarning method.
|
|
Responding to
low-memory
notifications
|
didReceiveMemory-
Warning
|
Use this method to deallocate all noncritical custom
data structures associated with your view controller.
Although you would not use this method to release
references to view objects, you might use it to release
any view-related data structures that you did not
already release in your viewDidUnload method. ( The
view objects themselves should always be released
in the viewDidUnload method.)
|
|
Releasing critical
data structures
required by your
view controller
|
dealloc
|
Override this method only to perform any last-minute
cleanup of your view controller class. Objects stored
in instance variables and properties are automatically
released; you do not need to release them explicitly.
|
訂閱:
文章 (Atom)












































