user390187
user390187

Reputation: 63

integrating twitter in my iphone application

i am integrating twitter in my iphone music application.i.e when a user clicks a song and then he click on the twitter tab the login page of twitter should be opened and when he enters his username and password and then he clicks on the post button the song name and the comment he has entered in the textview should be posted to his twitter id. the problem is that when i am clicking on the post button on the command it is showing as posted but then suddenly the program stops giving me an error of “EXC_BAD_ACCESS”.

Please help in solving the problem

Upvotes: 0

Views: 181

Answers (2)

Gidogeek
Gidogeek

Reputation: 1307

You can use Instruments with the Zombie template to find the solution to this bug. You're probably trying to message a deallocated object.

EDIT: On the WWDC Session video's there is a video with a nice and good explanation how to find these kind of bugs. You must be a registered developer to access these videos though.

May I recommend using ShareKit for Social Media integration ? http://getsharekit.com/ I've used this myself and it's by far the easiest solution of integrating social media interaction in your app.

Hope this helps.

Upvotes: 2

Lou Franco
Lou Franco

Reputation: 89232

I wrote a blog that gives several approaches to finding EXC_BAD_ACCESS

http://loufranco.com/blog/files/debug-iphone-crash-EXC_BAD_ACCESS.html

Here is what is happening -- Your program is running a line of code that tries to read or write to a memory location that hasn't been mapped for your application. The most likely reason for this is that you have a bug that is corrupting memory or you are sending messages to deallocated objects.

It is very likely that the line of code that is running is not the bug -- it happened sometime before this.

I strongly recommend a Build and Analyze and scan-build, because it finds these kinds of bugs a lot. It will likely flag a lot of code in your project -- you should address each problem because it's likely a real problem that will cause a leak or crash.

After that, try suggestion #4 in the blog which will instruct the simulator to never deallocate any objects -- once an object is in the state where it would be deallocated, it will warn you if anyone sends it a message. This would have caused EXC_BAD_ACCESS, but now gives a good description of what is happening.

Obviously, you need to turn this off in the real application (or have a lot of leaks).

Upvotes: 1

Related Questions