The "W" in with must be capitalized when customizing the constructor
For example: Next_viewcontroller requires a value to be passed from Viewcontroller to Next_viewcontroller
such as: in the Viewcontrolle initialization of the same time passed an array into the next_viewcontroller inside. You first need to customize the constructor in the Next_viewcontroller .
-(Instancetype) Initwithlist: (Nsarray *) list{
self = [super init];
if (self) {
NSLog (@ "%@", list);
}
return self;
}
Initialize the Next_viewcontroller object in Viewcontrolle and give Next_viewcontroller an array, so that when you jump into the Viewcontroller, the array is uploaded to the Next_ Viewcontroller Inside for example:
Nsarray *list = @[@ "meat", @ "dish", @ "Rice"];
Next_viewcontroller *next = [[Next_viewcontroller alloc]initwithlist:list];
[Self.navigationcontroller Pushviewcontroller:next Animated:yes];
So you can upload the list to Next_viewcontroller.
Pass value-Custom constructor pass-through value