Error from CALayerArray in tableView - iphone

I've got an app that has been out for sometime, but we are seeing some issues now when running on iOS 5.0 & up. The crash happens when a user selects a cell in a tableview. The tableview is toggling a checkmark on or off so that the end user can select items from a list to refine a query. Everything worked great from version 3 & 4, but then it just broke when iOS 5 came out.
This is actually an app that I inherited from another developer when I took this job, so there is no telling how deep this problem runs. I did find that if I changed the way he was displaying the checkmark that it fix the problem, but then the checkmark would disappear as soon as I scrolled it off screen in the view.
The console is showing the following error. Any advice would be most appreciated.
-[CALayerArray row]: unrecognized selector sent to instance 0x796db410
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CALayerArray row]: unrecognized selector sent to instance 0x796db410'

This looks like a typical case of an overreleased object. To debug this kind of problem you could use the allocations instrument with the NSZombie detection enabled.

Related

signal SIGABRT Error when trying to run xcode 5.0 app

Sorry to ask, I have tried everything I have read online, but I keep getting the SIGABRT Error when I try to run an app.
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
#autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
Error code comes up beside the return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
line.
The debugger just states
2013-10-18 10:29:45.270 Black History Month[733:c07] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x903f770> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
*** First throw call stack:
(0x14a3052 0xea3d0a 0x14a2f11 0x9b3032 0x924f7b 0x924eeb 0x93fd60 0x23291a 0x14a4e1a 0x140e821 0x23146e 0x233010 0x1314a 0x13461 0x127c0 0x21743 0x221f8 0x15aa9 0x138dfa9 0x14771c5 0x13dc022 0x13da90a 0x13d9db4 0x13d9ccb 0x122a7 0x13a9b 0x2712 0x2685)
terminate called throwing an exception
I have tried producing a couple different apps and always get this error so cannot release, I have now tried a simple uiwebview app and the same thing keeps happening. I have tried running on many different deployement targets with no successful outcomes.
I have tried resetting the simulator, restarting both xcode the simulator, and computer multiple times, turned off auto layout for the xib file. No luck. Any ideas?
Thanks in advance
This has nothing to do with Xcode. Your application has thrown a run time exception. Since the exception is not caught anywhere it is poped upto main. Set an exception to All Breakpoint to figure out whats wrong. If your app worked in Xcode 4 then check the iOS deployment target. I suspect it has to do with iOS 7 which is default target in Xcode 5.
I also had this error. After spending so much time, I found how to fix it. First of all go the console and see where is the error (mine was related to storyboards and its code) The way I fixed my error was by going in story board. Below the iPhone screen, there will be small yellow button. Right click on it and you will see that is causing error. Delete(x) it if there is yellow error sign.
If this does not fix your error then try to make new project and then replace its blank files with old files of your old project. I had same error in very beginning and by doing this program run without any error.
Other people suggests by restarting your laptop and running it again, reseting the iOS simulator, or changing iOS debugger (however this does not work in latest x code since there is only one debugger)
Hope this helps
From the error message
[<UIApplication 0x903f770> setValue:forUndefinedKey:]: this class is
not key value coding-compliant for the key view.
one can see that you try to set the view property on an instance of UIApplication,
but UIApplication does not have a view property.
To find the point where the error occurs, set a breakpoint on
"All Objective-C Exceptions".
I also had this error. After spending so much time, I found how to fix it. First >of all go the console and see where is the error (mine was related to storyboards >and its code) The way I fixed my error was by going in story board. Below the >iPhone screen, there will be small yellow button. Right click on it and you will >see that is causing error. Delete(x) it if there is yellow error sign.
I would +1 Viraj's answer, but I don't have the reputation. I can verify that in a Swift project in X-Code 6, this solution works. My problem was:
My app ran great on the initial view controller and on the 2nd screen, but upon trying to load the third view controller, my app would crash and return the "SIGABRT" error.
The Fix was indeed to go to the screen where my app was crashing, right click on the yellow icon (which is ABOVE the view in my version of X Code). I had two IB Outlets assigned to views, which did not have connections to the code. I did not need them too (they were old), so I deleted both from within the Outlets inspector in the right sided attributes inspector.

Exception on app startup in device,works fine in simulator

The application works fine on the simulator but breaks in start up in device as in the figure
I tried some of the solution in SO but It doesnt work out.What may be the reason ?How can i find it? How to resolve it
For clarity
Tried : Changing the view controller the viewcontroller. view did load and all functions are working fine after that when the view tries to appear on the screen the crash appears
UPDATE : Now getting the error logged as
*** -[Not A Type retain]: message sent to deallocated instance 0x208c9610
I had the same issue before. This is not a crash. Please remove all your break points and run it again.
This is a Breakpoint error ..... It normally occurs when you add a breakpoint to an app running in the device. If you add the breakpoints before the app has been built and run it again.... The crash will not occur.
Even I couldn't figure out why this crash should occur in the first place but it does.
OK found out the problem.I am using an external library which does not implement ARC so it has to be flagged.all files except 2 are not flagged as -fno-objc-arc and hence the issue.

