मैं ios 5 UITableView के didSelectRowAtIndexPath, जो ios 4.UITableView didSelectRowAtIndexPath पहले नल
पहली बार मैं तालिका में किसी भी पंक्ति नल में सही है के साथ समस्या हो रही है पर नहीं बुलाया जा रहा है, विधि नहीं है बुलाओ एक बार जब मैं एक और पंक्ति का चयन करता हूं, तो यह didSelectRowAtIndexPath को कॉल करता है, लेकिन अंतिम अनुक्रमणिका पाथ पास करता है।
मैंने पहले से tableView.delegate सेट किया है, और यह ios4 में सही ढंग से चलाया जा सकता है।
MainView.xib
UITabBarController
--UINavigationController
--**UITableViewController**
कोई सुझाव?
- (void)viewDidLoad
{
[super viewDidLoad];
self.tableView.delegate = self;
self.tableView.dataSource = self;
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
}
- (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] autorelease];
}
cell.textLabel.text = [[NSString alloc]initWithFormat:@"%d",indexPath.row];
return cell;
}
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"%d",indexPath.row);
}
क्या आप कोड पोस्ट कर सकते हैं? क्या आप वाकई कार्यान्वित नहीं किए हैं DDlectlectRowAtIndexPath? – Anna
मैंने अचयनित नहीं किया था। धन्यवाद। –
यह कोई समस्या नहीं काम करना चाहिए। क्या यह वर्ग UITableViewController का उप-वर्ग है? यदि यह देखने के लिए है कि दृश्य में सेट सेट करने की कोई आवश्यकता नहीं है DidLoad विधि क्योंकि यह पहले से ही असाइन किया गया है। अन्यथा वर्ग .h फ़ाइल में ब्रैकेट में प्रतिनिधि जोड़ें। –