Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
I found my mistake and such a stupid one to make. I declared my ivars in the wrong area and forgot to use brackets {}. it works. funny how I struggle with it for hours and then as soon as I post for help I discover the answer!

Sorry.


I have not seen this before? I checked the spelling of all of my instance variables and I get this error message for all of the instance variables.
Synthesized property 'name' must either be named the same as a compatible ivar or must explicitly name an ivar

Header file
Code:
#import <Foundation/Foundation.h>
NSString *name;
NSNumber *size;
NSString *location;
NSString *date;
NSImage *image;

@interface Item : NSObject

@property (copy) NSString *name;
@property (copy) NSString *size;
@property (copy) NSString *location;
@property (copy) NSString *date;
@property (copy) NSImage *image;

@end

.m
Code:
#import "Item.h"

@implementation Item
@synthesize name;
@synthesize size, location, date, image;

@end
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.