Method UIToolbar.setItems doesn't work on iOS 6

I have the following code that works good on iOS 5.1 to replace buttons on the toolbar:
[(UIToolbar*)toolbar setItems:itemsArray];
But compiled application doesn't work on iOS 6. I have compiled sources with xXode 4.5 with iOS 6 support but the error is the same:
2012-09-27 16:31:13.537 Linux[2633:907] -[UIWebFormAccessory setItems:]: unrecognized selector sent to instance 0x1d886ad0
2012-09-27 16:31:13.540 Linux[2633:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIWebFormAccessory setItems:]: unrecognized selector sent to instance 0x1d886ad0'
*** First throw call stack:
(0x361032a3 0x3441397f 0x36106e07 0x36105531 0x3605cf68 0x775c5 0x33bbda6f 0x360d85df 0x360d8291 0x360d6f01 0x36049ebd 0x36049d49 0x365862eb 0x37428301 0x7538d 0x75328)
libc++abi.dylib: terminate called throwing an exception
(lldb)
How to fix the issue?
Linked issue: How to replace buttons on a toolbar under UIWebView keyboard on iOS 6?
Thanks a lot for the help!
Even if it is a UIToolbar, which it might not be any longer, you're obviously trying to call a method (or "send a message") that doesn't exist. The solution is to not do that since the method won't just reappear out of nothing once you try hard enough.
It may be the case that there's another way to continue doing what you're trying to do by finding another fitting method on this undocumented type. However, maybe that will also break someday like this just broke. If they don't document something, yes, it means you can still use it (at least up until you send it for review), but it also means that it might break at any time.
A long term solution is to work out a way to bring up your own interface which you can control yourself. Knowing where you want to integrate, I don't suppose it's very easy. I think I saw another question about that here on Stack Overflow a few days ago saying to detect touches, stop editing and take over the UI yourself (although it doesn't really play well with cursor positioning, copy/paste menus and so on).
Either way, you'll have to devise a new solution that's not so brittle.
UIWebFormAccessory is not a UIToolbar on iOS6. If you want to mess with the form accessory toolbar, check out the "findVirginWebKeyboardToolbar" answer to your related question: https://stackoverflow.com/a/12865353/199267
are you sure the toolbar in this specific case is actually a UIToolbar? I would guess it's a casting issue.
I do the following in one of my classes, and it definitely works in iOS6
NSMutableArray *items = [NSMutableArray arrayWithArray: self.topToolbar.items];
[items insertObject:barButtonItem
atIndex:0];
self.topToolbar.items = items;

iPhone exception handling crash my app

I am new on ios and i am following a tutorial to develop a calculator.
When i build my project it succeds, but on run time it crashes and throwa an exception:
`2012-09-19 10:03:51.469 AhsanCalculator[325:f803] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x6d59870> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key pushOperand.'
*** First throw call stack:
My code is here if you need more detail. Tell me what you need and i will give you all the details.
Xcode = 4.3.3
5.1 iPhone simulator
Please help to solve this issue
The crash occurred for you is because, in your xib you have linked/connected some wrong objects, i mean a UITextField to a UITextView or some thing like that.
When you open Xib right clicking on the files owner object, it shows some of the IBOutlets connected with a warning icon, delete those and connect to the right/correct one.
This will clear your crash, and works fine.
As you are new to iOS development, here are some link to learn about what to when a crash appears in the project,
Its is by Raywenderlich, here it is a 2 part tutorial part 1 and part 2.

NSInvalidArgumentException: "Invalid Region" in MapKit app

I'm trying to set all latitudes and longitudes as coming from local database in google map with dropping annotations at there.The required values of lat and long come after clicking a button and on the next screen,there is another button which on clicking produce the same result.Luckily, I'm able to refresh the map with new annotations, but as I'm trying to go back the ipad app on device get crash with following crash message:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid Region '
* First throw call stack:
(0x382178bf 0x37d631e5 0x382175f5 0x3365539b 0x6b26b 0x6e6a7 0x64c81 0x63753 0x6a84d 0x38171435 0x31cda9eb 0x31cda9a7 0x31cda985 0x31cda6f5 0x31cdb02d 0x31cd950f 0x31cd8f01 0x31cbf4ed 0x31cbed2d 0x37f45df3 0x381eb553 0x381eb4f5 0x381ea343 0x3816d4dd 0x3816d3a5 0x37f44fcd 0x31ced743 0x355b 0x2fa4)
But, working well on simulator.
I believe you are using XCode 4, which has a known problem with not showing the crashlog stack properly. Please see this answer to enable showing the stack trace when you get an exception and then please resubmit the crash again. It may not be possible to help you with this issue without a proper exception stack.