I have a UIPicker within a Master-Detail View that contains 'categories'. I would like to set the 'category' to the NSDictionary for that item. The NSDictionary holds items with 'title' 'quantity' and 'category'.
How can I get the UIPicker data to the NSDictionary?
- (IBAction)categoryTextChanged:(UITextField *)sender {
[self.category setObject:sender.text forKey:@"category"];
- (void)configureView
{
// Update the user interface for the detail item.
if (self.item)
self.itemText.text = [self.item objectForKey:@"item"];
if (self.quantity)
self.quantityText.text = [self.quantity objectForKey:@"quantity"];
if (self.category){
self.categoryText.text = [self.category objectForKey:@"category"];
//self.categoryTextLabel.text = [self.category objectForKey:@"category"];
}
}
- (void)setCategory:(id)newCategory
{
if (_category != newCategory) {
_category = newCategory;
// Update the view.
[self configureView];
}
}