मेरे पास प्रति अनुभाग 4 अनुभाग और 1-2 तालिका दृश्य कक्षों के साथ एक तालिका दृश्य है। पहले सेल में एक एक्सेसरी व्यू के रूप में एक यूज़विच है और ऐप के कलर थीम को नियंत्रित करता है, दिन मोड और रात मोड के बीच स्विचिंग करता है। स्विच स्विच होने के बाद एक समारोह को बुलाया जाता है, नेविगेशन बार और पृष्ठभूमि रंग के रंग बदलते हैं। उस फ़ंक्शन में मैंने लाइन कोतालिका दृश्य खंडों को फिर से लोड करें
[self.tableview reloadData];
को नए रंगों के साथ तालिका को अपडेट करने के लिए भी लाइन डाली है। यह ठीक काम करता है, लेकिन यह करने के लिए कोई एनीमेशन theres, तो मैं बजाय
[self.tableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 3)] withRowAnimation:UITableViewRowAnimationFade];
जब कि लाइन स्विच अटक जाती है और एप्लिकेशन को फ्रीज़ प्रयोग किया जाता है इस का इस्तेमाल किया। यह प्रति कहने में दुर्घटनाग्रस्त नहीं होता है, यानी कोई क्रैश लॉग नहीं है, यह बस जम जाता है और यूज़विच मध्य एनीमेशन बंद कर देता है।
मैंने देखा कि मैं उन अनुभागों को फिर से लोड कर सकता हूं जिनमें कोशिकाएं नहीं हैं जिनमें सहायक दृश्य शामिल हैं और यह फीका एनीमेशन के साथ पूरी तरह से काम करता है। अर्थात। यह
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:2] withRowAnimation:UITableViewRowAnimationFade];
क्योंकि तीसरे अनुभाग में सहायक दृश्यों वाले कोई भी कक्ष नहीं है। लेकिन कोई भी अनुभाग जिसमें एक सेल है जिसमें एक्सेसरी व्यू (यानी अनुभाग 0 और 2) शामिल है, यदि मैं इसे ऐप फ्रीज करने और पुनः लोड करने का प्रयास करता हूं।
कोई विचार यह क्यों हो रहा है? नीचे मेरी cellForRowAtIndexPath
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier;
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier];
if (indexPath.section == 0) {
cell.textLabel.text = [section0 objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (indexPath.row == 0) {
cell.accessoryView = colorSchemeSwitch;
}
else if (indexPath.row == 1) {
cell.accessoryView = autoLockSwitch;
}
}
else if (indexPath.section == 1) {
cell.textLabel.text = [section1 objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
else if (indexPath.section == 2) {
cell.textLabel.text = [section2 objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.detailTextLabel.text = [NSString stringWithFormat:@"%i \t", (int)app.fontSize];
fontSizeSlider.value = app.fontSize;
cell.accessoryView = fontSizeSlider;
}
else if (indexPath.section == 3) {
cell.textLabel.text = [section3 objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.detailTextLabel.text = app.color;
}
cell.backgroundColor = app.cellBackgroundColor;
cell.textLabel.textColor = app.textColor;
UIView *backgroundColorView = [[UIView alloc] init];
backgroundColorView.backgroundColor = app.cellSelectedColor;
[cell setSelectedBackgroundView:backgroundColorView];
return cell;
}
कृपया अपने प्रश्न में क्रैश लॉग संलग्न करें। –
यह वास्तव में विचित्र है, कोई क्रैश लॉग नहीं है, ऐप फ्रीज करता है, यह क्रैश नहीं होता है। स्विच बीच में फंस जाता है और ऐप अनुत्तरदायी हो जाता है। कोई क्रैश लॉग –
कोई सुझाव नहीं? –