这里是InformacionViewController.h:
#import <UIKit/UIKit.h>
#import "LibrosFenomenales.h"
@interface InformacionViewController : UIViewController
@property (strong, nonatomic) IBOutlet UILabel *nombre;
@property (strong, nonatomic) IBOutlet UILabel *autor;
@property (strong, nonatomic) IBOutlet UILabel *año;
@property (strong, nonatomic) IBOutlet UILabel *genero;
@property (strong, nonatomic) IBOutlet UITextView *argumento;
@property (strong, nonatomic) IBOutlet UIImageView *portada;
@property LibrosFenomenales *libroSeleccionado;
@end
这里是ViewController.m:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
InformacionViewController *informacionViewController = [self.storyboard
instantiateViewControllerWithIdentifier:@"InformacionViewController"];
UINavigationController *navigationController = [[UINavigationController alloc]
initWithRootViewController:informacionViewController];
informacionViewController.libroSeleccionado = [_libros objectAtIndex:indexPath.row];
[self presentViewController:navigationController animated:YES completion:nil];
}
Xcode 向我显示此错误:在“InformacionViewController”类型的对象上找不到属性“libroSeleccionado”。
这是行:informacionViewController.libroSeleccionado = [_libros objectAtIndex:indexPath.row];
我做错了什么?
谢谢
最佳答案
您只需首先清理构建,而不是退出 Xcode。要清理构建,请按 command+Shift+K。然后运行该应用程序,如果它不起作用,那么试试这个 @property (strong, nonatomic) LibrosFenomenales *libroSeleccionado; 而不是@property LibrosFenomenales *libroSeleccionado;
关于ios - 关于 Property not found Xcode 5 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24434106/