Hello all,
I am getting an error in Xcode that says "whatEverVariable is undeclared" This is happening inside the .m file and also outside of the class itself. I have declared the variable inside the curly braces of the .h file and am using @property and @synthesize to access the variable. However I am getting that above error in the .m file sometimes and even in other classes where I have #imported the class that contains the variable. Am I missing something about Objective-C in general here or what? I guess what I am asking is why would things be undeclared if they are declared.
Also I am getting "button may not respond to "setTitle" as an error as well has this been deprecated or something to "setTitle: forState:" because I am not wanting to use that.
I would post an example but I really think I am missing some obvious thing here. Does anyone have any thoughts on what would cause the errors? Sorry to be so general, but I have to be a moron or something?
This is saying "picturesInArray is undeclared"
#import <Foundation/Foundation.h>
@interface Pictures : NSObject {
NSMutableArray *picturesInArray;
}
@property (nonatomic, retain) NSMutableArray *picturesInArray;
-(IBAction)pictureButtonPressed:(id)sender;
@end
#import "Pictures.h"
@implementation Pictures
@synthesize picturesInArray;
-(IBAction)pictureButtonPressed:(id)sender {
if (pictureIndex >= [picturesInArray count] || pictureIndex < 0) {
pictureIndex = 0;
[imageView setImage:[picturesInArray objectAtIndex:pictureIndex]];
[imageView setNeedsDisplay];
}
}