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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:10:36+00:00 2026-05-16T07:10:36+00:00

I want to add a bool to change a value îs favorite every time

  • 0

I want to add a bool to change a value îs favorite every time a button Is clicked. If the button is clicked in a different controller I want to add an object to an array. What I’m asking is how to add the code to the first controller to change the bool value. This is my first time working with a bool so If someone mentioned where to reference the bool in the header that would be appreciated.

  • 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-16T07:10:37+00:00Added an answer on May 16, 2026 at 7:10 am

    Um… So you want to know how to change a BOOL from true to false to true again every time a UIButton (button) is clicked? You should probably read up on programming then on the iPhone if this is your very first time working with a BOOL. But, what you need to do is set up an IBAction (for touch up inside) most likely. And then write in the code:

    -(IBAction) didClickTehButton
    {
        if(myBool == NO)//Equiv to false
        {
            myBool = YES;//Equiv to true
        }
        else {
            myBool = NO;//Equiv to false
        }
    }
    

    EDIT: Actually on second reading you want to do something if the button is pressed. For this all you need to do is set up an IBAction and connect to your button (probably touch up inside) and then do whatever you want in there.

    -(IBAction)buttonIsClicked
    {
        [yourNSMutableArryHere addObject:anObject];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to implement that when a textbox value is changed, my Add button
I want to add a new property bool IsValid to my class below. I
I want add label to every row in tableview at right side of the
I have a situation when I want to change the selected value of a
I want to add metadata to my object graph for non-domain type data that
I want add UIGestureRecognizerDelegate to UIWebView,but failed. if [self.view addsubView:webView]; So UIWebView is ok,but
I want add new Feed item on entity persist and update. I write this
I want add my custom sidebar next right column all page. Please check this
I have a website built with ASP.NET (3.5) and want add some level of
I have a list of string values that I want add to a hashtable

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.