SIGABRT error - PLEASE HELP - NEEDED URGENTLY

Hello guys pls hep me out, i am new to ios sdk

i am getting a sigabrt error


This is how my app goes:


$ A story board app

$ 1 view controller embedded in a navigation controller

$ 1 TableViewController And 1 more UIViewController

$ When a user clicks button in the first viewcontroller he is pushed to the table view controller

$ 3 Class files (h and m)

$ 1 class file is an object

$2nd class file is table view controller

$ 3rd is UIVIewController


now the problem is that when i click the button in the first viewcontoller i get a sigbrt error telling me that the cell text labeling is wrong and that sigabrt error with a green highlight stays on the code..


I HAVE HIGHLIGHTED THE CODES THAT SHOWS SIGABRT ERROR


My codes:


URL.h

#import <Foundation/Foundation.h>


@interface url : NSObject
@property (nonatomic, strong) NSString *urlstring;
@property (nonatomic, strong) NSString *ns;
@end


url.m:


#import "url.h"

@implementation url
@synthesize urlstring, ns;
@end

load.h;
#import <UIKit/UIKit.h>
#import "url.h"
@interface load : UIViewController
@property (strong, nonatomic) IBOutlet UIWebView *webview;
@property (strong, nonatomic) url *currenturl;
@property (strong, nonatomic) NSString *path;
@property (strong, nonatomic) NSString *finalpath;
@property (strong, nonatomic) NSString *value;
@end

load.m:

#import "load.h"

@interface load ()

@end

@implementation load

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    NSURL *ul = [NSURL URLWithString:[_currenturl urlstring]];
    [self.webview loadRequest:[NSURLRequest requestWithURL:ul]];
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

wwp.h ( wizards of waverly place i am trying to create an app that shows all the episodes)


#import <UIKit/UIKit.h>


#import "url.h"
#import "load.h"
@interface wwp : UITableViewController <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) NSDictionary *seasons;
@property (nonatomic, strong) NSArray *keyseasons;
@property (strong, nonatomic) NSString *path;
@property (strong, nonatomic) NSString *finalpath;
@property (strong, nonatomic) NSString *value;
@end

wwp.m


#import "wwp.h"
#import "url.h"
@interface wwp ()

@end

@implementation wwp
@synthesize seasons, keyseasons;
NSMutableArray *urls;
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    
    
    
    
    if ([segue.identifier isEqualToString:@"showurl"]) {
        load *dvc = [segue destinationViewController];
        NSIndexPath *path = [self.tableView indexPathForSelectedRow];
        url * c = [urls objectAtIndex:path.row];
        [dvc setCurrenturl:c];
        
    }
}
- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    urls = [[NSMutableArray alloc] init];
    url *link = [[url alloc] init];
    [link setUrlstring:@"E1 Crazy Ten Minute Sale"];
    [link setNs:@"E1 Crazy Ten Minute Sale"];
    [urls addObject:link];
    
    link = [[url alloc] init];
    [link setUrlstring:@"E2 First Kiss"];
    [link setNs:@"E2 First Kiss"];
    [urls addObject:link];
    
    link = [[url alloc] init];
    [link setUrlstring:@"E3 I Almost Drowned in a Chocolate Fountain"];
    [link setNs:@"E3 I Almost Drowned in a Chocolate Fountain"];
    [urls addObject:link];
    
    link = [[url alloc] init];
    [link setUrlstring:@"E4 New Employee"];
    [link setNs:@"E4 New Employee"];
    [urls addObject:link];
    
    link = [[url alloc] init];
    [link setUrlstring:@"E5 Disenchanted Evening"];
    [link setNs:@"E5 Disenchanted Evening"];
    [urls addObject:link];
    
    link = [[url alloc] init];
    [link setUrlstring:@"E6 You Can't Always Get What You Carpet"];
    [link setNs:@"E6 You Can't Always Get What You Carpet"];
    [urls addObject:link];
    
    link = [[url alloc] init];
    [link setUrlstring:@"E7 Alex's Choice"];
    [link setNs:@"E7 Alex's Choice"];
    [urls addObject:link];
    
    link = [[url alloc] init];
    [link setUrlstring:@"E8 Curb Your Dragon"];
    [link setNs:@"E8 Curb Your Dragon"];
    [urls addObject:link];
    
    
    NSString *myfile = [[NSBundle mainBundle] pathForResource:@"SeasonWowp" ofType:@"plist"];
    
    seasons = [[NSDictionary alloc] initWithContentsOfFile:myfile];
    keyseasons = [seasons allKeys];
    

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{

    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

    // Return the number of rows in the section.
    return [seasons count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
    if (nil == cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    url *current = [urls objectAtIndex:indexPath.row];
    [cell.textLabel setText:[current ns]];

    
    return cell;
}

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    }   
    else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Navigation logic may go here. Create and push another view controller.
    /*
     <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
     // ...
     // Pass the selected object to the new view controller.
     [self.navigationController pushViewController:detailViewController animated:YES];
     */
}

