Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Objective-C and Swift
  4. In objective-c I’m try to create a statement that toggles a variable

In objective-c I’m try to create a statement that toggles a variable

Scheduled Pinned Locked Moved Objective-C and Swift
swiftdatabase
2 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11216982
    wrote on last edited by
    #1

    In objective-c I’m try to create a statement that toggles a variable that switches between two numbers with a UIswitch controller (a * b/w * r) c * h; r needs to trigger two different numbers when on needs to = .73 when off needs to = .66 int a=1; int b=5.14; int c = -.015; int w =1; int r =.73;// on=.73 and off= .66 int h=1; int result; result = (a * b/w * r) c * h; NSLog (@"a*b/w*r)c*h;"); Is this possible

    L 1 Reply Last reply
    0
    • U User 11216982

      In objective-c I’m try to create a statement that toggles a variable that switches between two numbers with a UIswitch controller (a * b/w * r) c * h; r needs to trigger two different numbers when on needs to = .73 when off needs to = .66 int a=1; int b=5.14; int c = -.015; int w =1; int r =.73;// on=.73 and off= .66 int h=1; int result; result = (a * b/w * r) c * h; NSLog (@"a*b/w*r)c*h;"); Is this possible

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Member 11251240 wrote:

      Is this possible

      Most likely but your question is far from clear. In general terms you would write something like:

      // in switch change event handler
      if (switch == ON)
      r = .73;
      else
      r = .66;

      But maybe I just don't understand what you are asking.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups