Click Home/Setup button on your printer. Select Network/Wireless. Choose WLAN setup / WIFI setup. It will search for available accesspoints.
Select your Accesspoint (wireless name) from the list and it will ask for wireless password (network key). Enter the correct password, and it will say connected to accesspoint.
Make sure that you are entering the correct password, because it is case sensitive. If all are correct, it will say connected to accesspoint.
Then, follow the instructions below on your computer.
Choose System Preferences from the Apple menu.
Choose Print & Fax (or Print & Scan) from the View menu.
Hold down the Option key on your keyboard while clicking the "-" (minus sign that you see on the print & scan window, along with a + sign) button. Then, choose Reset Printing System.
If no printers are currently added, hold down the Control key while clicking in the box that appears above the "+" (plus sign that you see on the print & scan window, and not on the keyboard) button, then choose Reset printing system… from the contextual menu.
Then, click the + (plus sign that you see on the print & scan window, and not on the keyboard) sign to add printer. Select your printer from the list.
Note : Make sure that you are resetting the printing system before adding the printer.