SIGABRT from uiview background image? - objective-c

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?

Related

TableView crashes when swiped beyond start

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.

'Not key value coding-compliant' error from deleted xib

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.

class is not key value coding-compliant for the key textView

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.

Receiving "Thread 1: signal SIGABRT" after I add a new View Controller. How can I resolve this?

My project built and ran completely fine. (it's rootViewController is a TabBarController) So I added two new view controller to my storyboard and connected them to my rootviewcontroller. In storyboard, the tabs were added just fine and everything looked okay. So I added the ViewController classes to my project and hooked them up to the correct viewControllers in storyboard. However, when I ran the project my new tabs were not visible in the simulator. So I ran "clean" on my project, deleted my application out of the simulator, reset the simulator to its original settings, and my new tabs still would not appear in the simulator. So i quit everything and restarted my mac. This time, when I ran my project it gave me the "Thread 1:signal SIGABRT" So i became frustrated and deleted my new viewControllers, both from the storyboard and the classes menu. I sent the classes to trash. But STILL I get the SIGABRT error. Even now that I am back to my original project, I am getting the error. I can't figure out what is wrong. Since it won't let me post a picture of my screen, just let me know if you need any additional debugger output or anything.
this is what its giving me in the debugger.
2012-07-05 09:22:33.336 NewsomeBand[265:15203] ***
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: 'Could not
find a storyboard named 'MainStoryboard' in bundle
NSBundle </Users/tammyscheele/Library/Application
Support/iPhone Simulator/5.1/Applications/
1B3E088D-23A6-4B77-8CBB-390A9720818A/
NewsomeBand.app> (loaded)'
*** First throw call stack:
(0x152b022 0x30d2cd6 0x5179f2 0xecd60 0xecff8 0xec17f 0xfb183 0xfbc38 0xef634
0x16beef5 0x14ff195 0x1463ff2 0x14628da 0x1461d84 0x1461c9b
0xebc65 0xed626 0x202d 0x1f95)
terminate called throwing an exception(lldb)
From the debugger output that you posted it looks like you may have accidentally also deleted a reference to your main/root story board. I'm guessing this based on
'NSInvalidArgumentException', reason: 'Could not
find a storyboard named 'MainStoryboard' in bundle
Either that or did you accidentally rename it somewhere or misspell it? It looks like its something simple in any case.
I solved it! I went into the info tab inside my project and set "Main storyboard file base name" to "MainStoryboard", and also made sure that my storyboard was named "MainStoryboard". That seemed to fix everything

Crash upon text selection and deletion from menu in UITextView

My UITextViews crash the app upon text selection and deletion.
Cut, copy, and paste seem to work fine. The only error in the log is:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIMenuController view]: unrecognized selector sent to instance 0xff85ac0'
It is a normal UITextView, and the UIMenuController is untouched and uncustomized. Any ideas?
Happens with iOS 4.3 and 5.0 in simulator and on device.
No more information with zombies enabled, except for a stack trace that I'll need to interpret.. The new Xcode isn't nice about this:
(0x356338bf 0x360ae1e5 0x35636acb 0x35635945 0x35590680 0x37c63925 0x3816b 0x1a557 0x3559222b 0x37a869a7 0x3559222b 0x31671943 0x35607a63 0x356076c9 0x3560629f 0x355894dd 0x355893a5 0x32073fed 0x3794d743 0x29d1 0x2990)
The cause was undocumented (correct me if you find documentation and I'll update this answer) behavior from UITextView and UITextField with their default use of UIMenuController. The "Delete" option is added if your UIText*Delegate implements delete:. When "Delete" is selected from the menu, your field's delegate will then be called with a delete: message. I discovered this by adding an exception breakpoint in the breakpoint listing pane, which gave me the properly symbolicated stack trace that the original exception did not. The crash was caused because I was using delete:(id)sender to service bar button items in a way that required use of the sender. I fixed it by renaming delete: to deletePart:. The user can still delete text by selecting "Cut".
Having view sent to UIMenuController means that you probably assigned the UIMenuController somewhere it shouldn't go. See if you set anything to equal menuController (or whatever your instance variable name is) and see if that causes an issue.
Also, this could be an overrelease happening much earlier in the code where the UIMenuController just happens to allocate in the memory space that was formerly occupied by something that was released too early. Enable NSZombies and see what your error changes to.