使用变量设置标记值时发生崩溃

时间:2014-04-17 12:24:26

标签: ios7 crash tags uitextview

我可以像这样设置UITextView的标签:

_textView.tag = 5;

但是,当我使用变量时,程序会崩溃并显示下面给出的错误消息。

_textView.tag = rowNumber;

有趣的是,在进行上述分配时,程序不会崩溃,但稍后会发生。

这是什么原因?是否不允许在运行时更改标签?

错误讯息:

-[UITextView configureForRow:mainTitle:mainTitleColor:subtitle:subtitleColor:backgroundColor:objectWithTargetMethod:]: unrecognized selector sent to instance 0x12ed26550
2014-04-17 14:18:54.600 Loggilyze[8153:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITextView configureForRow:mainTitle:mainTitleColor:subtitle:subtitleColor:backgroundColor:objectWithTargetMethod:]: unrecognized selector sent to instance 0x12ed26550'
*** First throw call stack:
(0x18473a950 0x190c401fc 0x18473f604 0x18473d330 0x18465d08c 0x100077618 0x18784c904 0x1877eae64 0x1877ea62c 0x1876feff8 0x1872f0258 0x1872eae20 0x1872eacd8 0x1872ea560 0x1872ea304 0x1872e3c38 0x1846fb0a8 0x1846f8330 0x1846f86bc 0x1846396d0 0x18a31dc0c 0x18776afdc 0x100012b44 0x191233aa0)
libc++abi.dylib: terminating with uncaught exception of type NSException

0 个答案:

没有答案