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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:01:07+00:00 2026-06-07T12:01:07+00:00

I am creating a program in the iOS SDK in which there is a

  • 0

I am creating a program in the iOS SDK in which there is a group of buttons. When a button is clicked, its title is added to an array, and the array is displayed in an assigned label.

When I try to create delete and clear buttons, error messages show up. They show up in the function_builder = function_builder.removeLastObject; and function_builder = function_builder.removeAllObjects; lines of the .m file. The error messages are the same: Assigning to ‘NSMutableArray *_strong’ from incompatible type ‘void’. How do I fix this?
Thank you for any and all help

Here is the .h file:

#import <UIKit/UIKit.h>

@interface SecondViewController : UIViewController
@property (nonatomic,strong) IBOutlet UILabel *equation_field;
@property (nonatomic) NSMutableArray *function_builder;//declare array//
@property(nonatomic, readonly, retain) NSString *currentTitle;//declare button titles//
@end

And here is the .m file:

#import "SecondViewController.h"

@interface SecondViewController ()

@end

@implementation SecondViewController
@synthesize equation_field;
@synthesize currentTitle;
@synthesize function_builder;
NSMutableArray *function_builder;//create the array name//

- (IBAction)functionButtonPress:(UIButton *)sender {//code for all buttons except delete    and clear//
[function_builder addObject: sender.currentTitle];//when button is pressed, its title is added to the array//
self.equation_field.text = function_builder.description;//the contents of the array appear in the assigned label//
}
- (IBAction)delete:(UIButton *)sender {//create delete button//
function_builder = function_builder.removeLastObject; //ERROR OCCURRING HERE: Assigning to 'NSMutableArray *_strong' from incompatible type 'void'//
}

- (IBAction)clear:(UIButton *)sender{//create clear button//
function_builder = function_builder.removeAllObjects;//ERROR OCCURRING HERE: Assigning to 'NSMutableArray *_strong' from incompatible type 'void'//
}



- (void)viewDidLoad {

function_builder = [[NSMutableArray alloc] init];//initialize array//



[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
    return YES;
}
}

@end
  • 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-07T12:01:10+00:00Added an answer on June 7, 2026 at 12:01 pm

    Many errors there..

    You’ve assigned the results of this methods (void*) to function_builder which is of kind NSMutableArray. That makes no sense.

    In order to manipulate an object, just send a message to it:

    [function_builder removeLastObject]; // this will remove the last object of the array
    [function_builder removeAllObjects]; // guess what ;)
    

    For the other thing:

    self.equation_field.text = [function_builder componentsJoinedByString:@", "]
    

    This will create a string with all objects in array separated by “, ” => A, B, C, D

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

Sidebar

Related Questions

I'm creating a program which goes through data in a array and filter outs
When creating an iOS program is there any performance hit if I pass around
I creating a program which send newsletter with a background image. It works fine
I am creating a program which has an installer-like interface. Is it better to
In a program I am creating for iOS 5, I am experiencing unexpected behavior
I am creating a program using wxpython which entails the need to create many
I am creating a program which can send test or data to Bluetooth devices.
I am creating a program in c++, which I want to be able to
I'm creating a program which follows certain rules to result in a count of
I'm creating a program using C# and I have lots of textbox and buttons.

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.