У меня есть переменная
@property (strong, nonatomic) id dataObject;
Это указатель на UIImage
.Я хочу отправить его в мою новую переменную.
@property (nonatomic, retain) UIImage *theImage;
Когда я пытаюсь это сделать, приложение вылетает с этой ошибкой: unrecognized selector sent to instance 0x68423b0
Как мне отправить его в мою новуюпеременная?Заранее спасибо.
contentViewController.h:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "pageAppViewController.h"
@class pageAppViewController;
@interface ViewController : UIViewController
{
NSArray *content;
UIImageView *theImageView;
UIImage *theImage;
}
@property (strong, nonatomic) IBOutlet UIImageView *theImageView;
@property (strong, nonatomic) id dataObject;
@property (nonatomic, retain) UIImage *theImage;
@end
contentViewController.m:
#import "ViewController.h"
#import "pageAppViewController.h"
@implementation ViewController
@synthesize theImageView, dataObject;
@synthesize theImage;
- (void) viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
//this is the line that is causing the problems.
theImage = dataObject;
theImageView = [[UIImageView alloc] initWithImage: theImage];
[self.view addSubview:theImageView];
}
@end