हर कोई एक वर्ग को हटाने के बारे में लिख रहते हैं। ठीक है, मैं एक जोड़ा पाने के लिए नहीं कर पा रहे।
वर्तमान में, मैं (जो NSInternalInconsistencyException साथ विफल रहता है) इस तरह कोशिश कर रहा हूँ:
UITableView *tv = (UITableView *) self.tableView;
if ([tv numberOfSections] == 1)
{
[tv beginUpdates];
[tv insertSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationTop];
NSLog(@Inserted.. Brace for impact.);
[tv endUpdates];
}
NSLog(@Section count after update: %d, [tv numberOfSections]); // Never reached
अगर मैं सही हूँ, सूचकांक 0 के साथ एक अनुभाग डालने शीर्ष पर यह जगह चाहिए, अन्य सभी वर्गों जोड़ने से नीचे, है ना? ठीक है, अगर मैं सही insertSections के बाद numberOfSections लिखने, वहाँ वर्गों की संख्या में कोई परिवर्तन नहीं प्रतीत होता है।
कोई विचार?
जोहान













