cocoa touch - Setting a variable in objective c to be visible in another view -
i have viewcontroller filterviewcontroller.m , .h
i have stepper sets variable named value data type of int, variable value between 1 , 16.
the stepper sets value in method steppervaluechanged , in method need set 'global' variable accessed in firstviewcontroller.
how can set variable scope visible in firstviewcontroller?
i understand can use class this, unsure how. learning points.
it's not recommended use global variables in code, , if have use them means bad implementation.
you need check how both classes connected, maybe can use delegate inform value has changed, or send notification new value, example.
Comments
Post a Comment