我非常新的xcode 3,我真的需要幫助這個初始化NSMutableArray
我開發我的應用程序使用UITableView和XML來顯示內容。
我有3個.xib文件,它是rootViewController,SecondViewController和mainview。
所以問題是: 當我嘗試執行didSelectrow在RootViewController的和SecondViewController訪問的NSMutableArray *陣列和替換RootViewController的新數組值*數組值推前動畫。
第一次更改了我的SecondViewController上的數組值,但是當我按下後退按鈕並選擇另一行時,我的SecondViewController數組保持讀取前一個數組不變爲新的數組。我嘗試初始化,但沒有運氣
這是我在RootViewController的UITableView的(didSelectRow)代碼:
3210這是我的第二個視圖控制器:
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
switch(indexPath.section)
{
case 0:
[cell setText:record.name];
break;
case 1:
[cell setText:record.Age];
break;
case 2:
[cell setText:record.summary];
break;
}
return cell;
}
希望有人能幫助我..
在此先感謝.....
因此,ListRecord是NSMutableArray的子類?我很困惑,因爲你說你正在設置一個數組,但它看起來像你實際上設置屬性的'記錄'這是類型ListRecord * –