Was mache ich falsch? Mein Code stürzt ab, wenn ich versuche, das Array zu protokollieren. Hier ist meine Klasse:
@interface ArrayTestAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
NSArray *array;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) NSArray *array;
-(IBAction)buttonPressed;
@end
@implementation ArrayTestAppDelegate
@synthesize window, array;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
array = [NSArray arrayWithObjects:@"Banana", @"Apple", @"Orange", @"Pear", @"Plum", nil];
[window makeKeyAndVisible];
}
-(IBAction)buttonPressed {
NSLog(@"%@", array);
}
- (void)dealloc {
[window release];
[array release];
[super dealloc];
}
@end