yunhui huang
yunhui huang

Reputation: 1

ios 6 and Xcode 4.5 signal SIGABRT

I am facing an issue which I have tried to resolve but am yet to find a solution. I am using Xcode4.5 and iOS 6.This is my code:

viewController.h file:

#import <UIKit/UIKit.h></i>
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UISegmentedControl *colorChoice;
@property (weak, nonatomic) IBOutlet UIWebView *flowerView;
@property (weak, nonatomic) IBOutlet UIWebView *flowerDetailView;

   - (IBAction)toggleFlowerdetail:(id)sender;
   - (IBAction)getFlower:(id)sender;

 @end

viewController.m files

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

   - (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
   }

- (IBAction)toggleFlowerdetail:(id)sender {
    self.flowerDetailView.hidden = [sender isOn];
}

- (IBAction)getFlower:(id)sender {
    NSURL *imageURL;
    NSURL *detailURL;
    NSString *imageURLString;
    NSString *detailURLString;
    NSString *color;
    int sessionID;

    color = [self.colorChoice titleForSegmentAtIndex:self.colorChoice.selectedSegmentIndex];
    sessionID = random()%50000;

    imageURLString = [[NSString alloc]    initWithFormat:@"http://floraphotographs.com/showrandomios.php?color=%@&session=%d",color,sessionID];
    detailURLString = [[NSString alloc] initWithFormat:@"http://www.floraphotographs.com/details.php?session=%d",sessionID ];

    imageURL = [[NSURL alloc]initWithString:imageURLString];
    detailURL = [[NSURL alloc]initWithString:detailURLString];

    [self.flowerView loadRequest:[NSURLRequest requestWithURL:imageURL]];
    [self.flowerDetailView loadRequest:[NSURLRequest requestWithURL:detailURL]];

    self.flowerDetailView.backgroundColor = [UIColor clearColor];
}

@end

My Error:

FlowerWeb[4784:11303] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key detail.'

Any Help will appreciated. Thanks

Upvotes: 0

Views: 106

Answers (2)

footyapps27
footyapps27

Reputation: 4042

Check your xib. This might be because you accidentally removed an IBOutlet object while it was still attached to your xib file.

Check out this post as well:-

Upvotes: 0

Dev
Dev

Reputation: 363

In storyboard, check your view controller, it is connected to a property called detail.

But that property is being removed in that view controller class.

Upvotes: 1

Related Questions