xcode - How to display an object created in one class in another class in Objective-C? -
i have created uipickerview in view controller called activitylevelpickerviewcontroller. want picker view display in view controller called registerviewcontroller.
how call picker view in registerviewcontrller?
there 2 options. 1 copy on code related pickerview activitylevelpickerviewcontroller registerviewcontroller. other option create new uipickerview subclass , move code related populating rows there. nice thing creating subclass if want make change picker, can change once rather in every view controller. property declaration this:
@property (weak, nonatomic) iboutlet mypickerviewsubclass *pickerview; don't forget import picker view subclass in view controller if go subclassing option.
Comments
Post a Comment