Does it have to return void?  If not, how about returning an NSString*?

- (NSString *)convertFunctionWithValues:(NSString *)valueOne
ValueTwo:(double)valueTwo ValueThree:(double)valueThree
ValueFour:(double)valueFour
ValueFive:(NSString *)valueFive ValueSix:(double)valueSix ....
{

NSString *retVal;

// calculations...

retVal = [NSString stringWithFormat:@"%c%c%i%i", retLet1,
retLet2,retFinalCalcA,retFinalCalcB];

return retVal;

}


On Mon, Apr 7, 2008 at 4:59 PM, Stuart Green <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I've currently got a function of type void that works swimmingly in the
> debugger.  I now need to populate a text field with the value of the
> generated string within the function.  The function is declared along the
> lines:
>
> - (void)convertFunctionWithValues:(NSString *)valueOne
> ValueTwo:(double)valueTwo ValueThree:(double)valueThree
> ValueFour:(double)valueFour ValueFive:(NSString *)valueFive
> ValueSix:(double)valueSix ValueSeven:(double)valueSeven
> ValueEight:(double)valueEight Precision:(int)precision;
> {
>        // Declarations here
>        NSString *retVal = @"";
>
>        // Calculations go here...
>        // Lots of them...
>
>        // We've got the result, now we want to return it
>        retVal = [NSString stringWithFormat:@"%c%c%i%i", retLet1,
> retLet2,retFinalCalcA,retFinalCalcB];
>
> }
>
> How do I now return this string value?  The initialisation and calling is
> done via:
>
>        convertedValue = [[convertValues alloc] init];
>        valToBeDisplayed = [convertedValue
> convertFunctionWithValues:valueOne ValueTwo:valueTwo ValueThree:valueThree
> ValueFour:valueFour ValueFive:valueFive ValueSix:valueSix
> ValueSeven:valueSeven ValueEight:valueEight Precision:precision];
>        // Display returned value
>        self.valDisplayField.text = valToBeDisplayed;
>        [convertedValue release];
>
> Any ideas appreciated.
>
> Thanks,
>
> Stu
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/ryan%40heatery.com
>
> This email sent to [EMAIL PROTECTED]
>
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to