Ok. so let’s say I want to reproduce :
script myAppDelegate
property parent : class “NSObject”
property theSegmentedControl : missing value – outlet
property theArrayController : missing value – outlet
property theDictionary : missing value – no outlet, just a property to be accessed by all methods
property currentClass : missing value – no outlet, just property
I should declare, in the .h file :
@interface myAppDelegate : NSObject
@property (assign) IBOutlet NSSegmentedControl *theSegmentedControl;
@property (assign) IBOutlet NSArrayController *theArrayController;
@property (assign) NSMutableDictionary *theDictionary;
@property (assign) NSString *currentClass;
@end
and then, in the .m file :
@implementation myAppDelegate
@synthesize theArrayController;
@synthesize theSegmentedControl;
@synthesize theDictionary;
@synthesize currentClass;
And now for coding:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Classes" ofType:@"plist"];
theDictionary = [[NSMutableDictionary alloc] dictionaryWithContentsOfFile: filePath];
// NO: gives no visible @interface for 'NSMutableDictionary declares the selector ‘dictionaryWithContentsOfFile’
theDictionary = [NSMutableDictionary dictionaryWithContentsOfFile: filePath];
// NO: gives EXC_BAD_ACCESS – Bang!
self.theDictionary = [[NSMutableDictionary alloc] dictionaryWithContentsOfFile: filePath];
// NO: gives error no visible @interface.
And of course self.theDictionary = [NSMutableDictionary dictionaryWithContentsOfFile: filePath]; bangs too.
Remember? I’m trying to translate only a working property theDictionary : missing value! Maybe I’m too stupid but I just can’t see yet the advantages of Objective-C. How long did I read on another post? One year?