V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
DavidHu
V2EX  ›  iDev

遇到一个 unrecognized selector sent to instance 的问题

  •  
  •   DavidHu · 2015-05-04 00:25:02 +08:00 · 2404 次点击
    这是一个创建于 3280 天前的主题,其中的信息可能已经有所发展或是发生改变。

    写一个collectionViewController, 调用他的dataSource里面的一个自定义函数,结果调用不到,然后就crash了。

    //ClassCalendarCollectionViewController.m
    ClassCalendarDataSource *classDataSource = (ClassCalendarDataSource *)self.collectionView.dataSource;
    classDataSource.configureWeekViewBlock = ^(WeekReuse *weekReuseView, NSString *kind, NSIndexPath *indexPath) {
    if ([kind isEqualToString:@"WeekReuse"]) {
                for (int i = 0; i < 7; i++) {
                    NSLog(@"will print: %@", weekDay[i]);
                    weekReuseView.WeekTitle.text = [NSString stringWithFormat:weekDay[i], indexPath.item +1];
                }
            }
        };
    
    //ClassCalendarDataSource.h
    typedef void (^ConfigureWeekViewBlock)(WeekReuse *weekReuseView, NSString *kind, NSIndexPath *indexPath);
    @interface ClassCalendarDataSource : NSObject <UICollectionViewDataSource>
    @property (copy, nonatomic) ConfigureWeekViewBlock configureWeekViewBlock;
    @end
    

    这个是在学习着一个GitHub的项目在写,前辈指点我说要有这个函数的实现才行,但是原项目就没有实现,只是在几个需要的地方调用了一下
    原项目地址: https://github.com/objcio/issue-3-collection-view-layouts.git
    请教各位怎么回事

    1 条回复    2015-05-05 15:18:46 +08:00
    DavidHu
        1
    DavidHu  
    OP
       2015-05-05 15:18:46 +08:00
    = =自己顶一下,还是没解决问题啊……
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5121 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 01:19 · PVG 09:19 · LAX 18:19 · JFK 21:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.