Dear Backendless Support,I’m getting a class cast exception for the following snippet at **.
Any help would be really appreciated.
Object[] objects = (Object[]) User1.getProperty(“Cart”);
Item_List[] ItemList;
if (objects.length > 0) {
** ItemList = (Item_List[]) objects;
for (int i = 0; i < ItemList.length; i++) {
if (ItemList.getItem_Name().equals(oitems.getItem_Name())) {
ItemList = ItemList[ItemList.length - 1];
break;
}
}
Hi Rick,
- You should not put your classes into the com.backendless. package name.
What is the name of the table which contains Item_List objects? Is it called Item_List ?
Yes the name of the table is Item_List.
All my classes are in a separate package called com.backendless.itrade.data
Try adding the following method after you call initApp:
Backendless.Data.mapTableToClass( “Item_List”, Item_List.class );
Still getting the same exception.
Did you move the class into a different package?