Reputation: 103
I'm trying to create a simple iPhone app but I get an error in it.
This is the code inside main.m class
//
// main.m
// Calculator
//
// Created by Author on 27/11/2012.
// Copyright (c) 2012 Ben Allinson. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CalculatorAppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([CalculatorAppDelegate class]));
}
}
However I get an error on the following line saying "Thread 1: Signal SIGBART"
return UIApplicationMain(argc, argv, nil, NSStringFromClass([CalculatorAppDelegate class]));
Any help will be appreciated, Thank You :)
Upvotes: 1
Views: 443
Reputation: 2278
Use the Xcode debugger on your CalculatorAppDelegate.
The point at which the Mac (or an iDevice) crashes quite commonly is not where the bug actually occurred, it's just where the problem is detected.
If you're not experienced with the debugger yet, use NSLog to print "Got here" messages at the entry points to all your methods:
- (int) foo: (long) bar
{
@NSLog( @"foo:" );
...
}
You might need to enable the debugging console in Xcode.
I recommend the book "Debugging C" by Robert Ward. There is a second edition with a somewhat different title that I have not read, but expect is good. He talks all about how debuggers work, also about being methodical when tracking down bugs.
Upvotes: 1