in the interest of learning how to program in Objective C I decided to make a calculator application (with 0-9, +, - buttons etc.). While I was programming I noticed that the 0-9 buttons on my application all did basically the same thing (ie: tell the only TextBox to display whatever number was pressed) so why not save time and make a function that does just that.

The problem is I don't know where/how to declare this function so it can send a message to the TextBox. I've tried putting it a multitude of places and I get a multitude of errors:

MyCustomObject.h

```
   //imports and declaring variables

   @interface MyCustomObject: NSObject{
       IBOutlet id Text;

   /* 1. declaring function here gives the error: expected ':', ',', ';', '}' or 
   '__attribute__' before '{' token. It has the "{" line highlighted */
   }

   - (IBAction)ButtonOne:(id)sender;
   //A lot of (IBAction) lines like the one above

   /* 2. Declaring here gives the same error as the 1., highlighting the same line*/
   @end

   /* 3. Declaring here gives the error:"Text" undeclared highlighting the [text]line*/

```

MyCustomObject.m

```
   //imports 

   /* 4. Declaring here gives the same error as 3. highlighting the same line*/

   @implementation Solver

   /* 5. Declaring here gives the same error as 3. highlighting the same line*/

   - (IBAction)ButtonOne:(id)sender {
        TheFunctionIWantToDeclare(@"1");
   }
   //Some more -(IBAction)'s with code
   @end

```

Code of the function I want to declare

```
   void TheFunctionIWantToDeclare (NSString*x)
   {
    [Text setStringValue:x];
    //more code here but the only part thats giving me grief is the above line
   }

```