I would create a class to hold these values. Then pass this object between view controllers.
Something like this:
Interface file:
//
// MyObject.h
// SOObjectPassing
//
// Created by Wilson, LJ on 11/15/12.
// Copyright (c) 2012 Arkansas Children's Hospital. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MyObject : NSObject {
int shours;
int sminutes;
int sseconds;
int srecharge;
bool change;
}
@property (nonatomic, assign) int shours;
@property (nonatomic, assign) int sminutes;
@property (nonatomic, assign) int sseconds;
@property (nonatomic, assign) int srecharge;
@property (nonatomic, assign) BOOL change;
-(id) initWithHours:(int)hours
minutes:(int)minutes
seconds:(int)seconds
recharge:(int)recharge
changed:(BOOL)changed;
@end
Implementation file:
//
// MyObject.m
// SOObjectPassing
//
// Created by Wilson, LJ on 11/15/12.
// Copyright (c) 2012 Arkansas Children's Hospital. All rights reserved.
//
#import "MyObject.h"
@implementation MyObject
@synthesize shours = _shours;
@synthesize sminutes = _sminutes;
@synthesize sseconds = _sseconds;
@synthesize srecharge = _srecharge;
@synthesize change = _change;
-(id) initWithHours:(int)hours
minutes:(int)minutes
seconds:(int)seconds
recharge:(int)recharge
changed:(BOOL)changed {
if ((self = [super init])) {
_shours = hours;
_sminutes = minutes;
_sseconds = seconds;
_srecharge = recharge;
_change = changed;
}
return self;
}
@end
And instantiate your object like this:
MyObject *myObject = [[MyObject alloc] initWithHours:2
minutes:3
seconds:4
recharge:1
changed:NO];
Then just pass that entire object to your other VC (s).
Here is a sample project illustrating this.