我正在尝试使用 UICollectionView,它是 viewCell。我很顺利。但是在 viewcell 表单上,我有一个按钮,我打算进入设置视图。我正在尝试“将其推入堆栈”。Xcode 抱怨“选择器没有可见的界面”。一些代码和错误消息如下。
// TryColViewCell.h
#import <UIKit/UIKit.h>
#import "TryColViewContViewController.h"
@interface TryColViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UILabel *outletNameLBL;
@property (weak, nonatomic) IBOutlet UILabel *outletCellLabel;
@property (readwrite) NSInteger intTest;
@property (readwrite) TryColViewContViewController *theHost;
- (IBAction)actionPlus1:(id)sender;
- (IBAction)actionMinus1:(id)sender;
- (IBAction)actionNameEdit:(id)sender;
// TryColViewCell.m
#import "TryColViewCell.h"
#import "SettingsViewController.h"
@implementation TryColViewCell {
@public int intCellNumber; //TODO: get this to track the row/cell #
}
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
*/
- (IBAction)actionPlus1:(id)sender {
}
- (IBAction)actionMinus1:(id)sender {
}
- (IBAction)actionNameEdit:(id)sender {
NSLog(@"Name Edit");
SettingsViewController *viewControllerB =
[[SettingsViewController alloc] initWithNibName:@"SettingsViewController" bundle:nil];
viewControllerB.propName = _outletNameLBL.text;
[self pushViewController:viewControllerB animated:YES];
[self.theHost pushViewController:viewControllerB animated:YES];
}
@end
// PushVIewController 行上的错误消息
TryColViewCell.m:83:11: No visible @interface for 'TryColViewCell'
declares the selector 'pushViewController:animated:'