Q.Potted tomatoes.
I live in an apartment and I have a rather small patio, and I have tried for two years to grow just one tomato plant with this year being the wrist. I still have the plant in the pot but from May to September I had no tomatoes. I was about to trash the plant and I spotted the first tomato, so I stopped and examined the plant further and found five more tomatoes.It is now November and the tomatoes are not mature yet. What am I doing wrong. I live in northern California now and am from Illinois and I have never had this problem before. My direct sun is very limited and I wonder if that could be the problem. Last year was not much better either. I have very large bushy plants both years. Help.

Yes this does look like a lack of light. For tomatoes to flower and fruit correctly, they will depend on the day and night temperatures to remain pretty stable and constant. 15 degrees or more of a difference will set them into a vegetative state, where they will only produce leaves.
I am, mostly, an indoor gardener myself. The trick with tomatoes in containers is Lots and LOTS of good quality lighting, whether it be synthetic, or at least 8 hours of natural sunlight per day. To give you an idea... I use a 750 watt KIND LED panel for a 5x5 area which houses tomatoes along with other tropical trees such as mangoes, citrus, and plants that are also tropical, such as pineapples and pitcher plants. All of these plants have one thing in common (with the exception of the pitcher plant which sits in the shade of my tomatoes...) They all require a ridiculous amount of light to perform properly.
You will also want to feed extra fertilizers, mostly in the form of potassium and phosphorus, but a little nitrogen helps too. Dolomitic lime will prevent pH swings, and keep your tomatoes from developing blossom end rot.