The wiring in the apt. should not cause a problem provided the switch was hooked up correctly. You should of hooked both the black wired together and connected them to the power in (line) on the switch. The power out(load) should go to the light only. If the light turns on and off, it is probaly hooked up correctly but check to be sure. Make sure the line and load are not reversed.
You may have a bad switch.
Chris Couture