It's the same thing. iOS is controlled by Apple. Twitter's API is controlled by Twitter. Both invite developers to develop on their platform so they can reap the benefit of increased user functionality.
If my operating system has a rootkit or APT I am boned. If twitter is hacked I couldn't give a fuck, it doesn't affect my equipment or how I use my computers.
However, You're completely arguing a point that is different from what the entire discussion is about. We're talking about proprietary control points. The iOS operating system is proprietary and the App store dictates who and who can't publish on it.
The same is the case with Twitter. It has APIs and they control who and who can't use them to make apps.
Both companies have invited developers to make apps. Both companies have benefited from having those apps make their services/devices useful.