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 6133489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:14:07+00:00 2026-05-23T17:14:07+00:00

I have two buttons that are not performing the IBAction that they are programmed

  • 0

I have two buttons that are not performing the IBAction that they are programmed to do. I have them correctly connected in Interface Builder, but when I click them in the simulator or on a phone, they do not perform their task. No crashes, nothing. Here is my code

MapDetailInfo.h:

@interface MapDetailInfo : UIViewController {

IBOutlet UILabel *name;
IBOutlet UITextView *address;
NSString * nameText;
NSString * addressText;
NSString * stringOne;
NSString * stringTwo;


IBOutlet UILabel *phoneNumber;

}

@property (retain, nonatomic) IBOutlet UILabel *name;
@property (retain, nonatomic) IBOutlet UITextView *address;
@property (nonatomic, copy) NSString * nameText;
@property (nonatomic, copy) NSString * addressText;
@property (retain, nonatomic)  NSString * stringOne;
@property (retain, nonatomic)  NSString * stringTwo;
@property (retain, nonatomic) IBOutlet UILabel *phoneNumber;

- (IBAction)callPhone:(id)sender;
- (IBAction)getDirections:(id)sender; 


@end

MapDetailInfo.m:

@implementation MapDetailInfo
@synthesize name, address, nameText, addressText, phoneNumber, stringTwo, stringOne;
- (void)viewDidLoad
{
[super viewDidLoad];
NSArray *myWords = [addressText componentsSeparatedByCharactersInSet:
                    [NSCharacterSet characterSetWithCharactersInString:@"("]
                    ];

stringOne = [myWords objectAtIndex:1];
stringTwo = @"("; 


stringTwo = [stringTwo stringByAppendingString:stringOne];


self.name.text = nameText;
self.address.text = [myWords objectAtIndex:0];
self.phoneNumber.text = stringTwo; 

  UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self 
           action:@selector(callPhone:)
 forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"Call Shop" forState:UIControlStateNormal];
button.frame = CGRectMake(104.0, 332.0, 160.0, 40.0);
[self.view addSubview:button];


}


- (IBAction)callPhone:(id)sender {

NSString *URLString = [@"tel://" stringByAppendingString:stringTwo];

NSURL *URL = [NSURL URLWithString:URLString];

[[UIApplication sharedApplication] openURL:URL];
}

- (IBAction)getDirections:(id)sender {
 [[UIApplication sharedApplication] openURL:
 [NSURL URLWithString:[NSString stringWithFormat:@"http://maps.google.com/maps?saddr=Current    Location&daddr=%@",self.address.text]]];    
}

I am pulling this view from an annotation in a map. Everything works perfect accept for these two buttons not performing their task. Any help would be much appreciated. 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-23T17:14:08+00:00Added an answer on May 23, 2026 at 5:14 pm

    The reason the buttons were not working is because the URL’s were incorrect. If you run into the same problem, make sure your telephone number URL’s are:

    @"tel://5555555"
    

    I had the parenthesis and dash inside of mine and that is why it would not pull up. Also there was an error in my google URL.

    Thanks!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two radio buttons on my MVC form that I use to hide
I have a form that has two buttons on it, one yes, one no,
I have a menu bar that is rotated slightly. Here are two buttons as
I have two buttons that increment and decrement a value by one with each
I have two buttons, and need to link them with a line. I bind
I have two toggle buttons that I want to link together so that pressing
I have two buttons on a widget that change some items in a widget,
Suppose I have two buttons that are ivar outlets. One is called Blue and
I have a view that has a navigationController with two buttons, START (essentially a
I have two select lists that each display users and two buttons (add and

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.