Do all of your objects have ids? You need to correlate an ephemeral id number (e.g. "steel" has an id of 1 -- or whatever)
You give us no idea of how your inventory works behind the scenes, so I am going to tell you how I would do this.
First, I would have ephemeral ids for all of my in-game objects (steel, wood, etc) and correlate those to the Sprite UID of the corresponding sprite in the inventory. That way you can match up the UIDs of the actual steel sprite to the steel entry in the id slot of the array. In other words, steel (being id #1) is stored in the 1 slot of the array (the 2nd slot in the actual data array, since it starts indexing at 0). So in the 1 slot in the array you store a number of how much of that particular item that you have.
Like:
Inventory Array: [ 0 , 12, 0, 0, 0, 9, 0, 0, 0]
ItemID to UID Array: [123, 509, 501, 629, 2011, 4094, 23, 95, 59]
ItemID to ItemName Array: ["Gems", "Steel", "Cloth", "Hides", "Wood", etc, etc, etc, etc]
Then when you craft, you simply subtract from the value in each of the corresponding array slots, for example: You want to craft a spear (or w/e)
It takes 5 steel (id 1) and 5 wood (id 5), in your inventory array at index 1 and index 5 you have values: 12 and 9, so you subtract 5 from 12 in the #1 index and 5 from 9 in the #5 index. Then if you have a stackable inventory, you simply repopulate the inventory by looping through your array and skipping any item that has a value 0 and redisplay the inventory (probably using a function).
All of this stuff is just how you track id numbers and correlate them to sprite UIDs.