linkedin / linkedin/LayoutTest-iOS
Can't call init with data
Nobody has claimed this yet.
- Dominant language
- Objective-C
- Stars
- 558
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Description
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;
}
`
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the NSInvalidArgumentException from the viewForData:reuseView:size:context: entry point using StoriesASDetailViewController and its initWithStory: call. Inspect the available initializer and the LayoutTest-iOS testing flow; done should be a confirmed, documented resolution for creating the view controller with StoryRealm data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100