0
這裏是我在viewcontroller中使用我的appdelegate中提供的plist信息的代碼。用plist填充表格推送不同的視圖控制器
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [self.tableDataSource count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];
cell.text = [dictionary objectForKey:@"myobject"];
這使用了在appdelegate中使用的plist,並在我的表格中填充了我的plist中有多少個入口。
我想要做的下一件事是爲每個填充了相應「鍵」的單元格推送一個非動態viewcontoller。
所以,myobject單元格(選中時)將推動myobject viewcontroller。 yourobject單元格(選中時)將按下對象視圖控制器。
All the way down.
我該怎麼去做這件事?