gpt4 book ai didi

ios - 此类对于键 imageView 不符合键值编码

转载 作者:可可西里 更新时间:2023-11-01 03:04:54 26 4
gpt4 key购买 nike

我的应用程序的 RootViewController 有问题。当我运行该应用程序时,出现此错误。这是什么意思?

  NSUnknownKeyException', reason: '[<UIApplication 0x8634010> setValue:forUndefinedKey:]:     this class is not key value coding-compliant for the key bigImageView.'
First throw call stack:
(0x1992012 0x1357e7e 0x1a1afb1 0xe04711 0xd85ec8 0xd859b7 0xdb0428 0x4bc0cc
0x136b663 0x198d45a 0x4babcf 0x4bc98d 0x29eceb 0x29f002 0x29ded6 0x2af315 0x2b024b
0x2a1cf8 0x1dbedf9 0x1dbead0 0x1907bf5 0x1907962 0x1938bb6 0x1937f44 0x1937e1b 0x29d7da 0x29f65c 0x2c6d 0x2b95)
libc++abi.dylib: terminate called throwing an exception

我在 RootViewController.h 中的代码

  #import <UIKit/UIKit.h>


@interface RootViewController : UIViewController <UIGestureRecognizerDelegate>{

}

@property (nonatomic, copy)IBOutlet UIImageView * bigImageView;
@property (nonatomic, assign)BOOL fromRootViewController;


- (void)handleTap:(UITapGestureRecognizer *)recognizer;



@end

我在 RootViewController.m 中的代码

   #import "RootViewController.h"
#import "MenuViewController.h"

@interface RootViewController ()

@end

@implementation RootViewController

@synthesize bigImageView;
@synthesize fromRootViewController;

- (void)viewDidLoad
{
[super viewDidLoad];
UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice]orientation];

if(deviceOrientation == UIInterfaceOrientationPortrait || deviceOrientation== UIInterfaceOrientationPortraitUpsideDown) {
self.bigImageView= [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"milanocina_V.png"]];

}
else if (deviceOrientation== UIInterfaceOrientationLandscapeRight){
self.bigImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"milanocina_O.png"]];

}
else if (deviceOrientation==UIInterfaceOrientationLandscapeLeft){

self.bigImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"milanocina_O.png"]];



}

[self.view addSubview:self.bigImageView];

UITapGestureRecognizer * recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
recognizer.delegate = self;
[self.view addGestureRecognizer:recognizer];

}

RootViewController 最初称为 ViewController,我已经更改了名称。可以与错误相关联吗?我能做些什么?

最佳答案

在某些时候,您设置了一个@property。然后你从你的代码中删除了它,但没有在你的 xib/storyboard 中解开它。您需要在 Storyboard中找到它,右键单击它,然后删除 socket 。

关于ios - 此类对于键 imageView 不符合键值编码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12711280/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com