I'm Japanese so I'm not good at writing English.
So I hope people can understand what I'm trying to say otherwise I'll stuck for forever!!
I'm trying to create timer so I have object called Food.h which has:
@property (nonatomic,copy) NSString *text;
@property (nonatomic, assign) NSTimeInterval time;
also I have object called CategoryName.h which has:
@property (nonatomic, copy) NSString *name;
@property (nonatomic, strong) NSMutableArray *items;
and I am doing this on my DataModel.h:
@property (nonatomic, strong) NSMutableArray *lists;
then on my DataModel.m: self.lists = [[NSMutableArray alloc]initWithCapacity:20];
CategoryName *categoryName;
Food *food;
categoryName = [[CategoryName alloc]init];
categoryName.name = @"Spagettie";
categoryName.items = [[NSMutableArray alloc] initWithCapacity:20];
Food *food;
food = [[Food alloc]init];
food.text = @"Spaghetti";
food.time = 600;
[categoryName.items addObject:food];
all Food, CategoryName, DataModel are subclass of NSObject.
and, I have this method to set my timer's time:
- (void)setCountDownTime:(NSTimeInterval)time
{
timeUserValue = (time < 0)? 0 : time;
timeToCountOff = [date1970 dateByAddingTimeInterval:timeUserValue];
[self updateLabel];
}
In my TimerViewController.h file, I put:@property (nonatomic, strong) Food *food; so I do TimerViewController.m file :
self.title = self.food.text
[timer setCountDownTime:self.food.time];
title will works for this but for my timer label, it won't show any error however my label doesn't change.
If I do
[timer setCountDownTime:600];
it works. So please tell me what I'm doing wrong!