2014-10-01 85 views
0

我正面临一个我试图解决的问题,但我尚未找到解决方案。我使用Xcode4.5和iOS 6。这是我的代码:ios 6和Xcode 4.5信号SIGABRT

viewController.h文件:

#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文件

#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 

我的错误:

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.'

任何帮助将不胜感激。谢谢

回答

1

storyboard,检查您的view controller,它连接到一个名为属性详细

但是该属性正在被view controller类中删除。

0

检查您的xib。这可能是因为您不小心删除了一个IBOutlet对象,但该对象仍然与您的xib文件相关联。

看看这个post以及: -