नए आईओएस 11 अपडेट के बाद से, मेरे पास एक ऐप है जो सिम्युलेटर और डिवाइस पर खाली टेबलव्यू पंक्तियां दिखाएगा। यहां तक कि पंक्ति विभाजक भी ऐसी पंक्तियों के लिए नहीं दिखाए जाएंगे जो वहां होने वाले हैं। यदि मैं सिम्युलेटर को पुराने आईओएस संस्करण में बदलता हूं, तो पंक्तियां ठीक दिखाई देंगी। कोड या स्टोरीबोर्ड में कोई बदलाव नहीं।एक्सकोड 9 - आईओएस 11 यूआईटीबल व्यू पंक्तियां खाली हैं
पंक्तियों में अभी भी डेटा है, जिसका अर्थ है कि मैं रिक्त पंक्तियों में से एक पर टैप कर सकता हूं और यह कोड निष्पादित करेगा और उस जानकारी को शामिल करेगा जिसमें मैं उम्मीद कर रहा था।
ऐसा प्रतीत होता है कि मेरे पास अन्य दृश्य हैं जहां टेबलव्यू दृश्य पर रखा गया है और मैं निर्मित टेक्स्ट लेबल वर्क जुर्माना का उपयोग नहीं करता हूं। बिल्ट इन टेक्स्ट लेबल का उपयोग करके बस इस टेबलव्यू क्लास।
यहाँ tableview वर्ग के लिए मेरी कोड
@interface BunkPickTableViewController()
@end
@implementation BunkPickTableViewController
@synthesize appDelegate, delegate, bunkPassedValue;
- (void)viewDidLoad {
[super viewDidLoad];
UIView *backgroundView = [[UIView alloc] initWithFrame:self.view.bounds];
appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
CAGradientLayer *bgLayer = [BackgroundLayer tanGradient];
bgLayer.frame = self.view.bounds;
[self.view.layer insertSublayer:bgLayer atIndex:0];
self.tableView.backgroundView = backgroundView;
[self.navigationController.navigationBar setTintColor:[UIColor blackColor]];
self.title = @"Bunk Codes";
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[self navigationController] setNavigationBarHidden:NO animated:NO];
[self.tableView reloadData];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [appDelegate.bunkArray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.textLabel.textAlignment = NSTextAlignmentCenter;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.backgroundColor = [UIColor clearColor];
}
Bunk *bunkObj = [appDelegate.bunkArray objectAtIndex:indexPath.row];
cell.textLabel.text = bunkObj.bunkId;
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryCheckmark;
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
Bunk *bunkObj = [appDelegate.bunkArray objectAtIndex:indexPath.row];
[delegate dismissBunkPop:bunkObj.bunkId];
[self.navigationController popViewControllerAnimated:YES];
}
@end
जब आप कोड के माध्यम से कदम उठाते हैं, तो 'cell.textLabel.text' सही मान प्राप्त करता है? – Koen
यह करता है, और मैंने तोड़ दिया है और जांच की है कि पंक्तियों की सही संख्या सही जानकारी प्राप्त कर रही है। सब अच्छा लग रहा है। – Kryckter
मुझे ऐसी परियोजना पर एक समान समस्या है जो पूरी तरह से ios10 पर काम करती है (सभी कक्ष अब खाली हैं। केवल समूह शीर्षक सामान्य हैं)। मैं इसे देख रहा हूँ – ZDidier