Please refer to below code.
#import "RecipeDetail.h"
#import "Recipe.h"
@implementation RecipeDetail
@synthesize recipeLabel;
@synthesize recipeName;
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = recipe.name;
self.prepTimeLabel.text = recipe.prepTime;
self.recipePhoto.image = [UIImage imageNamed:recipe.imageFile];
NSMutableString *ingredientText = [NSMutableString string];
for (NSString* ingredient in recipe.ingredients) {
[ingredientText appendFormat:@"%@\n", ingredient];
}
self.ingredientTextView.text = ingredientText;
}
you alloc you class object in
viewDidLoadmethod like this.then after you can use recipe object like that.