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
@interface url : NSObject@property (nonatomic, strong) NSString *urlstring;@property (nonatomic, strong) NSString *ns;@end
url.m:
#import "url.h"@implementation url@synthesize urlstring, ns;@endload.h;#import #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 #import "url.h"#import "load.h"@interface wwp : UITableViewController @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
0 comments:
Post a Comment