First of all, I think creating 153,600 labels is likely to run the iPhone out of memory.
Second, CGRectMake is a function, not a message call, so should not be in brackets.
Third, Fill_ScreenAppDelegate is a class, not an object, which means it only responds to + messages, not - messages (hence the warning). Use the special name self to send a message to the current object.
Fourth, you should never call dealloc, you call release. The framework calls dealloc when it determines there are no more references to the released object to actually return memory.
Fifth, you don't need instance variables for frame and label since you are just using them locally in methods.
Sixth, you are resetting xx to one every time through your while loop on xx which means you won't get anywhere.
Attached is code that may compile (untested) but wouldn't bet on running:
Code:
#import "Fill_ScreenAppDelegate.h"
@implementation Fill_ScreenAppDelegate
@synthesize window;
- (void)addPixel:(CGRect) frame {
UILabel *label = [[UILabel alloc] initWithFrame:frame];
[window addSubview:label];
[label release];
}
- (void)applicationDidFinishLaunching:(UIApplication*) application {
int xx, yy;
for (yy = 0; yy < 480; ++yy) {
for (xx = 0; xx < 320; ++xx) {
CGRect frame = CGRectMake(xx, yy, 1, 1);
[self addPixel:frame];
}
}
[window makeKeyAndVisible];
}
- (void)dealloc {
[window release];
[super dealloc];
}
@end