से मेल नहीं खाती है मैंने हाल ही में एक परियोजना को एक्सकोड 8.0 के साथ स्विफ्ट 3 में परिवर्तित कर दिया है और मुझे उस फ़ंक्शन पर एक त्रुटि मिली है जिसे मैं बहुत अच्छी तरह समझ नहीं पा रहा हूं। इन पंक्तियों पर:स्विफ्ट 3.0 UITableViewDelege उद्देश्य-सी विधि आवश्यकता के चयनकर्ता
extension HomeTableViewController : UITableViewDelegate {
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
}
}
त्रुटि को हल करने Xcode सिर्फ विधि से पहले @objc(tableView:commitEditingStyle:forRowAtIndexPath:)
जोड़ने के लिए मुझसे कहता है।
ठीक है, यह काम करता है, लेकिन मैं नहीं मिलता है कारण है कि यह केवल इस विधि के लिए आवश्यक है।
एक्सकोड को मेरे tableView:heighForHeaderInSection
के सामने @objc सामान जोड़ने की आवश्यकता नहीं है, लेकिन मुझे इस विधि और tableView:commitEditingStyle:forRowAtIndexPath:
के बीच UITableViewDelegate
में कोई अंतर दिखाई नहीं देता है।
तो, पता है कि tableView:commitEditingStyle:forRowAtIndexPath
विधि के लिए यह अनिवार्य क्यों है?
अग्रिम धन्यवाद!
मुझे @objc (tableView: heightForRowAtIndexPath :) विधि के लिए एक ही समस्या है। कोई विचार नहीं – Maiaux