Building a Shader Switch | How to get custom values from individual objects?
You do not need a custom property. You can use Object Index: 



It might also be anoying to go through all the objects and assign different numbers to each, so you could use a very simple Python script to do that for all objects that you have seleceted:

 import bpy 

 for i,o in enumerate(bpy.context.selected_objects):
     o.pass_index = i 


Add something to i if you wish to start counting from a higher number if you have some indices set already.