Having a residence in a state does not necessarily make you a resident of that state. Many athletes, and people of other professions, buy property outside of their legal state of residence, and they only live there for certain periods of time.
For the regular Joe, unless you owned it prior to 1986, and you registered it at that time, and every year since, you can not possess a handgun in the city of Chicago, and I am pretty sure, in all of Cook County. Not even with an FOID. You can register long guns, but not handguns. You can buy handguns on the outskirts of Chicago, with a Chicago address on your FOID and drivers license all day long. But you aren't supposed to bring it into Chicago. Not even in a locked case, in your locked trunk, passing through on the freeway, on your way to a free state.