Tuesday, 3 September 2013

xcode fails to recognise @property but it is correct

xcode fails to recognise @property but it is correct

xcode failing to recognise @ property in detail controller.
.m file of ViewController2:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"showDetail"])
{
NSIndexPath *selectedIndexPath = [[self.collectionView
indexPathsForSelectedItems] objectAtIndex:0];
// load the image.
NSString *imageNameToLoad = [NSString stringWithFormat:@"%d",
selectedIndexPath.row];
NSString *pathToImage = [[NSBundle mainBundle]
pathForResource:imageNameToLoad ofType:@"JPG"];
UIImage *image2 = [[UIImage alloc]
initWithContentsOfFile:pathToImage];
Detail_ViewController_Biffy *detailViewController = [segue
destinationViewController];
Detail_ViewController_Biffy.**image = image;** <--- fails [property
'image'not found on object of type 'detail_ViewController2'
}
}
.h file of detail_view
#import "ViewController.h"
@interface ViewController_Biffy : ViewController
@property (strong, nonatomic) IBOutlet UIImageView *image;
@end
Tried to change the import "ViewController.h" to "ViewController2.h" but
causes more errors.
If you need further info, let me know.

No comments:

Post a Comment