I spent several hours trying to load subclassed UINavigationController from another NIB while taping a tabBarItem. Does anyone have any idea, how to do it correctly?
The latest test:
MainWindow.xib - UITabBarController with 4 tabs, one is named News and is set to "Navigation Controller". While News tab is selected - class identity: NewsNavigationController, NIB Name: NewsView.
View loaded from NewsView appeared in the Window
Running this variant leads to:
Loading 123209 stack frames... (16%) and counting :) Removing class
identity ends with crash: *** Terminating app due to uncaught
exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value
coding-compliant for the key newsTableViewController.'
It's clear that Class indentity IS the way to go, but why does it not work for me?
Related
One of my TableViews crashes when a swipe downwards would tend to scroll it to earlier than its start. The error is
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[kitios.VersesTableViewController refreshVerseItems:]: unrecognized selector sent to instance 0x105155780'
kitios is the name of my app, VersesTableViewController is the custom class for the TableView controller, but my code does not have any function named refreshVerseItems. This is extremely puzzling!
What should I be looking for?
Months ago when learning how to cope with adding a row into the TableView I tried using a value changed event; but found a better way, deleted the #IBAction refreshVerseItems() function from the Swift code, but forgot to delete the valued changed action from the storyboard. Forgetting to remove that bit from the storyboard "came back to haunt me"! Problem is now fixed.
In my project I have a ContentViewController class which initially used an xib for layout. However, I later decided to delete the xib and programatically insert the subviews. When I deleted one of the subviews that had initially been present, I got:
"Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key infoView.'"
From research I know that this sort of error is almost always due to linkage issues between a class and a xib. I already checked to make sure that no class in the workspace references infoView, so that's not the issue. How can I unlink ContentViewController from the xib when the xib no longer exists? Thanks in advance!
Sometimes there are issues with the NIB file being deleted from inside the app, the safe way to resolve is to implement loadView and do your custom view creation there as this will prevent the superclass from trying to load a NIB.
I have a strange problem with my segue, which is causing my app to crash. The app crashes in ListViewController.m at line 33:
dvc.menu = [self.blogPosts objectAtIndex:[[self.tableView indexPathForSelectedRow] row]];
With the following error:
menu[15782:c07] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<DetailViewController 0x7576d50> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key textView.'*
I have been researching for a very long time now, and it seems that many experience the same problem, although their solutions doesn't seem to work for me. This is a whole new world for me, and I'd really like to know, what exactly I am doing wrong.
I have uploaded the XCode project for you to look at, if it is to any help. Download project files here
Thanks in advance!
In your storyboard, your detail text view should be linked with a property named textView inside your detail controller header file.
In the header file, however, you have a contentView property (not textView).
So, you have to delete the textView link from your storyboard (right click on the text view and click on the X button on the referencing outlet) and link the text view with the correct outlet (contentView)
Could not download your project. If variable "dvc" is a instance of DetailViewController, you need to check if "menu" has get/set or not.
Again I have encountered another problem...
I have a view which lists "covers" for each "book" like iBooks. Each of the book must be downloaded before viewing its contents. Once the contents for a book was downloaded, the user can view that contents (just a series of images).
However, suddenly my view for the book pages stop working. In my "book shelf" view which lists the covers of the books, if the book the user created was already downloaded, I instantiate another view controller for the book's page:
BookPageController *bookPageVc = [[BookPageController alloc] init];
bookPageVc.bookPageData = bookPageData;
[self.navigationController pushViewController:bookPageVc animated:YES];
I already checked if it properly instantiated by NSLog, and both BookPageController and self.navigationController are existed. Yet its always crushes with the error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
I didn't change/add anything for this BookPageController, it's just UIViewController.
Because when I try to another UIViewController, it works fine.
Am I missing something in BookPageController? Any help or point to direction would be appriciated.
Maybe i'm not seeing something, but the error ocurred when you insert and abject (creating the list?), but i dont see an insert action in your code.
Can you post that part?
(Or check if it is instantiated in that moment).
I tried putting a background image onto my view screen, unsuccessfully I might add. When I ran it I got SIGABRT taking me back to main.m. I tried reducing the image size, deleting the image, and finally just commenting out the code I had added to do it. Yet it still doesn't run. This is what shows up in the debug area:
2011-07-23 08:10:23.829 Soleternity[1229:fe03] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x7209da0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key play.'
*** First throw call stack:
(0x1114142 0x12a2ca7 0x1114001 0xaf89dc 0xa6aa0f 0xa6a97f 0xa85884 0x3c8fde 0x1115f0a 0x107f891 0x3c7b32 0x3c96d4 0x1b1171 0x1b1488 0x1b08a6 0x1bf624 0x1c008c 0x1b3ac4 0x2ee8876 0x10e8305 0x104ceb2 0x104b79a 0x104ac44 0x104ab5b 0x1b038d 0x1b1ab6 0x20a2 0x2015)
That could happen because your image is missing from the build bundle somehow. Try:
Remove your image
Clean your build.
Add it again and build.
You can also check if the image is really called play.
Also, are you adding an image to an UIImageView IBOulet?
Edit 1:
Have you done:
#import <AVFoundation/AVAudioPlayer.h>
And also added the framework to your build?