लेकिन आप केवल वर्गों जो पंक्तियोंकी उतनी ही संख्या में होते हैं पुनः लोड कर सकते (या आपको उन्हें मैन्युअल रूप से जोड़ना या निकालना है)। नहीं तो आप मिल जाएगा:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 2. The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (0), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'
कौन सा की आवश्यकता नहीं है जब आप [tableView reloadData]
का उपयोग करें। आप एक वर्ग (bandejapaisa शो की तरह) में डालते हैं तो
NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:section];
[self beginUpdates];
[self deleteSections:indexSet withRowAnimation:rowAnimation];
[self insertSections:indexSet withRowAnimation:rowAnimation];
[self endUpdates];
यह:
जब आप और एक वर्ग को फिर से लोड करने की आवश्यकता है आप अंदर यह पंक्तियों की संख्या को बदल दिया है, तो आप कुछ इस तरह इस्तेमाल कर सकते हैं इस तरह दिख सकता है:
- (void)reloadSection:(NSInteger)section withRowAnimation:(UITableViewRowAnimation)rowAnimation {
NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:section];
[self beginUpdates];
[self deleteSections:indexSet withRowAnimation:rowAnimation];
[self insertSections:indexSet withRowAnimation:rowAnimation];
[self endUpdates];
}
कॉलिंग reloadData अभी तक केवल शुरू में UITableViewCells कि की स्क्रीन –
संभव डुप्लिकेट पर हैं पुनः लोड होगा http://stackoverflow.com/ reloadSection उपयोग करने का प्रयास प्रश्न/3485162/पुनः लोडिंग-केवल-एक-uitableviewcell-on-a-uitableview –
आपकी मदद के लिए थेंक्स स्टीव नौकरियां –