I've been racking myself on this one for a while, and can't figure it out.
It is an action sheet that bookmarks a page (for a safari like app) When I hit Okay, i get the -[UIThreePartButton text]: unrecognized selector at instance XXXX
I can't seem to step through where my pain is.
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 0)
{
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Bookmarks" message:@"Please enter the site name: \n \n \n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
alert.center=CGPointMake(160, 50);
alert.tag=1;
UITextField *siteName=[[UITextField alloc]initWithFrame:CGRectMake(20, 70, 245, 30)];
siteName.backgroundColor=[UIColor clearColor];
siteName.borderStyle=UITextBorderStyleRoundedRect;
siteName.autocorrectionType=UITextAutocorrectionTypeNo;
siteName.delegate=self;
siteName.clearButtonMode=UITextFieldViewModeWhileEditing;
siteName.text=[[mainDelegate.sitesArray objectAtIndex:tag] objectForKey:@"webSite"];
siteName.returnKeyType=UIReturnKeyDone;
siteName.tag=2;
[alert addSubview:siteName];
[alert show];
}
}
I realized that it dies on the alert view method below it:
if(alertView.tag==1)
if (buttonIndex==1)
{
if(((UITextField*)[alertView.subviews objectAtIndex:4]).text==@""||((UITextField*)[alertView.subviews objectAtIndex:4]).text==nil)
{
Spefically on the if(((UITextField*)[alertView.subviews objectAtIndex:4])
I have 4 buttons/action on that action sheet, and the rest are good to go...