Dynamic Object Selection

Lets say I have buttons named btn1...btn50. Without requiring 50 if statements, how would you go about retrieving (for example) button 33 given some input of 33.
I have done this in (very ugly) javascript code using the eval method, but I'm wondering if there is a way to do this in C.
This is what I'd like to do:
- (IBAction) buttonClicked:(id)sender {
NSString *buttonName = [NSString stringWithFormat:@"%@%@", @"btn", (UIButton *)sender.currentTitle];
UIButton *myButton = // Retrieve the button by it's object name
I know you can do
if( sender == btnObject ){ }
but i'd really like to not have to do that 50 times.

Not sure that's appropriate for the situation you're describing, but all the metaprogramming concepts are generally found in here:
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ch apter14_section_1.html#//appleref/doc/uid/TP30001163-CH9-CJBBBCHG

Similar Messages

  • Adobe Form - dynamic object selection/control

    Hi,
    I am very new to using the Acrobat Form building tool. I am currently using it in conjunction with Adobe LifeCycle designer 8.
    I would like to create a form which behaves like an xHTML doc, and client-side JavaScript.
    I would like to be able to create groups of objects (Text, textboxes, comboboxes, etc), that can be shown or hidden depending on user selection/input in a different control/object. This is a pretty general question, but I am having difficulty finding documentation on how to approach.
    This may be more difficult. The form will live in a folder on a shared drive. When the user completes and submits the form, I need for it to do the following:
    Email to a specific address, depending on a user selection of a combobox value on the form.
    Then create a copy of itself in a subfolder in the same shared drive, with a dynamically generated unique title/id (like a database key field).
    Are any of these things possible. I would probably just create an xHTML form to do this, but currently we do not have a web server available to house such a form. And the portability of the Acrobat forms seems useful and practical in the long run.
    If someone could point me in the right direction, website and/or online PDF publication, I would be ever so grateful.
    Thanks so much for your help.
    Kind regards,
    Jessica

    >I am very new to using the Acrobat Form building tool. I am currently using it in conjunction with Adobe LifeCycle designer 8.
    This doesn't seem to relate to Create PDF Online, a web service from
    Adobe. I recommend the LiveCycle Designer forum.
    Bear in mind that e-mail submission of PDFs is really, in my view, a
    tool for testing. Any serious usage would use a web server, just like
    an HTML form.
    Aandi Inston

  • Dynamic parameter selection from infoview not storing the sql password

    We are having the problem of dynamic parameter selection from infoview not storing the sql password as it does for the actual report. We are using Crystal Reports XI Release 2 version 11.5.3.438 (Not sure of SP level, asked in separate thread).
    To be more specific.
    We have created a report that dynamically populates the parameters of the report by pulling the records from the Informix sql database and allowing selection from there.
    In the Central Management Console for the report object we have set as follows:
    Process - Database:
    Use original database logon information from the report - the sql username and pw etc
    Use same database logon as when report is run
    Process - Parameters
    In selecting a default selection there is the option to put in the sql password, however, this does not stick and clears after update.
    As such the end result is that every time this report is run from infoview and a user chooses a parameter (there are 5), crystal goes through some timeout for about a minute or so and then requests the sql password, if a user then selects the next parameter, the same timeout and password dialog appears.
    We need the crystal report to handle to the sql password for fetching the parameters as well as for the database section of running the report, however, the parameters insists on the end user always putting the password in.
    This is 100% replicatable on our system.
    Any way that we can fix this?
    Will an update fix this issue? If so could you please advise which one?
    Thanks

    Hi,
    I am having the exact same problem. Any help?
    And what does "Use same database logon as when report is run" mean? For me that would be that no prompt is needed for getting values in a dynamic parameter...
    Regards
    Magnus

  • Dynamic RadioList selection

    I am building a radio list dynamically in TOOL code based upon certain
    criteria. I can get the list built no problem. But, I want to "select" a
    certain element based on an attribute I check on the object. So the element
    I want to appear selected may be element 2 or element 5 or element x. Has
    anyone ever done this? I can't seem to find anything in the Forte help that
    will allow me to do this?? Any help would be greatly appreciated.
    Thanks!!
    Doug Scurr
    HealthPartners
    8100 34th Avenue South
    Minneapolis, MN 55440-1309
    (612)883-7317
    [email protected] <[email protected]>

    Dale,
    I knew it would be something easy!! I obviously can't read very well!!
    Thanks for the help!!
    Doug Scurr
    HealthPartners
    8100 34th Avenue South
    Minneapolis, MN 55440-1309
    (612)883-7317
    [email protected] <[email protected]>
    -----Original Message-----
    From: Dale V. Georg [SMTP:[email protected]]
    Sent: Tuesday, April 27, 1999 2:34 PM
    To: [email protected]
    Cc: [email protected]
    Subject: Re: Dynamic RadioList selection
    > [email protected] wrote:
    >
    > I am building a radio list dynamically in TOOL code based upon
    certain
    > criteria. I can get the list built no problem. But, I want to
    "select" a
    > certain element based on an attribute I check on the object. So
    the element
    > I want to appear selected may be element 2 or element 5 or element
    x. Has
    > anyone ever done this? I can't seem to find anything in the Forte
    help that
    > will allow me to do this?? Any help would be greatly appreciated.
    > Thanks!!
    This should be as simple as setting the IndexValue of the radio list
    to
    the item that you want to have selected. For example:
    self.<theRadioList>.IndexValue = 2;
    to select the second item. Make sure your window is already open
    when
    you do this, though. ie, make sure self.Open() has already been
    called. The Open() method initializes a lot of the widget
    information
    on the window, and it may well set the index value of the radio list
    back to 1.
    Hope this helps,
    Dale
    ===================================
    Dale V. Georg
    Senior Systems Analyst
    Indus Consultancy Services
    [email protected]
    ===================================
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Change Value based on Dynamical Object

    Goal:
    The goal is to make the variable with value '2014-06-14 09:00:00.000'
    Problem:
    The syntax code is created as a dynamical object how do you make it from '2014-06-14 16:20:10.000' into value '2014-06-14 09:00:00.000'?
    DECLARE @a datetime = '2014-06-14 16:20:10.000'

    Are you looking for this?
    DECLARE @a datetime = '2014-06-14 16:20:10.000'
    select dateadd(hour,9,convert(datetime,convert(date,@a)))
    set @a = '2014-06-14 08:20:10.000'
    select dateadd(hour,9,convert(datetime,convert(date,@a)))
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • Dynamic Objects

    Hello *,
    this is kinda wierd but I got this little 'dumb' question.
    I am new to dynamic objects and I want to improve the application I am developing.
    I got an item as Select List (P620_AN_NAME) populated with User list, returning the USER_ID
    'select user_name display, id return from users'
    Beneath there is an item which shall display the city      according to the selected user's address.
    advanced dynamic action, set value (imgs below)
    e.g. 'select city from addresses' where ID_ADDRESS (foreign key) = :P620_AN_NAME.
    Unfortunately the city will be changed only once, even if I selected "live" and the value which is selected is NOT the returning value from the list but the first always.
    http://imageshack.us/photo/my-images/5/dynt.jpg/
    http://imageshack.us/photo/my-images/59/actionse.jpg/
    Where is my mistake located?

    hi,
    this might not related to your post regarding dynamic actions.
    but,
    you can do your requirement using the a process pl/sql,
    declare
    x varcdhar2(50);
    y varcdhar2(50);
    begin
    --x := :P620_AN_NAME;
    select city into y from addresses where ID_ADDRESS = :P620_AN_NAME;
    item_city := y;
    end;this will change the item value accordingly(when select list changes/submits the page).
    regards,
    Little Foot

  • Dynamic Object for Checkbox in HTMLB control

    Hi all,
    I want to create dynamic object for Checkbox in HTMLB control.
    I have created dynamic check box in JSP using JSPDynpage. I can select multiple values in the list of checkbox.After clicking the submit button , I have to read the value of checkbox.  For this first i want to create the object for checkbox in controller.
    How can i create the dynamic object?
    Help me in this regard.
    Thanks & Regards
    Hemalatha J

    Krish
      Will this link helps you ????
      <a href="http://help.sap.com/saphelp_nw04/helpdata/en/7d/9b0e41a346ef6fe10000000a1550b0/frameset.htm">Check Box</a>
    Thanks
    Jack
    Allot points if it helps

  • Java Core Program :: Dynamic Object Creation for Classe & Invoking the same

    Hi,
    I need to create a dynamic object for a class & invoke it.
    For eg: I have a table in my DB where all the names of my java classes are stored. I need to call name from the table of the DB and call that class dynamically in my java program.
    ResultSet_01 = executeQuery("select classname from class_table where class_descrip = 'Sales Invoice' ");
                   while(ResultSet_01.next())
                        String class_name = ResultSet_01.getDouble("classname");
                   }Now using the string in class_name that is fetched from ResultSet_01, I need to create an object for the class_name & invoke the class that is been created with the same name.
    Thank in advance.
    Regards,
    Haider Imani

    Well for a start since a class name is a String, not a number you'd better start by getting the name with getString() not getDouble().
    You need to work with fully qualified names, (FQNs) like "com.acme.myproject.MyDynamicClass", not just the bare MyDynamicClass.
    The next question is where the .class files for the dynamically loaded classes are stored. If they are part of your normal program code, on the class path, then you can use Class.forName to load the class and return a Class object. If they are in some special place you'll need to create a URLClassLoader and get the Class from that.
    Generally, when you load a class this way, it should implement some known interface, or extend some know abstract class. By placing objects of the dynamic class in a reference to that interface you can use the methods defined in the interface.
    The usual way of getting an instance of a dynamic class is to call newInstance() on the Class object.

  • Fetching Dynamic Object issue

    Hi all,
    Instead of define an variable as external (due to size limitation), I decided to use session.getInstanceData to obtain the value in an instance variable. While things works well on my environment, it does not work out in the QA environment. The following is how I do it:
    DynamicObject instanceData =
    session.getInstanceData(instanceInfo.getId());
    Map dataMap = instanceData.asMap();               
    //Get screening result
    String resultStr = "";
    boolean hasResult =
    dataMap.containsKey("screeningResults");
    if (hasResult){
    Object resultValue =
    dataMap.get("screeningResults");
         resultStr = resultValue.toString();
    I have also log the content of screen result inside the activity:
    logMessage("leaving ... "+this.activity.name +" with screening results="+ this.screeningResults);
    At my environment, I can see the content pass from the engine back to PAPI. However, on QA environment, I see the content show on the engine log (due to the logMessage) but PAPI gets empty string back.
    At first I thought it is due to the "Max Instnace Size limitation", so I upped the limit to 2000kb, but it still doesn't solve the issue. So anyone got any idea what did I do wrong or forgot to handle? Thanks!
    Matthew

    Can I create dynamic object?Depends what you mean by "dynamic object." That term is not part of standard Java parlance, AFAIK.

  • Error #1056, creating dynamic object

    Hi,
    I am simultaneously creating an object and adding it to an array, perhaps ill-advisedly. The following code worked on the main timeline, but not when I moved it to the constructor of a document class:
    package {
         import flash.geom.Point;
        import flash.display.MovieClip;
        public class IconTour extends MovieClip {
            var thePoint:Point = new Point();
            var defaultColor:Number;
            var overColor:Number;
            var iconCreationList:Array = new Array();
            //var xx:MyIcon;
            public function IconTour(){
                thePoint.x=50;
                thePoint.y=300;
                defaultColor=0x7dc2df;
                overColor=0x788dec;
                iconCreationList.push(this["xx"+iconCreationList.length] = new MyIcon(thePoint,"folder","Text for the folder", "Folder", defaultColor, overColor));
                for each (var iconObject:MyIcon in iconCreationList) {
                    addChild(iconObject);
    The following error is generated:
    >ReferenceError: Error #1056: Cannot create property xx0 on IconTour.
        at IconTour()
    I guess this is because xx0 isn't declared? How does one declare a dynamic object/variable?

    Nope. No mention. However, I guess I don't need to dynamically create a variable as this works:
    iconCreationList.push(xx = new MyIcon(thePoint,"folder","Text for the folder", "Folder", defaultColor, overColor));
    iconCreationList.push(xx = new MyIcon(thePoint,"assignments","Text for the assignment", "Assignments", defaultColor, overColor));
    where this does not:
    iconCreationList.push(this["xx"+iconCreationList.length] = new MyIcon(thePoint,"quiz","Text for the quiz", "Quiz", defaultColor, overColor));
    iconCreationList.push(this["xx"+iconCreationList.length] = new MyIcon(thePoint,"assignments","Text for the assignment", "Assignments", defaultColor, overColor));
    AS doesn't care if I add more than one object to the array that is named xx. I probably won't be referencing xx by that name anyway, just by iconCreationList[1].

  • HR Infosets - switch object selection question?

    Dear All,
    I encounter this issue. I create a HR Infosets using logical database PNPCE. As the requirement of our HR Dept, so we need to add more extras fields (by code).
    The problem when we switch on/off object selection (from menu):
    - When the object selection is off: all the extras fields I add are available.
    - When the object selection is on: all of them are not available.
    This is my idea. All the field of infosets will be display when the object selection is on depend on SAP internal field, and the extra field we add by code will not be displayed.
    But it's my opinion. So please help me with this issue.
    Thanks in advanced.
    Thien.
    Edited by: Pham Thien on Nov 18, 2008 3:12 AM

    Hi,
    We can hide those options by implementing the Layoutsets. If you need to hide those options for standard admin user itself, then you need to change the standard Layoutsets, which is not recommended. These options are defined in the "Command Group" of the Layoutsets.
    You can Navigate to Layoutsets thru below path.
    Sys Admin -> System Configuration -> Knowledge Management ->Content Management -> User Interface -> Settings -> Layoutset
    Tweaking over the Layoutset Command group properties will hide the options which you mentioned.
    Thanks,
    Mahendran B.

  • Dynamic objects in component

    I be trying insert dynamic objects in my JSF component by JavaScript,
    but it don't see this objects in the Servlet.
    for e.g., i have a datatable with 3 rows(from Database), each row with a
    input text(HTML), and insert a dynamic input text(HTML) in my structure(4 rows),
    after execute submit to a ActionListener, the input text included in the
    fourth row dont exists in the Collection return by JSF.
    How can i get the fourth object value?

    Simply you can't.
    JavaScript can't affect the structure of the JSF component tree.

  • Dynamic bandwidth selection for PPPoE over Ethernet/VLAN

    Hello all, hope you are doing great.
    I'm planning to deploy PPPoE Server (Cisco Router 7609) for a ISP. This ISP will provide Internet connection for customer over Ethernet.
    I have to provide a solution to assign bandwidth to each customer by RADIUS and I find some clues that Dynamic Bandwidth Selection (DBS) should be the answer. Unfortunately, DBS only support PPPoA or PPPoE over ATM.
    If you have any experience with equivalent function, please help me. Thank you very much.
    Regards,
    Hiep Nguyen.

    Hiep,
    I think I have figured this out.  Here is the test config on my PPPoE server:
    int lo1
      ip address 172.25.25.25 255.255.255.255
    ip radius source-interface Loopback1
    aaa new-model
    radius-server host 172.16.1.55 auth-port 1812 acct-port 1813 key cisco$$$
    aaa group server radius RADIUS-ACT
     server 172.16.1.55 auth-port 1812 acct-port 1813  
    aaa authentication login default group RADIUS-ACT local
    aaa authorization exec default group RADIUS-ACT local
    aaa accounting exec default start-stop group RADIUS-ACT
    aaa accounting delay-start
    aaa authentication ppp default if-needed group RADIUS-ACT local
    aaa authorization network default group RADIUS-ACT local
    aaa accounting network default start-stop group RADIUS-ACT
    aaa accounting update periodic 5
    bba-group pppoe global
     virtual-template 1
    interface fa0/1
     pppoe enable group global
     ip address 172.30.0.1 255.255.0.0
     no shut
    interface Virtual-Template1
     mtu 1492
     ip unnumbered FastEthernet0/1
     peer default ip address pool GLOBALPOOL
     ppp authentication chap
    ip local pool GLOBALPOOL 172.30.0.2 172.30.127.255
    policy-map POLICE-128K
     class class-default
        police 128000
    policy-map POLICE-512K
     class class-default
        police 512000
    Here are the attributes on the radius server, for a group the PPPoE customer belonged to:
    Service-Type = Framed
    Framed-Protocol = PPP
    cisco-avpair="ip:sub-policy-In=POLICE-128K"
    cisco-avpair+="ip:sub-policy-Out=POLICE-512K"
    Here is the show policy-map on the virtual-access interface the client connected on:
    sho policy-map int virtual-a 3
     Virtual-Access3
      Service-policy input: POLICE-128K
        Class-map: class-default (match-any)
          1000 packets, 1402000 bytes
          5 minute offered rate 0 bps, drop rate 0 bps
          Match: any
          police:
              cir 128000 bps, bc 4000 bytes
            conformed 799 packets, 1120198 bytes; actions:
              transmit
            exceeded 201 packets, 281802 bytes; actions:
              drop
            conformed 0 bps, exceed 0 bps
      Service-policy output: POLICE-512K
        Class-map: class-default (match-any)
          911 packets, 1137746 bytes
          5 minute offered rate 0 bps, drop rate 0 bps
          Match: any
          police:
              cir 512000 bps, bc 16000 bytes
            conformed 799 packets, 1136178 bytes; actions:
              transmit
            exceeded 0 packets, 0 bytes; actions:
              drop
            conformed 0 bps, exceed 0 bps
    I was able to generate enough traffic with ping to meet the exceed action in and have it drop packets.

  • Dynamic Date selection inactive

    Hi,
    I am not able to give dynamic date selection in a variant. (D: Dynamic date calculation).The traffic light is displayed in red and there is no options such as
    current date etc. is there any need to do some settings to get these options.

    Hi,
    have a look at the below link..  ( they have mentioned the steps of customer exit variable fassigning for reporting agent)
    https://websmp110.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700003598422003E
    Regards,
    Siva.

  • Is it possible to make changes on object selection area???

    Hi friends,
    I wanna ask a question about portal.
    When we connect to portal we choose corporate documents , there are files of departmants like hr, it, corporate general ...
    We want some changes in object selection area of these files. For example when we get into object selection area of IT there are objects like favorites, others, personel documents, common document, common documents.
    My question is
    Can we deduct or hide some of these objects from object selection area? If we can, how can we do it?
    Thanks
    Muzaffer Öz
    Edited by: Muzaffer Oz on Dec 2, 2011 9:31 AM
    Edited by: Muzaffer Oz on Dec 2, 2011 9:44 AM

    Hi,
    We can hide those options by implementing the Layoutsets. If you need to hide those options for standard admin user itself, then you need to change the standard Layoutsets, which is not recommended. These options are defined in the "Command Group" of the Layoutsets.
    You can Navigate to Layoutsets thru below path.
    Sys Admin -> System Configuration -> Knowledge Management ->Content Management -> User Interface -> Settings -> Layoutset
    Tweaking over the Layoutset Command group properties will hide the options which you mentioned.
    Thanks,
    Mahendran B.

Maybe you are looking for

  • Table For Header Text Old Value

    Hi, Could Anyone helpme in finding the table for Header text of the PO , as We know  to find the current PO Header Text,by usinf th FM READ_text but i want to to find the header text for the po before Updated , Thanks in advance Regards Priyanka M Ja

  • INTERFACING FROM ORACLE GL TO HYPERION FOR BUDGETING

    As of November 26, 1997, the HYPERION Interface to Oracle General Ledger is not supported. Someone know if is there a plan to accomplishing it in the future? Best Regards, Emilio Perez Solla

  • Error with trackpad after installing Windows 8

    So I just got a new Macbook Pro today. Here are the specifications. Intel i7 processor 8GB RAM 750GB Hard drive. From those 750, I used 300 GB for installing Windows. Now everything works fine so far other than the trackpad. The right click does not

  • Time Machine almost constantly  backing up

    I'm running Time Machine onto an internal 2TB HD on my MacPro (early 2008) running Snow Leopard. Recently it has started getting into a cycle of almost taking an hour to do the hourly back-ups (even when there isn't much to back up). It always seems

  • Overwrite class file that launched app?

    Here's a wacky one for you: I have a single bootstrap class file residing on customers' machines that launches a remote application. This bootstrap class file cannot be updated or changed directly. The only hope for making any changes to it is to hav