@end

iPad 2, iOS 6.0.2

Posted on Jan 26, 2013 7:14 AM

Reply
5 replies

Jan 26, 2013 7:42 AM in response to msuper69

User uploaded fileSorry my mistake,


i didnt intend to highlight it all... happened by mistake... before publishing the post i had the actuall thing highlighted and now its not any ways this the code that shows the error: ( the one which is Bolded,Italiced ,Underlined)



wwp:


#import "wwp.h"#import "url.h"@interface wwp ()
@end
@implementation wwp
@synthesize seasons, keyseasons;
NSMutableArray *urls;
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {




if ([segue.identifier isEqualToString:@
"showurl"]) {
load *dvc = [segue destinationViewController];
NSIndexPath *path = [self.tableView indexPathForSelectedRow];
url * c = [urls objectAtIndex:path.row];
[dvc setCurrenturl:c];

}
}
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
urls = [[NSMutableArray alloc] init];
url *link = [[url alloc] init];
[link setUrlstring:@
"E1 Crazy Ten Minute Sale"];
[link setNs:@
"E1 Crazy Ten Minute Sale"];
[urls addObject:link];

link = [[url alloc] init];
[link setUrlstring:@
"E2 First Kiss"];
[link setNs:@
"E2 First Kiss"];
[urls addObject:link];

link = [[url alloc] init];
[link setUrlstring:@
"E3 I Almost Drowned in a Chocolate Fountain"];
[link setNs:@
"E3 I Almost Drowned in a Chocolate Fountain"];
[urls addObject:link];

link = [[url alloc] init];
[link setUrlstring:@
"E4 New Employee"];
[link setNs:@
"E4 New Employee"];
[urls addObject:link];

link = [[url alloc] init];
[link setUrlstring:@
"E5 Disenchanted Evening"];
[link setNs:@
"E5 Disenchanted Evening"];
[urls addObject:link];

link = [[url alloc] init];
[link setUrlstring:@
"E6 You Can't Always Get What You Carpet"];
[link setNs:@
"E6 You Can't Always Get What You Carpet"];
[urls addObject:link];

link = [[url alloc] init];
[link setUrlstring:@
"E7 Alex's Choice"];
[link setNs:@
"E7 Alex's Choice"];
[urls addObject:link];

link = [[url alloc] init];
[link setUrlstring:@
"E8 Curb Your Dragon"];
[link setNs:@
"E8 Curb Your Dragon"];
[urls addObject:link];


NSString *myfile = [[NSBundle mainBundle] pathForResource:@
"SeasonWowp" ofType:@"plist"];

seasons = [[NSDictionary alloc] initWithContentsOfFile:myfile];
keyseasons = [seasons allKeys];

// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [seasons count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @
"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

if (nil == cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
url *current = [urls objectAtIndex:indexPath.row];
[cell.textLabel setText:[current ns]];

return cell;
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Navigation logic may go here. Create and push another view controller.
/*
<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@
"<#Nib name#>" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
*/
}
@end

Jan 26, 2013 9:00 AM in response to coeesavvy

The report is telling you what's up. The array bounds are 0-7 and in tableView you're trying to access cell 8 and it of course doesn;t exist.


Most likely in the code that was added to the working code you misconfigured this array. Or thought you increased its size but didn't. Where is urls configured? Start there.


It's very hard trying to debug code like this outside of Xcode. Reading the source is not easy. Really if you had working code and you added to it and it stopped working you need to go through the added code looking for your mistake.


regards

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

SIGABRT error - PLEASE HELP - NEEDED URGENTLY

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.