Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6929423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:18:58+00:00 2026-05-27T11:18:58+00:00

well, i’m making an app from a UiWebView example i found. and i needed

  • 0

well, i’m making an app from a UiWebView example i found. and i needed to add a button but the way this example works is similar to phonegap so i figured out i need to add the button as a subview to the window, so then i got my button and set it up for pressing but when ever i press it my app crashes… can any one help? here is my code snippet:

- (void)webViewDidFinishLoad:(UIWebView *)webView{
    myLoadingLabel.hidden = YES;
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
    [window addSubview:webView];
//my button
    UIButton *playButton = [[UIButton buttonWithType:UIButtonTypeCustom] retain];
    playButton.frame = CGRectMake(122, 394, 76, 76);
    [playButton setTitle:@"Play" forState:UIControlStateNormal];
    playButton.backgroundColor = [UIColor clearColor];
    [playButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal ];
    UIImage *buttonImageNormal = [UIImage imageNamed:@"mic.png"];
    UIImage *strechableButtonImageNormal = [buttonImageNormal stretchableImageWithLeftCapWidth:12 topCapHeight:0];
    [playButton setBackgroundImage:strechableButtonImageNormal forState:UIControlStateNormal];
    UIImage *buttonImagePressed = [UIImage imageNamed:@"mic.png"];
    UIImage *strechableButtonImagePressed = [buttonImagePressed stretchableImageWithLeftCapWidth:12 topCapHeight:0];
    [playButton setBackgroundImage:strechableButtonImagePressed forState:UIControlStateHighlighted];
    [playButton addTarget:self action:@selector(playAction:) forControlEvents:UIControlEventTouchUpInside];
    [window addSubview:playButton];
}

-(void)playAction {
    NSLog(@"Button Pressed!");
}

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIWebView_ExampleAppDelegate playAction:]:

oh and i know its a long shot, but i need this button outside of the webpage because it needs to start recording audio when clicked, then when clicked again it needs to stop recording and save, run a command with system();, and then put the data gotten from the system command into the uiwebview to be used… so yea if anyone knows some code i would appreciate it greatly, and its a jailbreak app so the system command will be ok. Thanks!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:18:59+00:00Added an answer on May 27, 2026 at 11:18 am

    You are invoking a method named playAction: but you implement a method named playAction. Mind the missing colon. The crash most likely is related to that issue.

    For a quick fix, change

    [playButton addTarget:self action:@selector(playAction:) forControlEvents:UIControlEventTouchUpInside];
    

    to

    [playButton addTarget:self action:@selector(playAction) forControlEvents:UIControlEventTouchUpInside];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well, it seems simple enough, but I can't find a way to add a
Well friends, I have got this query which works but is very long for
Well im new to javascript but why does this not work, all i want
Well the problem is that I have this enum, BUT I don't want the
well in my UIkit app I used this code: boxPath = CGPathCreateMutable(); CGPathMoveToPoint(boxPath, nil,
Well, this is my first post here and really enjoying the site. I have
Well... simple question, right? But with no so simple answers. In firefox i use
Well this is incredibly frustrating. After being nagged by Rails that I need to
well i have this messages table with sample values like these: msg_id recipient_id read
Well I'm making an program about payrolls and I'm stuck. In the program, after

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.