我正在制作array
&把它放进JSONSerialization
&安培; compliler以SIGABRT
失败。
let array = [1,2,3,4,5,6]
let arraySlice = array[1...3]
print(String(data: try! JSONSerialization.data(withJSONObject: arraySlice, options: .prettyPrinted), encoding: .utf8 )!)
线程1:信号SIGABRT
答案 0 :(得分:2)
@TypeConverter
public static Size getSize(int numeral){
for(Size s : values()){
if(s.numeral == numeral){
return s;
}
}
return null;
}
@TypeConverter
public static Integer getSizeInt(Size size){
return size.numeral;
}
无效JSONSerialization
,您首先需要将其转换为ArraySlice
:
Array