El sáb, 09-04-2016 a las 08:53 -0400, umen escribió:
> Hi,
> Number1 is NSButton. result is the NSTextField. I assign string to
> number1 because with strings I can append other numbers and assign
> this new number to number1 again, then I use doubleValue to get a
> double from this string. It's exactly what else{} is doing at all
> button methods. Or there is another/better way to do that not using
> strings?
> 

Why number1 is an NSButton? 
If you need an string, then use an NSString. But in that case, you can't
call -setDoubleValue: (line 157 in UCalc.m), because class NSString
don't implement this method. You should do something like:

number1 = [NSString stringWithFormat: @"%f", [number2 doubleValue] +
[number1 doubleValue]]

Germán
 


_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to