Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
I updated to 10.10 and downloaded the latest Xcode. Today I tried to run a program I have been working on for the last year and it crashes before it even launches the app in Xcode? I set the breakpoint and it seems that the problem is in the NSApplicationMain. I have not seen an error like this and it is confusing. I did a web search but couldn't find any good answers I could follow. I took a screen shot.

If anyone could take a look at it and point me in the right direction I would be thankful.
 

Attachments

  • Screen Shot 2015-06-07 at 4.08.15 PM.png
    Screen Shot 2015-06-07 at 4.08.15 PM.png
    461.5 KB · Views: 186
What OS and Xcode versions did you update from? What kind of application/project is it?

I updated from 10.9 to 10.10.3 Xcode is 6.3.2. The application is simple and an aid to create a graphic. from selected images. It loads images and displays them in a scrollView. I pick for images and then fill in string data and press an NSButton to create context for the images and then it creates a .tif file.
 
Have you tried to move the breakpoint until you hit the crash? Also, the crash report may give you some clues.
 
Have you tried to move the breakpoint until you hit the crash? Also, the crash report may give you some clues.

I think the very first line break that I can set is in the AppDelegate.m. I set a breakpoint where I instantiated a sharedArray. The program crashes before it even hits this first line of code. I set up a custom breakpoint to stop where it throws an exception. I did a screen capture in my first post that shows where it stopped. If the breakpoint was something simple like an array out of bounds I could easily fix it.

Code:
#import "AppDelegate.h"

@implementation AppDelegate
@synthesize sharedArray;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    // Insert code here to initialize your application
    sharedArray = [[NSMutableArray alloc] init]; // This is my first line of code that should be called.
    [self.window setOpaque:NO];
    NSColor *backgroundColor = [self.window backgroundColor];
    backgroundColor = [backgroundColor colorWithAlphaComponent:0.6];
  
    [self.window setBackgroundColor:backgroundColor];
    //[[self window] setAlphaValue:0.5];
}

@end
 
Yes, it stopped there since you set the breakpoint there. I was just asking if you tried to move the breakpoint to isolate the exact line. How about the crash report?
 
Yes, it stopped there since you set the breakpoint there. I was just asking if you tried to move the breakpoint to isolate the exact line. How about the crash report?
Thanks for the continuing help Subsonix, I set a breakpoint in main.m for the return line. I ran the program and it stopped at that breakpoint, I clicked on the continue program execution button and it worked just fine till the program fully launched? I can't explain it but it is working just fine now. I don't understand how it can fix itself?

By the way I included an image that has the crash data in the display window below. I don;t know if there is a more detailed folder that contains other crash data files to review or if its the normal debug area that tells you why it crashed. In this case there was no data below as you can see from the image.

Thanks again!
 

Attachments

  • Screen Shot 2015-06-07 at 8.27.58 PM.png
    Screen Shot 2015-06-07 at 8.27.58 PM.png
    100.1 KB · Views: 150
I don't know what is going on, but from the first post I was thinking of applicationDidFinishLaunching that you showed in the second post as a refinement over: "it seems that the problem is in the NSApplicationMain". Anyway, the crash report should be in ~/Library/Logs/DiagnosticReports/.
 
FWIW: Cleaning the build folder is sometimes helpful. Product menu==>Clean. Then hold down option key and select 'Clean Build Folder' on same Product menu.
 
I don't know what is going on, but from the first post I was thinking of applicationDidFinishLaunching that you showed in the second post as a refinement over: "it seems that the problem is in the NSApplicationMain". Anyway, the crash report should be in ~/Library/Logs/DiagnosticReports/.

Its odd. There is no crash report. Here is a screenshot I took of that folder, there is just a finder crash back in May. Strange???

briloronmacrumo:Thanks for that info. I did try to clean it but I never tried to hold down the option key first.
 

Attachments

  • Screen Shot 2015-06-08 at 10.09.38 PM.png
    Screen Shot 2015-06-08 at 10.09.38 PM.png
    103.7 KB · Views: 153
Its odd. There is no crash report. Here is a screenshot I took of that folder, there is just a finder crash back in May. Strange???

Have you rebooted the computer since last crash? This folder is regularly cleaned on reboot, at least for reports that are not sent to Apple. I use a script that opens the latest report in a pager when using Terminal (almost always), although this may have changed in 10.10.

The implication of your position is that the issue is in Apple runtime or frameworks, not your code, on the other hand, not all code crashes on startup in 10.10.
 
Have you rebooted the computer since last crash? This folder is regularly cleaned on reboot, at least for reports that are not sent to Apple. I use a script that opens the latest report in a pager when using Terminal (almost always), although this may have changed in 10.10.

The implication of your position is that the issue is in Apple runtime or frameworks, not your code, on the other hand, not all code crashes on startup in 10.10.

Yes, it's been rebooted. I have 2 hard drives, one with 10.7 which I use for my work editing videos and graphics. Since Apple wants everything to run on the latest OS or IOS and ties Xcode to that I installed a second drive that I use use for programing and only have xcode and photoshop installed on that, So I swap between the 2 depending on what I need to do.

Thanks again for helping me work though it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.