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

  • Home
  • SEARCH
  • 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 8850223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:51:06+00:00 2026-06-14T12:51:06+00:00

I have first 4 ImageViews with 4 UIButtons under them so the user can

  • 0

I have first 4 ImageViews with 4 UIButtons under them so the user can change the background picture. That works perfectly. But then I have 4 UIButtons ON the ImageViews which should call phone numbers. When I run it it doesnt seems to call the button because nothing happens when I click it. Here is my code:

#import "ViewController.h"

@interface ViewController ()
{
UIImagePickerController *imagePickerController;
UIImagePickerController *imagePickerController2;
UIImagePickerController *imagePickerController3;
UIImagePickerController *imagePickerController4;
}

@end

@implementation ViewController
@synthesize firstImageView, secondImageView, thirdImageView, fourthImageView;
- (void)viewDidLoad
{
[super viewDidLoad];

}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];

}

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image1 = [info objectForKey:UIImagePickerControllerOriginalImage];

NSData *data = UIImagePNGRepresentation(image1);
NSString *myGrabbedImage = @"myGrabbedImage.png";
NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentDirectory = [path objectAtIndex:0];
NSString *fullPathToFile = [documentDirectory stringByAppendingPathComponent:myGrabbedImage];

[data writeToFile:fullPathToFile atomically:YES];

if (picker == imagePickerController) {
    [[self firstImageView]setImage:image1];
} else if (picker == imagePickerController2) {
    [[self secondImageView]setImage:image1];
} else if (picker == imagePickerController3) {
    [[self thirdImageView]setImage:image1];
} else {
    [[self fourthImageView]setImage:image1];
}

[self dismissViewControllerAnimated:YES completion:nil];

}

- (IBAction)firstChangeButton:(id)sender
{
imagePickerController = [[UIImagePickerController alloc]init];
[imagePickerController setDelegate:self];
[imagePickerController setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[self presentViewController:imagePickerController animated:YES completion:nil];

}
- (IBAction)secondChangeButton:(id)sender
{
imagePickerController2 = [[UIImagePickerController alloc]init];
[imagePickerController2 setDelegate:self];
[imagePickerController2 setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[self presentViewController:imagePickerController2 animated:YES completion:nil];

}
- (IBAction)thirdChangeButton:(id)sender
{
imagePickerController3 = [[UIImagePickerController alloc]init];
[imagePickerController3 setDelegate:self];
[imagePickerController3 setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[self presentViewController:imagePickerController3 animated:YES completion:nil];

}
- (IBAction)fourthChangeButton:(id)sender
{
imagePickerController4 = [[UIImagePickerController alloc]init];
[imagePickerController4 setDelegate:self];
[imagePickerController4 setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[self presentViewController:imagePickerController4 animated:YES completion:nil];

}



- (IBAction)callFirst:(id)sender
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:0739421700"]];
}

- (IBAction)callSecond:(id)sender
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:073942100"]];
}

- (IBAction)callThird:(id)sender
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:0739421700"]];
}

- (IBAction)callFourth:(id)sender
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:0739421700"]];

}
@end

Whats wrong?

  • 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-06-14T12:51:07+00:00Added an answer on June 14, 2026 at 12:51 pm

    I’m going to assume you are testing this on the iOS simulator, which will not work. This code will only work on a real iOS device.

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

Sidebar

Related Questions

i have 20 imageviews with background image set. When user clicks on one image
I have a model that holds user address. This model has to have first_name
I have a first table view and a segue that pushes to another table
I have a relative layout with 3 ImageViews. The first one is a square
I have a screen that has a few images and one of them has
I have first: select url from urls where site = '$value' order by url
I have first names stored in one table and last names stored in another.
Bascially you have first to do a: SurfFeatureDetector surf(400); surf.detect(image1, keypoints1); And then a:
I have Depth first searching algorithm whose pseudo code is given below: DFS(Vertex v)
I have my first ever interview for a Java developer role, specifically RMI, Serverlets

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.