i need to build an application that define an array that should be made of image items. every image iten has an image, a name and a photographer name. i build my image item class and i want you to check if my define is correct and good(i just start to learn objective c). i want you to emphasize on the set's methods.
here is the photoitem.h:
#import <Foundation/Foundation.h>
@interface photoItem : NSObject
{
UIImage *imageView;
NSString *photoNameLabel;
NSString *photographerNameLabel;
UIButton *viewPhoto;
}
@property(readonly) NSString *name;
@property(readonly) NSString *nameOfPhotographer;
@property(readonly) UIImage *imageItem;
-(id)makePhotoItemWIthPhoto:(UIImage*)image name:(NSString*)photoName photographer: (NSString*)photographerName;
@end
here is my photoitem.m:
#import "photoItem.h"
@implementation photoItem
@synthesize name;
@synthesize nameOfPhotographer;
@synthesize imageItem;
-(id)makePhotoItemWIthPhoto:(UIImage*)image name:(NSString*)photoName photographer:(NSString*)photographerName
{
[self setName:photoName];
[self setNameOfPhotographer:photographerName];
[self setImageItem:image];
return self;
}
-(void) setName:(NSString *)name
{
photoNameLabel = name;
}
-(void) setNameOfPhotographer:(NSString *)nameOfPhotographer
{
photographerNameLabel = nameOfPhotographer;
}
-(void)setImageItem:(UIImage *)imageItem
{
imageView = imageItem;
}
@end
i hope you could fix my errors(if there are some). thanks.