मेरे पास एक कस्टम UITableViewCell है, जिसे EventCell
कहा जाता है।कस्टम UITableViewCell को कॉल नहीं कर रहा है ForSegue
EventCell.h
#import <UIKit/UIKit.h>
@interface EventCell : UITableViewCell
@property (nonatomic, strong) IBOutlet UILabel *titleLabel;
@property (nonatomic, strong) IBOutlet UILabel *locationLabel;
@property (nonatomic, strong) IBOutlet UILabel *dateLabel;
@property (nonatomic, strong) IBOutlet UILabel *typeLabel;
@end
EventCell.m
#import "EventCell.h"
@implementation EventCell
@synthesize titleLabel, locationLabel, dateLabel, typeLabel;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
यहाँ कैसे मैं अपने सेल की स्थापना कर रहा हूँ है।
EventsMasterViewController.m
- (EventCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
Event *myEvent;
NSString *CellIdentifier = @"EventCell";
EventCell *cell = (EventCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"EventCell" owner:nil options:nil];
for (id currentObject in topLevelObjects)
{
if ([currentObject isKindOfClass:[EventCell class]])
{
cell = (EventCell *)currentObject;
break;
}
}
myEvent = [self.myEventsDataController objectInListAtIndex:indexPath.row];
cell.titleLabel.text = myEvent.name;
cell.locationLabel.text = myEvent.location;
cell.typeLabel.text = @"Social";
cell.layer.borderColor = [UIColor blackColor].CGColor;
cell.layer.borderWidth = 1.0;
return cell;
}
सेल महान स्वरूपित किया जा रहा है, यह बिल्कुल के रूप में मैं इसे करने की जरूरत है लग रहा है। लेकिन जब मैं उस पर क्लिक करता हूं, तो सेल नीला रंग को हाइलाइट करता है और अगले दृश्य में नहीं आता है। मैंने अपनी तैयारी में एक ब्रेकपॉइंट लगाया है फोरसेग्यू विधि और इसे भी बुलाया नहीं जा रहा है।
क्या तैयार करने के लिए कुछ तरीका मैन्युअल रूप सेForSegue है? यदि हां, तो मुझे यह कहां करना चाहिए।
आपके 'टेबल व्यू के बारे में क्या: didSelectRowAtIndexPath: '? – Desdenova
मेरे पास एक विधि नहीं है, क्या मुझे इसे लागू करने की आवश्यकता होगी? – ardavis
जो मैं पढ़ रहा हूं, क्या हम 'readySorlectRowAtIndexPath' के बदले 'readyForSegue' का उपयोग नहीं करते हैं? – ardavis