我想每次點擊的人從上表視圖書名釋放標籤文本,它應改變detailViewController標籤(titleLabel),但是它不斷出現同樣的書名。iPhone發佈標籤文本
想知道如果我做錯了 - 我很清楚我有,但不知道如何解決它...
//
// BookDetailViewController.m
#import "BookDetailViewController.h"
#import "Book.h"
@implementation BookDetailViewController
@synthesize aBook, titleLabel;
// Implement viewDidLoad to do additional setup after loading the view.
- (void)viewDidLoad {
[super viewDidLoad];
[self bookDes];
self.title = @"Book Detail";
}
-(void)bookDes {
[self.titleLabel setText:nil];
[self.titleLabel setText:aBook.title];
}
- (void)dealloc {
[aBook release];
[titleLabel release];
[super dealloc];
}
@end
你能後創建該控制器的代碼 - 我認爲你以前設置過ABOOK是你想要的書,你可能會調用裏面viewDidLoad中bookDes? – deanWombourne 2010-02-25 15:21:13
你什麼時候設置你的aBook對象? – 2010-02-25 15:32:23
的代碼是從http://www.iphonesdkarticles.com/2008/11/parsing-xml-files.html 但是我剛剛改變的DetailView,因爲我不想表現出來的TableView中 – RussellHarrower 2010-02-25 15:56:39