Hi!
When restoring my application state from NSUserdefaults, I call a method in my ViewController which updates properties on controls in the view. These changes do not show up in the view, however. From my understanding of KVO the controls should update in the view as they are bound to synthesized properties in my viewmodel.
Can anyone spot the error?
ViewModel .m :
ViewModel .h:
When restoring my application state from NSUserdefaults, I call a method in my ViewController which updates properties on controls in the view. These changes do not show up in the view, however. From my understanding of KVO the controls should update in the view as they are bound to synthesized properties in my viewmodel.
Can anyone spot the error?
ViewModel .m :
Code:
...
- (void)restoreCalendarWithSelectionArray:(NSArray *)selectionArray
{
for (int i = 0; i < [selectionArray count] -1; i++) {
//update the selected ones
if ([[selectionArray objectAtIndex:i] integerValue] == 1)
{
switch (i) {
case 0:
button1.hidden = TRUE;
button1.enabled = FALSE;
imageView.hidden = FALSE;
[imageView setImage:image2];
break;
...
ViewModel .h:
Code:
...
@interface MyViewController : UIViewController{
UIImageView *imageView;
UIImageView *animation;
UIImage *image1;
UIImage *image2;
AVAudioPlayer *audioPlayer;
SystemSoundID currentSoundFXID;
UIButton *button1;
UIButton *button2;
UIButton *button3;
}
@property (nonatomic, retain) IBOutlet UIImageView *imageView;
@property (nonatomic) SystemSoundID currentSoundFXID;
@property (nonatomic, retain) IBOutlet UIButton *button1;
@property (nonatomic, retain) IBOutlet UIButton *button2;
@property (nonatomic, retain) IBOutlet UIButton *button3;
...