मैंने तालिका दृश्यों को पॉप्युलेट करने के तरीके पर कुछ ट्यूटोरियल खोजने का प्रयास किया है, लेकिन जो कुछ मैंने पाया है वह पुराना और पुराना वीडियो है। मैंने इसे थोड़ा और हालिया से करने की कोशिश की, और यह काम नहीं करता है। मैंआईओएस में पॉप्युलेटिंग टेबलव्यू सेल 6
- (void)viewDidLoad
{
[super viewDidLoad];
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
[chemarray addObject:@"2"];
[chemarray addObject:@"test"];
[chemarray addObject:@"3"];
[chemarray addObject:@"science"];
}
और
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [chemarray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
cell.textLabel.text = [chemarray objectAtIndex:indexPath.row];
return cell;
}
इस ट्यूटोरियल के अनुसार, जब चलाने के लिए, यह मेरे सरणी में आइटम प्रदर्शित करना चाहिए, लेकिन मेरे लिए, यह नहीं है! क्या कोई जानता है कि इसे कैसे ठीक करें?
क्या आपने अपना व्यू कंट्रोलर टेबल व्यू के प्रतिनिधि के रूप में सेट किया था? क्या यह सेल बनाता है या नहीं? –
यह सेल – Alexyuiop