我有以下代码:
NSLog(@"editField is %@", editField);
NSLog(@"textField tag is %i", [textField tag]);
switch ([textField tag])
{
case ItemTitle:
NSLog(@"here");
self.item.title = editField;
NSLog(@"title is %@", self.item.title);
break;
case ItemCat:
[self.item setCat:self.item.cat];
break;
我正在尝试根据枚举器设置字段。
我收到了这个日志响应,无法弄清楚我错过了什么。
-[SubViewController textFieldShouldBeginEditing:]
-[SubViewController textFieldDidBeginEditing:]
-[SubViewController textFieldDidEndEditing:]
editField is Hi
textField tag is 0
here
title is (null)
enum
的{{1}}值为零(由日志“此处”支持)