프로퍼티 스택오버플로우..
public uint dwIndex
{
get
{
// 나중에 데이터 변환해야함..
return dwIndex;
}
set
{
dwIndex = value;
}
}
dwIndex라는 필드에 값을 넣으니 스택오버플로우 에러가 났다.
StackOverflowException: The requested operation caused a stack overflow.
MsgText.set_dwIndex (UInt32 value) (at Assets/1_Scripte/Data/MsgText.cs:17)
MsgText.set_dwIndex (UInt32 value) (at Assets/1_Scripte/Data/MsgText.cs:17)
MsgText.set_dwIndex (UInt32 value) (at Assets/1_Scripte/Data/MsgText.cs:17)
MsgText.set_dwIndex (UInt32 value) (at Assets/1_Scripte/Data/MsgText.cs:17)
...
확인해보니 dwIndex는 선언된 변수가 아니라 자기가 가지고 있는 속성? 이고
그 속성에 값을 넣어주므로 계속 set이 호출된다는 것이다.
dwIndex = value;
=> 어? dwIndex 속성에 값을 넣어주네? set 프로퍼티 호출!
dwIndex = value;
=> 어? dwIndex 속성에 값을 넣어주네? set 프로퍼티 호출!
public uint INDEX
{
get
{
// 나중에 데이터 변환해야함..
return dwIndex;
}
set
{
dwIndex = value;
}
}