Skip to content

Can't call init with data #46

@mikegunning

Description

@mikegunning

Hey! Really excited to get this project working for me.

I have a number of views and view controllers I would like to test. I am using Realm in-memory to create Realm Objects to pass into my inits to instantiate my views and view controllers.

failed: caught "NSInvalidArgumentException", "-[StoriesASDetailViewController initWithStory:]: unrecognized selector sent to instance 0x7fa5fbe07ce0"

No matter what I try, be it a cell or tableviewcontroller, I just keep getting the error above.

Any advice?

`
+(UIView *)viewForData:(NSDictionary *)data reuseView:(UIView *)reuseView size:(LYTViewSize *)size context:(id _Nullable __autoreleasing *)context {

        StoryModel *story = [[StoryModel alloc] initWithDictionary:data error:nil];

        StoryRealm *local = [[StoryRealm alloc] initWithStoryModel:story];

        StoriesASDetailViewController *footer = [[StoriesASDetailViewController alloc] initWithStory:local];

        StoryDetailCell *cell = [footer.collectionNode cellForItemAtIndexPath:0];

        *context = footer;

        return cell;

}
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions