Im getting these weird errors, but I dont understand them. Here are the errors:
error: variable - sized object may not be initialized (#1)
error: statically allocated instance of Objective-C class 'Joke' (#1)
error: statically allocated instance of Objective-C class 'Joke' (#1)
error: cannot convert to a pointer type (# 2)
(Note: The number after the error will indicate where the error was in my implementation file)
Here is my .m file:
#import "Joke.h"
@implementation Joke
@synthesize joke;
@synthesize rating;
- (id)init {
[super init];
return self;
}
- (void)dealloc {
[joke release];
[super dealloc];
}
+ (id)jokeWithValue:(NSString *)joke {
Joke j = [[Joke alloc] init]; // (# 1) This is where #1 errors occurred
j.joke = joke;
return [j autorelease]; // (# 2) This is where #2 errors occurred
}
@synthesize joke;
@synthesize rating;
@end
Thanks!