SIGABRT on Startup in Simulator - xcode

I was just running my code on the simulator which has been working in the past. The only thing I've really done for the startup code is setting user defaults
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
#"Automatic", #"userType",
#"NO", #"autoRefresh",
#"60", #"refreshInt", nil
];
[defaults registerDefaults:appDefaults];
[defaults synchronize];
I ran the app 10 times on my iPhone/iPad and experienced no crashing on startup. However, if I run it on the iPhone/iPad Simulator, the iPhone simulator crashes with SIGABRT basically every other time. I am not sure what's causing this as I've already restarted my computer and did a "Reset all Contents and settings" on the simulator.
Thanks!
Alan

If you are running Xcode 4.6.2 on OSX 10.8.4, try upgrading to Xcode 4.6.3 which was just released a few days ago. The 4.6.3 version has fixes for the random crashes and hangs that sometimes happens when debugging on the ios simulator.

This seems to be a bug in the lldb in chord with the newest version of Moutain Lion. If you want to avoid this switch to using GDB

Related

How to display all apps of developer in the brand new macOS Mojave App Store?

I am displaying all my macOS apps in App Store by a single line like this:
NSString *finalLink = #"http://appstore.com/mac/JiulongZhao"
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:finalLink]];
It works until macOS Mojave 10.14. the webpage jumps but App Store just hanging there or "Cannot Connect to AppĀ Store".
BTW, the visit of each app is still available like this:
NSString *finalLink = #"macappstore://itunes.apple.com/us/app/Overlay/id653092846"
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:finalLink]];
Any advice?
Yes, a statement in browser like this is still working:
macappstore://itunes.apple.com/us/app/Overlay/id653092846
The following recommended answer does not work well, I will upload my answer soon.
The following link works to open all apps made by Apple on the Mojave Mac App Store:
https://itunes.apple.com/us/developer/apple/id284417353?mt=12&uo=4&at=11l6hc&app=itunes&ct=fnd
Found via the links created by the fnd.io tool:
https://fnd.io/#/us/search?mediaType=all&term=Apple
Suggested in the accepted answer here:
Open Developer Page in Mac App Store on macOS Mojave

App not showing same result as Xcode simulator

I am new to Xcode and app programming and developed a small app to get certain calendar events and present them in a NSTableview.
The program is working fine in my Xcode simulator.
However when I build for running and start the App on my iMac, is is not returning any calendar events. Just runs and ends without any errors.
What am I missing here?
Problem was solved by adding [store requestAccessToEntityType:(EKEntityTypeEvent) completion:^(BOOL granted, NSError *error) after the allocation of the EKEventStore.

sessionWithConfiguration freezing iOS 8 iPhone 4S on new Xcode 6.0.1

I am experiencing a disturbing issue when trying to execute one of my apps on an iPhone 4S with iOS8 and Xcode 6.0.1. What happens is that the control seems to freeze in the last instruction of the block:
dispatch_once(&onceToken, ^{
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:#"myBackgroundSessionIdentifier"];
NSLog(#"configuration=%#", configuration);
configuration.allowsCellularAccess = YES;
configuration.timeoutIntervalForRequest = 30.0;
configuration.timeoutIntervalForResource = 60.0;
configuration.HTTPMaximumConnectionsPerHost = 1;
session = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:[NSOperationQueue
mainQueue]];
});
Please note that neither the iPad I tested nor the simulator have any issues about it.
Also the same app on the store, compiled with the past Xcode, seems to have no issue on any device, both according to my tests and on the lack of users feedbacks.
I could not test it on my iPhone 4 as I seem unable to install the app on it from the new Xcode: it complaints the iPhone is busy when I try to install it.
Has anyone had a similar problem and knows how to fix it?
Wipe the device and restore from backup.

Why debugger lldb says object is nil in iOS 5.1 simulator?

My write some code like:
_myDataArray = [[NSMutableArray alloc] initWithCapacity : kNum];
for (int i=0; i<kNum; i++) {
MyData *myData = [[[MyData alloc] init] autorelease];
pageData.title = [NSString stringWithFormat:#"No.%d line", i];
[_myDataArray addObject:myData];
}
There is no problem in iOS 4.3 simulator, but lldb debugger says _myDataArray is nil
(lldb) po _myDataArray
(NSMutableArray *) $2 = 0x00000000 <nil>
in iOS 5.0/5.1 simulator, Xcode 4.3.1 but result of in view is correct.
Xcode 4.3.2 looks fix this problem.
I can confirm that we have the same problem with the 5.0 and 5.1 simulator using the 4.3.1 Xcode. Same code with Xcode 4.2.1 and 5.0 simulator doesn't have the problem. Noticed that mutable arrays getting allocated in the order they are in the .h file - stepping through the .m code in debug mode is hilarious because arrays are getting allocated out of order. Solution? Wait for Apple to fix the problem, report the bug, etc.
I can confirm the exact same problem with iOS 4.3, 5.0 and 5.1 both on iDevice and in the Simulator. An Update from Xcode 4.3.1 to 4.3.2 does not solve the problem here...
Switching back to the GDB debugger in the scheme settings solves the problem.
I have the same issue with all of my projects in the 5.0 and 5.1 simulators. XCode 4.3.3 fixed this for me.

iOS App Crashing on iOS 4.2 but not 4.0, simulator not showing logs

Using XCode 3.2.5 I can run my application on iOS Simulator using the 4.2 SDK. However, it crashes on the following function, more specifically, the presentModalViewController call:
- (void)login {
//check to see if they logged in correctly here
/*UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:#"Login Failed!"
delegate:self cancelButtonTitle:#"OK" otherButtonTitles:nil];
[alert show];
[alert release];*/
[self presentModalViewController:self.accountsViewController animated:YES];
}
However, on XCode 4 Dev Preview, I can't even access 4.2 SDK in the Simulator, so I'm forced to use 4.0 SDK. In 4.0, that function works find and as expected. I have two issues:
Why is the 4.2 SDK in the Simulator not reporting the reason it crashed in XCode 3.2.5? It used to be that when my app would crash in debugging mode in the Simulator, XCode would pop up the reason. However, it's not anymore.
Why would that simple line crash in 4.2 but not 4.0. Could it be the different XCode versions?
It was some sort of weird issue between XCode version. I recreated the whole add using solely XCode 3.2.5 and the same exact code now works.

Resources