I have an application for audio/video call using SIP protocol.It working fine when i tried to make a call with ios5 device or used it on ios 5 device but it crash when i tried to call or use it on ios 6. It crash on only when i tried to make a video call with ios6 device to ios5 device. Crash message
Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [2.74665e-34 nan]'
Check this answer link
Probably you are calculating the value of some frame and it is a NaN (not a number).
For SIP calls the best is iDoubs, a very easy API
It's hard to know what's wrong without more code, but here are my two cents: If you have a view (something like a UIWebView) in your code, and you are using the plain init method to initialize it, try changing it to initWithFrame to give it a frame right away. The problem might be that you are trying to use the element before a frame is allocated to it, thus resulting in a CALayerInvalidGeometry error.
After analyzing my crash report and my code
*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan 96]'
I found the bug. I am using a method which is override from another class but somehow it's not working in iOS 6 and that's why it return some zero value because of this zero value it returns nan value and it crashed.
Related
I am working on a cross platform application that is over a decade old. The UI is by Qt and backend rendering is done with OpenGL. OpenGL contexts are managed in the back end, not by Qt.
I have recently added error checking and reporting for all OpenGL code in our app. Occasionally a situation arises where the first render initiated by Qt causes an "invalid drawable" error message in the terminal and all subsequent OpenGl calls fail with an "invalid framebuffer" error reported. These invalid drawable error messages have been treated as innocuous in the past, since before the user sees it the drawable eventually becomes valid and the scene is rendered correctly. However, with the new OpenGL error check/report it's not possible since there are large numbers of errors reported.
I would like to test if the drawable is valid. If it is not, it should return before the render starts. How can I verify that the drawable is valid?
MacBook Pro, OS X Mountain Lion (10.8.3), ati graphics card
I don't know at what API level you're working. I'm not sure it's possible to detect the problem after the fact. That is, if all you have is a context (perhaps implicit as the thread's current context) that failed to connect to its drawable.
I presume that Qt is using Cocoa under the hood. I further assume it has created an NSOpenGLContext and is invoking -setView: on it. You get that "invalid drawable" error if, at the time of that call, the view's window doesn't have a window device.
One common technique is to defer setting the context's view until the view has -drawRect: called on it, since at that point you're sure that the view has a window and the window has a device. (Although that ignores the possibility of forced drawing outside of the normal window display mechanism. For example, -cacheDisplayInRect:toBitmapImageRep:.)
If you just want to know at the point of the call to -setView: whether it's safe or not, I think you can rely on checking the value of [[view window] windowNumber]. The docs for -windowNumber say:
If the window doesn’t have a window device, the value returned will be equal to or less than 0.
Another approach is to prevent the problem rather than detect it. The strategy for that is basically to make sure the window has been shown and drawn before the call to -setView:. You may be able to force that by ordering it on-screen and invoking -display on it.
Ken Thomases post gave me the basic info I needed to find a workable solution. An additional conditional was needed. Here's what worked
//----------------------------------------------------------------------------
bool vtkCocoaRenderWindow::IsDrawable()
{
// you must initialize it first
// else it always evaluates false
this->Initialize();
// first check that window is valid
NSView *theView = (NSView*)this->GetWindowId();
bool win =[[theView window] windowNumber]>0;
// then check that the drawable is valid
NSOpenGLContext *context = (NSOpenGLContext *)this->GetContextId();
bool ok = [context view] != nil;
return win && ok;
}
2012-05-31 00:17:51.384 SAMPLEGAME[2901:10703] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SAMPLEGAMEViewController 0x752c140> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key girlHeadView.'
*** First throw call stack:
(0x1460022 0x1a7dcd6 0x145fee1 0xe47022 0xdb8f6b 0xdb8edb 0xdd3d50 0x6bb71a 0x1461dea 0x13cb7f1 0x6ba26e 0x5601fc 0x560779 0x56099b 0x4bf401 0x4bf670 0x4bf836 0x4c672a 0x497596 0x498274 0x4a7183 0x4a7c38 0x49b634 0x3aa1ef5 0x1434195 0x1398ff2 0x13978da 0x1396d84 0x1396c9b 0x497c65 0x499626 0x21fd 0x2165)
terminate called throwing an exception(lldb)
Hi everyone,
I am new to iOS programming and am lost on something.
I renamed my original UIIMAGEVIEW from "yelOrb"... which was inefficient for the real object in the end replacing a yellow orb. So I renamed it to "girlHeadView". (Mind you, this is what I named the UIImageView that you control with arrow keys.)
Now whenever I run the program I get a stink in' SIGABRT telling me this [in the code above].
I even renamed "girlHeadView" back to "yelOrb".
I went through my .h & .m file, no stray word or incorrect spelling is causing this.
How am I able to fix this? I just implemented a button function to change the UIImageView (I even commented it all out to see if that caused it- still SIGABRT issue) and I can't even run the simulator.
Thank you!
Edit: Found my problem, I had to remove and re-add the yelOrb's image on the storyboard. Odd, but it worked. :)
It sounds like there's an outlet in interface builder connecting the UIImageView to the old property name, yelOrb. Then, when the view controller's view loads, it tries to make that connection to yelOrb which no longer exists, so you get that error.
I'm trying to get a Windows Phone 7 XNA game to run in the emulator, however it simply quits after calling the Game.Initialize function. The only output it gives is:
A first chance exception of type
'System.NotSupportedException'
occurred in
Microsoft.Xna.Framework.Graphics.dll
'taskhost.exe' (Managed): Loaded
'Microsoft.Xna.Framework.GamerServices.dll'
A first chance exception of type
'System.Threading.ThreadAbortException'
occurred in
Microsoft.Xna.Framework.dll
No idea why, the same program runs fine when running for Windows desktop.
OK upon further investigation I've found that the error occurs because I'm initailizing spritebatch in Game.Initialize:
base.Initialize();
if (spriteBatch == null)
{
spriteBatch = new SpriteBatch(GraphicsDevice);
}
If I remove spriteBach = new ... it runs fine, however when I initialize it the update/draw functions the game WILL just exit...
You cannot use the GraphicsDevice (like, for example, by having SpriteBatch create the various graphics device resources it requires) until LoadContent is called, as the graphics device is not ready until then.
See Game.GraphicsDevice on MSDN:
Do not access this property until LoadContent is called.
OK I found out what the problem was. I was basically trying to draw a non power of 2 texture while using texture wrapping which the reach API of Windows Phone 7 does not like. I'm not sure why I didn't get an exception thrown for this (last time I did something like this I actually got an exception thrown).
I should have been more clear in my question, when I didn't initialize spritebatch I was also skeeping draw calls too.
At any rate that was the problem.
A simple 10.6 Cocoa app I wrote that basically draws a regular window with some buttons and text has been spewing hundreds of console log messages:
<Error>: CGContextSetCompositeOperation: invalid context 0x0
I do not directly call drawRect: and always use setNeedsDisplay:YES when I need to refresh.
Interestingly, this error does not happen on all machines, I'd say about 50% get the error. However, the program works fine in either case!
Anyone got any clue as to what this error means, where it's stemming from, and more importantly, how can I suppress/get rid of it?
Thanks
Try setting a breakpoint on CGPostError. If you can break on the logging, you can hopefully figure out what's going on.
You shouldn't be looking to just suppress it. It means context creation is failing (thus NULL gets passed for some context parameter), and that's not good.
I'm using an NSOutlineView with the function
- (BOOL)outlineView:(NSOutlineView *)outlineView
isGroupItem:(id)item
defined so it gives the group row GUI look. When I add a root item, it works fine. When I add an item to root's child array and expand it, it works fine. If I contract the item though, the following error is logged:
[NSCFTimer copyWithZone:]: unrecognized selector sent to instance
I also get an EXC_BAD_ACCESS error if the app window is deactivated by switching to another app. I used the debugger to try to find where I might have made an error in one of my functions, but the stack trace only shows functions I did not create (RunCurrentEventLoopInMode, CFRunLoopRunSpecific, handleWindowNeedsDisplay, etc.) Does anyone have any idea where my error(s) might be?
Sounds like an object is dying prematurely. You get the “unrecognized selector sent to instance” exception when a new object is allocated later with the same pointer and then something tries to send the old object a message (in the example shown, the reincarnation is an NSTimer and the message something tried to send the previous object was copyWithZone:). You get an EXC_BAD_ACCESS crash when the object is simply garbage memory.
Debug this by running your app under Instruments with the Zombies instrument enabled. The object will, instead of dying, become a zombie object. When something tries to send a zombie a message, the zombie will moan (figuratively speaking), which will show up in Instruments's timeline as a flag. You can click a button in that flag to view the history of the object, including all of its retentions and releases.