Coder Social home page Coder Social logo

Comments (5)

Steve423 avatar Steve423 commented on June 15, 2024 1

Here is what worked for me- so far.- I hope this helps someone else
On RadioButton, I select '"Reference outlet" and I had
@Property (weak, nonatomic) IBOutlet UIButton *horsepr;

In *.m code, in viewDidLoad, I call routine which has
...
switch (mychosen){
case 2:{
UIButton *buttonhorse = self.horsepr;
[ buttonhorse setSelected:YES];
} break;
default:.....

from dlradiobutton.

DavydLiu avatar DavydLiu commented on June 15, 2024

Not sure I get the question. You want to show Horse was selected before? I think you need to store this information (which button user selected before) in you controller and set the corresponded button's selected to YES. Hope this helps.

from dlradiobutton.

Steve423 avatar Steve423 commented on June 15, 2024

Example, yesterday user selected "Horse" and "2" was saved in database. Today user will edit record by reading in "2" from database.
How do I store that info( the "2") in my controller and set button "selected" to "YES" so that the screen today will show "Horse" selected , just like "Horse" was selected on yesterday's screen?

from dlradiobutton.

DavydLiu avatar DavydLiu commented on June 15, 2024

This shouldn't be the responsibility of UIControl. However, you can use NSUserDefault to store any persistent value. Please refer to this doc for more information.

from dlradiobutton.

Steve423 avatar Steve423 commented on June 15, 2024

As a newbie, I have already spent several hours on this . A code snippet would be GREAT!

from dlradiobutton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.