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

  • Home
  • SEARCH
  • 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 7702573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:15:27+00:00 2026-05-31T23:15:27+00:00

I have an xml file that contains a structure.. In this structure, I have

  • 0

I have an xml file that contains a structure.. In this structure, I have Actions node. So under Actions node, there are multiple “Action” nodes that each has Value and Name attributes.

e.g.

<?xml version="1.0" encoding="ISO-8859-1"?>

<Testcases SuiteName="CalculatorActions">

    <Testcase id="101" Name="testAddFunction">
        <Setup/>
        <TearDown/>
        <Test>
            <Action Name="Enter first operand" Type="input" Value="5"/>
            <Action Name="Enter second operand" Type="input" Value="3"/>
            <Action Name="Select operator" Type="input" Value="+"/>
            <Action Name="Click Calculator" Type="operation"/>
        </Test>
        <Validations>
            <Action Name="Validate result" Type="output" Value="8"/>
        </Validations>
    </Testcase>

</Testcases>

What I would like to do is; I want to map these actions to the methods that I have implemented in Objective-C.

Let’s say i have a class called; “CalculatorActions” and defined 5 methods inside. I would like to map the actions that i have in xml (text format) to the methods i created in CalculatorActions.

e.g.

@interface CalculatorActions : NSObject

// Property
@property (strong, nonatomic) NSString* actionScript;

// Actions
- (void)enterFirstOperand:(double)operand;

- (void)enterSecondOperand:(double)operand;

- (void)selectOperator:(NSString*)operator;

- (void)clickCalculate;

// Validations

-(void)validateResult:(NSString*)exptectedResult;

@end

so when i read the xml file, I would want to map the actions in xml file to the corresponding method in a class.

I think what i am looking for is something like;

@interface CalculatorActions

[Action("addOperand", "Enter first operand")]
- (void) addOperand:(double)operand1 ToOther:(double)operand2;

What would be the best way to do this?

  • 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-31T23:15:29+00:00Added an answer on May 31, 2026 at 11:15 pm

    You can create an NSInvocation instance, set the selector, arguments, and optionally capture the return value. You can create these all with strings.

    e.g.

    SEL mySelector = NSSelectorFromString(@"testAddFunction");
    Class MyClass = NSClassFromString(@"CalculatorActions");
    NSString *myArgument = @"5";
    
    NSInvocation *myInvocation = [NSInvocation invocationWithMethodSignature:[MyClass instanceMethodSignatureForSelector:mySelector]];
    [invocation setTarget:myClass];
    [invocation setSelector:mySelector];
    [invocation setArgument:&myArgument atIndex:2];
    [invocation invoke];
    

    Note – the setArgument: selector takes a pointer address, and the index of the arguments start at 2.

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

Sidebar

Related Questions

I have an xml file that contains in products. File's structure this: <?xml version=1.0
I have an XML file format that contains a structure of questions: <question id=q101>
I have an XML file that has a number of nodes, each of which
I have a folder structure that contains multiple javascript files, each of these files
I have an xml file that contains this data: `<?xml version=1.0 encoding=UTF-8?> <WordList> <Words
To start off, I have this XML file that contains recursive parent-child elements. Here
I have generated an XML file that and one of the nodes contains data
I have an xml file that contains its element like <ab:test>Str</ab:test> When I am
Me again... I have an XML File that contains different categories which I would
For an XML file I am creating I have data that contains a bullet

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.