I need to pass an NSInteger to my Other View Controller:
NSInteger index = [carousel indexOfItemView:sender];
This was implemented in a UIButton, Im thinking of using the NSUserDefaults like this sample code here:
[[NSUserDefaults standardUserDefaults] setObject:4 forKey:@"integer"];
[[NSUserDefaults standardUserDefaults] synchronize];
But I can’t do it with my code above.
Is there other methods.
You can use NSUserdefaults to pass value from one Viewcontroller to another. Use the below code:
You can retrieve it on another view by using the following code: