How do you get the segmented control value in flipside mode to calculate Mainview? updated

the code didn't help just look below

+3
source share
1 answer

Make a variable in your controller (not your view, associate your actions with your view with the controller in Interface Builder). Then you can do two things:

a) When is it:

-(IBAction)CalculateButton:(id)sender

starts up. Let the controller receive the values ​​from the flip side and perform the calculation.

b) Create a Model object (perhaps a very advanced application size, but its good design and best practice)

@interface CalculateObject : NSObject {
   //Some variables
}
//@property for all variables

- (...) doCalculation;
@end

, , . , . doCalculate.

. , Model-View-Controller, :

http://en.wikipedia.org/wiki/Model -View-Controller

+3

Source: https://habr.com/ru/post/1791625/


All Articles