I am new to programming in general and especially iOS. Also, this is my first time asking on StackOverflow. I hope I don't start by pasting the code incorrectly.
In my application, I need to load and show some JSON into an application.
I managed to follow a tutorial and adapt it to my needs, and so I can currently load a list of data into a ListView but I am having some trouble showing the entire post in a Details View.
I have a class for my Post ViewController (lists) and another for my Details ViewController (details).
This is what the problem part of the code looks so far (PostsViewController):
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@"showDetailView"]) {
NSIndexPath *ip = [self.tableView indexPathForSelectedRow];
[[segue destinationViewController] getPost:[postsArray objectAtIndex:ip.row]];
}
}
The method it calls is in the DetaisViewController:
- (void)getPost:(id)postObject {
currentPost = postObject;
}
I have no idea what I'm doing wrong and to this moment I still do not have that deep understanding of the inner workings of Obj-C, compilers and such.
I am doing this as a test for an entry level job, and I expect to learn a little more day after day.
Also, the entire error is this:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber length]: unrecognized selector sent to instance 0xb000000000000083'
Please let me know if I need to present more information and I apologise in advance for my noobness.
Regards!