is there a way i can test my app before submitting to app store for being not rejected by apple?
Go to walmart, buy an ipod touch, test your app out, return the ipod touch back to walmart and get your money back. 30 day return policy, should give you plenty enough time to test your app out.
If you plan on making more apps I would just buy an ipod touch and keep it!
The iPhone SDK download includes an iPhone simulator that you can test apps on. If you mean a test that will give you a "yes or no" answer for the question "will Apple accept this app?" however, then no, there is no such test since the acceptance criteria for the App Store are not rigid (nor even necessarily objective).
For rejection by Apple, no. There are some common-sense things you can to do prevent most rejections, but you can never be completely certain. Never use private, undocumented APIs, no matter how much you are tempted by them. Other known rejection reasons are listed here.
The vast majority of rejections are fixable (you persisted a selection in a table view by accident, you used a confusing icon choice in part of your application, or it crashes in a specific case). Others are harder to address, like duplicating the functionality of something built into the device.
For functional and usability testing, this is a question that has been asked several times here:
- "What is your iPhone app testing strategy?"
- "iPhone OS Testing Best Practices"
- "How do you beta test an iphone app?"
In general, learn how to use Instruments, Shark, GDB, the Clang Static Analyzer, and other development tools provided by Apple to profile and debug your application, then examine it from every direction on an actual device for a few days before submitting it for review. Do not submit an application with known crashing bugs.