0
//FirstViewController.m

#import "EighthViewController.h"

EighthViewController *able = [[EighthViewController alloc] initWithNibName:@"EighthViewController" bundle:nil];
able.extra = @"dd"; //ERROR HERE----------------
[self presentViewController:able animated:YES completion:NULL];

//EighthViewController.h
@interface EighthViewController : UIViewController{
NSString *extra;
}

@property (nonatomic) NSString *extra;

Whenever I try and use this code (from here) I get an error in the FirstViewController saying: Property 'extra' not found on object of type 'EighthViewController *'

Community
  • 1
  • 1
user2649355
  • 87
  • 1
  • 5

1 Answers1

0

You should add that:

@property (nonatomic, retain) NSString *extra;

to your EighthViewController.h file. And add the following:

@synthesize extra;

in your EighthViewController.m file. Normally it should work then

Hope it helps

Novarg
  • 7,390
  • 3
  • 38
  • 74