I have a button that creates a subclass of a UIAlertView. The first time I run it, the animation is very jerky. The second, third, etc. times I use it, it's nice and smooth.
I was curious, how can I remedy the jerkiness from the first time it opens?
Here's the methods (the first UIAlertView loads fine every time, it's the subclass one in the else statements that's an issue.)
And here's the quickAddController init method...
Suggestions?
I was curious, how can I remedy the jerkiness from the first time it opens?
Here's the methods (the first UIAlertView loads fine every time, it's the subclass one in the else statements that's an issue.)
Code:
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
quickAddController = [[QuickAddController alloc] initWithTitle:@"Add Assignment" message:@"\n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Add", nil];
quickAddController.classes = classes;
quickAddController.mostRecentClass = mostRecentClass;
[quickAddController reflectMostRecentClass];
[quickAddController show];
[quickAddController release];
}
And here's the quickAddController init method...
Code:
- (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ...
{
if (self = [super initWithTitle:@"Add Assignment" message:@" \n \n \n " delegate:(id)delegate cancelButtonTitle:@"Cancel" otherButtonTitles:@"Add", nil])
{
// New Assignment Name
addAssignmentName = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 55.0, 260.0, 31.0)];
addAssignmentName.borderStyle = UITextBorderStyleRoundedRect;
addAssignmentName.autocapitalizationType = UITextAutocapitalizationTypeWords;
addAssignmentName.autocorrectionType = UITextAutocorrectionTypeNo;
addAssignmentName.placeholder = @"New Assignment Name";
[self addSubview:addAssignmentName];
[addAssignmentName addTarget:self action:@selector(selectName:) forControlEvents:UIControlEventTouchDown];
[addAssignmentName becomeFirstResponder];
[addAssignmentName release];
// New Assignment Class Name
addAssignmentClass = [UIButton buttonWithType:UIButtonTypeRoundedRect];
addAssignmentClass.frame = CGRectMake(12.0, 94.0, 126.0, 37.0);
addAssignmentClass.backgroundColor = [UIColor clearColor];
addAssignmentClass.titleLabel.lineBreakMode = UILineBreakModeTailTruncation;
addAssignmentClass.titleLabel.adjustsFontSizeToFitWidth = YES;
addAssignmentClass.titleLabel.minimumFontSize = 10.0;
[addAssignmentClass addTarget:self action:@selector(selectClass:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:addAssignmentClass];
// New Assignment Due Date
addAssignmentDueDate = [UIButton buttonWithType:UIButtonTypeRoundedRect];
addAssignmentDueDate.frame = CGRectMake(146.0, 94.0, 126.0, 37.0);
[addAssignmentDueDate setTitle:@"Select Date Due" forState:UIControlStateNormal];
addAssignmentDueDate.backgroundColor = [UIColor clearColor];
[addAssignmentDueDate addTarget:self action:@selector(selectDate:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:addAssignmentDueDate];
[self setTransform:CGAffineTransformMakeTranslation(0.0, 85.0)];
}
return self;
}
Suggestions?