- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
SecondViewController.h
#import <UIKit/UIKit.h>
@interface SecondTableViewController : UITableViewController
@property(nonatomic, strong) NSString *businessName;
@end
code for CollectionViewController.m
#import "CollectionViewController.h"
#import "CollectionViewCell.h"
@interface CollectionViewController ()
@end
@implementation CollectionViewController
NSArray * favBC;
NSArray * relToMe;
NSArray * repByMe;
NSArray * redForApp;
NSArray * appBC;
static NSString * const reuseIdentifier = @"collectionCell";
- (void)viewDidLoad {
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations
// self.clearsSelectionOnViewWillAppear = NO;
favBC = [NSArray arrayWithObjects:@"IDEA1",@"NEW",@"IN VAL...",@"IN ESTI...",@"READY...",@"APPROV...",@"IT
CHAN...",@"UNDER...",@"IMPLEM",@"CLOSED", nil];
relToMe = [NSArray arrayWithObjects:@"IDEA2",@"NEW",@"IN VAL...",@"IN ESTI...",@"READY...",@"APPROV...",@"IT
CHAN...",@"UNDER...",@"IMPLEM",@"CLOSED", nil];
repByMe = [NSArray arrayWithObjects:@"IDEA3",@"NEW",@"IN VAL...",@"IN ESTI...",@"READY...",@"APPROV...",@"IT
CHAN...",@"UNDER...",@"IMPLEM",@"CLOSED", nil];
redForApp = [NSArray arrayWithObjects:@"IDEA4",@"NEW",@"IN VAL...",@"IN ESTI...",@"READY...",@"APPROV...",@"IT
CHAN...",@"UNDER...",@"IMPLEM",@"CLOSED", nil];
appBC = [NSArray arrayWithObjects:@"IDEA5",@"NEW",@"IN VAL...",@"IN ESTI...",@"READY...",@"APPROV...",@"IT
CHAN...",@"UNDER...",@"IMPLEM",@"CLOSED", nil];
// Register cell classes
[self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:reuseIdentifier];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
#pragma mark <UICollectionViewDataSource>
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
if([_businessName2 isEqualToString:@"IDEA1"]){
return [favBC count];
}else if ([_businessName2 isEqualToString:@"IDEA2"]){
return [relToMe count];
}else if ([_businessName2 isEqualToString:@"IDEA3"]){
return [repByMe count];
}else if ([_businessName2 isEqualToString:@"IDEA4"]){
return [redForApp count];
}else if ([_businessName2 isEqualToString:@"IDEA5"]){
return [appBC count];
}
return 0;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
CollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier
forIndexPath:indexPath];
if([_businessName2 isEqualToString:@"IDEA1"]){
cell.bcRequestLabel.text = [favBC objectAtIndex:indexPath.row];
}else if ([_businessName2 isEqualToString:@"IDEA2"]){
cell.bcRequestLabel.text = [favBC objectAtIndex:indexPath.row];
}else if ([_businessName2 isEqualToString:@"IDEA3"]){
cell.bcRequestLabel.text = [favBC objectAtIndex:indexPath.row];
}else if ([_businessName2 isEqualToString:@"IDEA4"]){
cell.bcRequestLabel.text = [favBC objectAtIndex:indexPath.row];
}else if ([_businessName2 isEqualToString:@"IDEA5"]){
cell.bcRequestLabel.text = [favBC objectAtIndex:indexPath.row];
}
// Configure the cell
return cell;
}
#pragma mark <UICollectionViewDelegate>
/*
// Uncomment this method to specify if the specified item should be highlighted during tracking
- (BOOL)collectionView:(UICollectionView *)collectionView shouldHighlightItemAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
*/
/*
// Uncomment this method to specify if the specified item should be selected
- (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
*/
/*
// Uncomment these methods to specify if an action menu should be displayed for the specified item, and react to actions performed on
元素
- (BOOL)collectionView:(UICollectionView *)collectionView shouldShowMenuForItemAtIndexPath:(NSIndexPath *)indexPath {
return NO;
}
- (BOOL)collectionView:(UICollectionView *)collectionView canPerformAction:(SEL)action forItemAtIndexPath:(NSIndexPath
*)indexPath withSender:(id)发件人{
return NO;
}
- (void)collectionView:(UICollectionView *)collectionView performAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath
withSender:(id)发件人{
}
*/
@end
#import "SecondTableViewController.h"
#import "CollectionViewController.h"
@interface SecondTableViewController ()
@end
@implementation SecondTableViewController
NSArray * favBC;
NSArray * relToMe;
NSArray * repByMe;
NSArray * redForApp;
NSArray * appBC;
- (void)viewDidLoad {
[super viewDidLoad];
favBC = [NSArray arrayWithObjects:@"IDEA1",@"NEW",@"IN VAL...",@"IN ESTI...",@"READY...",@"APPROV...",@"IT
CHAN...",@"UNDER...",@"IMPLEM",@"CLOSED", nil];
relToMe = [NSArray arrayWithObjects:@"IDEA2",@"NEW",@"IN VAL...",@"IN ESTI...",@"READY...",@"APPROV...",@"IT
CHAN...",@"UNDER...",@"IMPLEM",@"CLOSED", nil];
repByMe = [NSArray arrayWithObjects:@"IDEA3",@"NEW",@"IN VAL...",@"IN ESTI...",@"READY...",@"APPROV...",@"IT
CHAN...",@"UNDER...",@"IMPLEM",@"CLOSED", nil];
redForApp = [NSArray arrayWithObjects:@"IDEA4",@"NEW",@"IN VAL...",@"IN ESTI...",@"READY...",@"APPROV...",@"IT
CHAN...",@"UNDER...",@"IMPLEM",@"CLOSED", nil];
appBC = [NSArray arrayWithObjects:@"IDEA5",@"NEW",@"IN VAL...",@"IN ESTI...",@"READY...",@"APPROV...",@"IT
CHAN...",@"UNDER...",@"IMPLEM",@"CLOSED", nil];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if([_businessName isEqualToString:@"Favorite BC"]){
return [favBC count];
}else if ([_businessName isEqualToString:@"Related to me"]){
return [relToMe count];
}else if ([_businessName isEqualToString:@"Reported by me"]){
return [repByMe count];
}else if ([_businessName isEqualToString:@"Ready for approval"]){
return [redForApp count];
}else if ([_businessName isEqualToString:@"Approved BC"]){
return [appBC count];
}
return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"Business2Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier
forIndexPath:indexPath];
if(cell == nil){
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
重用标识符:简单表标识符];
}
if([_businessName isEqualToString:@"Favorite BC"]){
cell.textLabel.text = [favBC objectAtIndex:indexPath.row];
}else if ([_businessName isEqualToString:@"Related to me"]){
cell.textLabel.text = [relToMe objectAtIndex:indexPath.row];
}else if ([_businessName isEqualToString:@"Reported by me"]){
cell.textLabel.text = [repByMe objectAtIndex:indexPath.row];
}else if ([_businessName isEqualToString:@"Ready for approval"]){
cell.textLabel.text = [redForApp objectAtIndex:indexPath.row];
}else if ([_businessName isEqualToString:@"Approved BC"]){
cell.textLabel.text = [appBC objectAtIndex:indexPath.row];
}
// Configure the cell...
return cell;
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath
toIndexPath:(NSIndexPath *)toIndexPath {
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
if([segue.identifier isEqualToString:@"collectDetail"])
{
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
CollectionViewController *destViewController = segue.destinationViewController;
if([_businessName isEqualToString:@"Favorite BC"]){
destViewController.businessName2 = [favBC objectAtIndex:indexPath.row];
}else if ([_businessName isEqualToString:@"Related to me"]){
destViewController.businessName2 = [relToMe objectAtIndex:indexPath.row];
}else if ([_businessName isEqualToString:@"Reported by me"]){
destViewController.businessName2 = [repByMe objectAtIndex:indexPath.row];
}else if ([_businessName isEqualToString:@"Ready for approval"]){
destViewController.businessName2 = [redForApp objectAtIndex:indexPath.row];
}else if ([_businessName isEqualToString:@"Approved BC"]){
destViewController.businessName2 = [appBC objectAtIndex:indexPath.row];
}
destViewController.title = destViewController.businessName2;
}
}
@end
code for CollectionViewController.h
#import <UIKit/UIKit.h>
@interface CollectionViewController : UICollectionViewController
@property(nonatomic, strong) NSString *businessName2;
@end
code for CollectionViewCell.h
#import <UIKit/UIKit.h>
@interface CollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UILabel *bcRequestLabel;
@end
code for CollectionViewCell.m
#import "CollectionViewCell.h"
@implementation CollectionViewCell
@end
<b>and the error:<b>
2015-08-13 15:45:37.500 WACProject2[4049:82472] -[UICollectionViewCell bcRequestLabel]: unrecognized selector sent to instance 0x7fb031f59ab0
2015-08-13 15:45:37.503 WACProject2[4049:82472] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
'-[UICollectionViewCell bcRequestLabel]:已发送无法识别的选择器 实例 0x7fb031f59ab0'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110722f35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001103bbbb7 objc_exception_throw + 45
2 CoreFoundation 0x000000011072a04d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000011068227c ___forwarding___ + 988
4 CoreFoundation 0x0000000110681e18 _CF_forwarding_prep_0 + 120
5 WACProject2 0x000000010fe8be7b -[CollectionViewController collectionView:cellForItemAtIndexPath:] + 187
6 UIKit 0x000000011113d41b -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:]
+ 244
7 UIKit 0x000000011113eb54 -[UICollectionView _updateVisibleCellsNow:] + 3445
8 UIKit 0x0000000111142801 -[UICollectionView layoutSubviews] + 243
9 UIKit 0x0000000110b88973 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 521
10 QuartzCore 0x00000001143fdde8 -[CALayer layoutSublayers] + 150
11 QuartzCore 0x00000001143f2a0e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
12 QuartzCore 0x00000001143f287e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
13 QuartzCore 0x000000011436063e _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
14 QuartzCore 0x000000011436174a _ZN2CA11Transaction6commitEv + 390
15 QuartzCore 0x0000000114361db5 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 89
16 CoreFoundation 0x0000000110657dc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
17 CoreFoundation 0x0000000110657d20 __CFRunLoopDoObservers + 368
18 CoreFoundation 0x000000011064db53 __CFRunLoopRun + 1123
19 CoreFoundation 0x000000011064d486 CFRunLoopRunSpecific + 470
20 GraphicsServices 0x0000000113cf19f0 GSEventRunModal + 161
21 UIKit 0x0000000110b0f420 UIApplicationMain + 1282
22 WACProject2 0x000000010fe8c3e3 main + 115
23 libdyld.dylib 0x0000000112cb2145 start + 1
24 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
最佳答案
-[UICollectionViewCell bcRequestLabel] unrecognized selector sent to instance…
您正在访问 UICollectionViewCell
的 bcRequestLabel
,它不存在。
确保您在 Storyboard的 Collection View 单元格中正确设置了自定义类。
关于ios - 如何使用 xcode 6 从 TableView Controller 推送到 Collection View Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31980652/
当我推/拉存储库时,是否可以详细输出到底发生了什么?目前,我有一个大型存储库,正在将其推送到服务器,大约 15 分钟后。或者这样,它给了我一个错误,但没有告诉我它在这 15 分钟内做了什么。 最佳答案
我不知道我的方法是否有意义,但是,我需要实现如下图的布局: 现在,我只写一个 并用其中的一列表示每个区域,例如 . 没有黄色区域,这工作正常: green red blue
当我查看许多 CSS 网格系统和框架时,它们通常具有标准的列和行设置以及百分比宽度。例如这样的事情: 标准网格列: .col-10 { width: 83.33333%; width: cal
我想使用 git 子模块。 我需要采取的步骤将我的更改推送到我的项目是 add/commit/push from submodule directory add/commit/push from pa
以下为百度站长平台的公告全文: 结合站长对于关键词数据分析的需求,站长平台对流量与关键词工具进行了升级,推出(“关键词影响力”)这一全新概念。关键词影响力算法复杂,涵盖该关键词下百度搜索可以为
我需要一个具有普通按钮和下拉按钮的控件。 例如 类似的控件在 wxRibbonButtonBar 中可用,我无法在简单的 wxPanel 中使用它。 最佳答案 我实现了 SplitButton,它看起
我一直在做一个项目,使用 Bazaar 作为版本控制系统。现在我必须和离岸人员一起工作,而他们只想使用 SVN。 我有什么: 我的 bazaar 分支及其文件和修订版。 一个全新的 subversio
我一直在开发数据流/图表风格的内部 DSP 应用程序(Java 带有 Groovy/Jython/JRuby 的钩子(Hook),通过 OSGi 的插件,大量的 JNI),类似于纯数据和 simuli
我正在尝试使用 THUMB 指令创建一个阶乘方法,我基本上做到了。 我只有一个关于 PUSH/POP 操作码的问题:如果我使用 push 将 r0 的值存储在堆栈中(所以 push {r0} ),我可
在尝试 ZeroMQ Push/Pull (他们称之为 Pipeline)套接字类型时,我很难理解这个图案。它被称为“负载均衡器”。 假设单个服务器将任务发送给多个工作人员,推/拉将在所有客户端之间平
有什么方法可以使用 push() 方法找出我的数据何时保存在数据库中?我写了下面的代码,但它多次保存数据...... db.ref('news').push(opts).then(() => {
我有这个问题,每次推或拉时我都必须把它放进去。我认为这是新的。有什么想法吗? 最佳答案 您可能正在使用 https 网址。切换到 ssh 并确保您的 key 设置正确(如果您的密码短语为空),则不必输
为什么当您将一个值压入堆栈时,ESP 寄存器会减少(而不是增加),而当您弹出一个值时,ESP 寄存器会增加(而不是减少)?在这一点上,这对我来说是违反直觉的。 最佳答案 那是因为堆栈是从上到下“增长”
有什么方法可以使用 push() 方法找出我的数据何时保存在数据库中?我写了下面的代码,但它多次保存数据...... db.ref('news').push(opts).then(() => {
我决定编写一个测试代码来查看 pusher - many pullers bundle 是如何工作的,我的怀疑成真了。 拉取器按照连接的顺序接收消息,例如第一个消息由第一个连接的拉取器接收,第二个由第
我在 CSV 文件中存储了一长串日期。我已经成功地使用 d3.js 加载了这个数据集。现在我想向此数据集添加另一列,其中包含列表中每个日期的随机数。 我相信此数据集已作为对象数组加载。所以我正在使用下
我一直在寻找解决方案。不使用 c++11。 for(int a = 1; a < team1.chan; a++) { team1.nums.push_back(ppb.back())
我打算在布局中构建带有滑动 subview 的 UI。 +--------------+ +--------------+ +--------------+ | view1
Title 在小屏幕上,我首先需要标题,然后是文本字段,但在中等以上的屏幕上,我需要相反的方式 - 我已经尝试过推和拉,但它们无法工作 - 有什么想法吗? 最佳答案 根据 Swa
zmq 的某些部分未以可预测的方式运行。 我正在使用 VS2013 和 zmq 3.2.4。为了不在我的 pubsub 框架中“丢失”消息 [旁白:我认为这是一个设计缺陷。我应该能够首先启动我的订阅者
我是一名优秀的程序员,十分优秀!