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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -