I have implemented adwhirl in my project. I have implemented it previously in my projects, so I just incorporated it into my current project from my previous.
- (UIViewController *)viewControllerForPresentingModalView {
{
return self;
}
I had used this in my previous projects..since my window.rootvviewcontroller was self only. But in my current project there are many screens on which I am showing ads, so I have used:
- (UIViewController *)viewControllerForPresentingModalView {
{
return return [[(AppDelegate *)[[UIApplication sharedApplication] delegate] window] rootViewController] ;;
}
The main problem is the program was crashing, and still is. At first everything was okay: iads test ads loaded up, but it crashed rarely. I soon understand it was because of Admob. It crashed rarely because admob ads were not loaded most of the time.
Now searching for these crashes, I came across a point that since I have made the project in Xcode 4.2 rather than my previous projects Xcode 4.0 there were strong attributes in my window and view controller. I removed it.
Now the problem is in simulator it doesn't crash but it crashes in device.
The error is after I have added adview as a subview and it has - (UIViewController *)viewControllerForPresentingModalView went through this function but before adWhirlDidReceiveAd method.
The actual crash is [GADRequestPrivate spamSignals] EXC_BAD_ACCESS.
Below answer has already earned bounty for me :) ..... you can try for your problem...
Link : Getting to the bottom of crash
I found one of the best way to Debug the code for Crash. Follow the link for Debugging technique:
http://www.cocoadev.com/index.pl?DebuggingAutorelease
You need to analyze your Console very carefully to see actually why the Crash occurs. This helped me in almost all of the Code that are without ARC enabled.
I recommend you analyze your project and look for memory leaks and zombies. It seems like you are sending a message to a released object which causes the invalid memory access. The zombies detection cannot be run on the device, but you can run it on the simulator. Take a look at Xcode Instruments - Enable NSZombie Detection? Where is it?
Hope it helps.
Even if this happens in proprietary Adwhirl code, you can learn a lot by turning on all the debugging flags as specified, for example, in How to break on __NSAutoreleaseNoPool. This answer discusses lots of debugging flags, not just autorelease pool ones.
Related
After working just fine on both iPhone and iPad for a month, my Xcode 9 app has consistently started crashing causing me the following fatal problem: When I build & run it on an iPhone (simulator or device) Xcode completes loading the app and then crashes too fast for me to copy/paste the error from the debugger. When I run on iPad it works fine leading me to believe this is a result of something related to the split master/detail view.
If I use either an exception breakpoint or an "all C++ exceptions" it will stop at the AppDelegate class and crash if I hit play. If I use only an "all Objective-C exceptions" it will crash as before.
In the debug view hierarchy I get the following errors as well:
Error: Unable to capture view hierarchy.
Details: Log Title: Data source expression execution failure.
Log Details: error evaluating expression “(id)
[[(Class)objc_getClass("DBGTargetHub") sharedHub]
performRequestWithRequestInBase64:#"...
Log Method: -[DBGDataSourceConnectionLibViewDebugger
_executeLLDBExpression:forRequest:onPotentialThread:iteration:]
_block_invoke_2
Method: -[DBGViewDebugger updateDebugHierarchy]_block_invoke_2
I have tested other apps and this issue is unique to the app I am working on. Any ideas or debugging tips for how to proceed? I might just have to redo this whole project again if I can't even find the root cause of this! Appreciate any help.
Quick solution: Reset Simulator Device
I managed to resolve the above issue thanks to some serious digging. First, to resolve the instantaneous crash problem, I set a breakpoint at every line in the app delegate. That allowed me to narrow the error to a memory handling problem. From there I started running the code on one of each device available, and realized the crash only occurred on devices I had used earlier in development. Resetting those devices solved the problem.
The core issue here is that when you clean/rebuild your xcode program, it updates the app code on the device, but not necessarily the data model information. So when I changed my data model by including new data and renaming old data it was not properly updated.
I used Bugly(a tool same as Crashlytics) to recored crashes in my app which had released.But sometimes there are some crashes in main.m as the report showed:
With these information I can't location problem in my code at all.I need to know which class and which method the problem occured so I can location this problem.
I wonder is there any way I can location problem more precise?And how do you deal with these crashes in your released app?
Wish you can share,thanks a lot.
Finally I find this is memory leak result.Use Xcode instrument check is a good way.
I'm getting a really weird EXC_BAD_ACCESS(Code=EXC_ARM_DA_ALIGN) crash on my app which is written in swift but only when i run it on a 32 bit device and only if its running from Xcode (the device is still hooked to Xcode), If i start the app without Xcode it runs fine. I can't give any code since no matter what i do i get no stack trace or anything like that .Only the mention error on the AppDelegate, even though the crash is in different screens further in the app (crashes on second screen).
Any idea as to why the crash would happen only when Xcode is running the app
You are using some variable or object which is yet to be initialised. Please review your code and you will get the error. You can add exceptional break point to get the actual position of the error.
It's a memory alignment issue. Search on EXC_ARM_DA_ALIGN.
https://brewx.qualcomm.com/bws/content/gi/common/appseng/en/knowledgebase/docs/kb95.html
use memcpy
char*Code; int pc;
double f;
memcpy(Code+pc, &f, sizeof(f)); // instead of *(double*)(Code+pc)=f; that generates EXC_ARM_DA_ALIGN
I spent few days working on an app that was built by my friend last year before the release of iOS 8 and Xcode 6+ I believe. He used several libraries like PMCalender , FXforms, MyBlurIntroductionView, CCPickerView, SWRevealTableView etc and I added MBProgressHUD. Now before the app was running without crashes or now as I understand after further studying of the problems I am getting with the app. I believe the app has multiple because of memory leaks. I read his code before modifying it and just noticed there are compile sources he put i.e -fno-objc-arc or fobjc-arc. About a day ago after attempting to integrate SPGooglePlaceAutocomplete for some reason I had to disable Objective-C ARC from Build Settings and then the whole project build with lots of errors. That I had to change weak object to strong in some header file and so forth.
Now I tried to read this for more understanding Apple Transitioning to ARC release NOte
I am posting this question because I'm would say I'm a newbie to iOS development but catching up pretty fast. I need help to have a smooth running app with crashes because. What I am experiencing is not clear to the point that I had to use Instruments to see exactly what is causing the app to crash whereas coming into the app several time at some point it does not crash. When it crashes I get this only thread x and can't really know where to debug
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
The add has MapKit and first thing after login screen it should zoom to the user current location. Reason why I used Instruments to see what is happening with the app is because I was suspecting perhaps CoreLocation is causing the crash to connect to the remote CCLocationManager services. As I noticed my phone takes time to turn on gps and it does not always stay on even if I have request location always [self.locationManager requestAlwaysAuthorization];
So I am hoping someone can help me because I did the whole ARC transitioning but still have release, autorelease errors. All my IUOutlet are weak.
Here are the 6 errors I am left with removing with hoping the app will run normal.
I this this is the answer to my question, which can be helpful to others after long search and debugging.
http://www.daveoncode.com/2011/10/24/migration-to-arc-automatic-reference-counting-using-xcode-4-2-refactor/
i need your help i've got this frustrating "random" error.
The app is compose of one Mapviewcontroller and a collectionview on the second controller.
Sometimes when I return to the map from the second controller the app suddenly crash with this error on the the "trap" line.
The crash report doesn't point to any of my lines of code.
EXC_BREAKPOINT (code=EXC_ARM_BREAKPOINT, subcode=0xdefe)
I said "random error" because the same version of the same app could be build and run smooth for days, then suddenly it stuck. The only way to regain control of the app is to delete manually from the iPad and rebuild.
For your information the app uses Coredata.
Any ideas? Some method to figure out where the error come from?
Any help is appreciated, thanks!
I had this error on line like that
NSLog(#"%#: tutorial view retain count = %ld",self.class,CFGetRetainCount(CFTypeRef(tutorialView)));
where tutorialView equals nil
Restart your iOS device - that worked for me. You can also try restarting Xcode.
I was getting the crash where I had a breakpoint set, but I had breakpoints turned off. I think that there are glitches in how Xcode handles breakpoints that can cause this issue even if there aren't issues in the code itself.