I have a slight problem with an app I would like some help with. I've searched the web and found some similar problems but they're not entirely answering my own problem.
I want to create 42 buttons and print them out in a "calendar way". It's not suppose to be a calendar but the appearance reminds of it. I tried out this Create a for loop to add 39 buttons to an array
But I could't figure out how to make it do exactly what I want.
I've also experimented with this:
NSMutableArray *buttons = [NSMutableArray array];
for( int i = 0; i < 5; i++ ) {
UIButton* aButton = [UIButton buttonWithType:UIButtonTypeCustom];
aButton.backgroundColor = [UIColor redColor];
aButton.frame = CGRectMake(10, (i+1)*60, 60, 40);
[aButton setTag:i];
[buttons addObject:aButton];
[aButton addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:aButton];
}
And it's on the right way but I just can't figure out how to get the look I want. Here the look I'm after, but the numbeers will range from 1 to 42: http://nebulon.se/images/question_img.png