Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-03-2010, 02:50 PM   #1 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 31
richifie is on a distinguished road
Angry Help?!?!?!!?- Timer coding problem (Maybe)

I'm relatively new to coding- i've made some apps (but haven't published them).I have now started a more complicated app.

So here's my problem
1. I managed to get my figure bouncing
2. but when i add in the code to make it move left and right using gravity (below) and i try and run it this time the entire app crashes after about three seconds. I have narrowed it down to one piece of code-

moveLeft = [NSTimer scheduledTimerWithTimeInterval:0.015 target:self selector:@selector(goLeft) userInfo:nil repeats:YES];

-Which is a basic timing code-

After 3 seconds of running it exits saying- Debugging interrupted.

What went wrong??? PLEASE HELP

Last edited by richifie; 06-03-2010 at 04:02 PM.
richifie is offline   Reply With Quote
Old 06-03-2010, 03:13 PM   #2 (permalink)
A Single-Serving Friend
 
Join Date: Mar 2010
Location: Groningen, NL
Posts: 491
Robert Paulson is on a distinguished road
Default

Hi and welcome.

The method call looks just fine. Although the interval is really small... I think you should be posting your goLeft method because it may cause problems if it is called that often.

Also, please try to give your next thread a meaningful title. Everyone around here wants help so your title doesn't convey any information. Thanks.

Cheers,
Bob
__________________
We are God’s middle children, according to Tyler Durden, with no special place in history and no special attention.

Consider saying thanks by buying my app. :]
Robert Paulson is offline   Reply With Quote
Old 06-03-2010, 03:37 PM   #3 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 31
richifie is on a distinguished road
Angry

Quote:
Originally Posted by Robert Paulson View Post
Hi and welcome.

The method call looks just fine. Although the interval is really small... I think you should be posting your goLeft method because it may cause problems if it is called that often.

Also, please try to give your next thread a meaningful title. Everyone around here wants help so your title doesn't convey any information. Thanks.

Cheers,
Bob
Thanks for the reply. I will remember that for the future. If i remove that snippet of code it works perfectly! Any ideas what the problem is? Anyone?
richifie is offline   Reply With Quote
Old 06-03-2010, 03:40 PM   #4 (permalink)
Amateur Nutcase
iPhone Dev SDK Supporter
 
DeltaP's Avatar
 
Join Date: Jul 2009
Location: FDL, WI
Posts: 237
DeltaP is on a distinguished road
Send a message via AIM to DeltaP Send a message via Skype™ to DeltaP
Default

Quote:
Originally Posted by richifie View Post
Thanks for the reply. I will remember that for the future. If i remove that snippet of code it works perfectly! Any ideas what the problem is? Anyone?
Change the interval to .05 and see what happens.
__________________
Follow me on Twitter!
If I helped you out, check out my apps!
DeltaP is offline   Reply With Quote
Old 06-03-2010, 03:52 PM   #5 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 31
richifie is on a distinguished road
Angry

Quote:
Originally Posted by DeltaP View Post
Change the interval to .05 and see what happens.
I tried that. Exactly the same thing happened- about 3 seconds then crash.

Would more of my code maybe help
richifie is offline   Reply With Quote
Old 06-03-2010, 08:25 PM   #6 (permalink)
A Single-Serving Friend
 
Join Date: Mar 2010
Location: Groningen, NL
Posts: 491
Robert Paulson is on a distinguished road
Default

Quote:
Originally Posted by myself
I think you should be posting your goLeft method because it may cause problems if it is called that often.


Cheers,
Bob
__________________
We are God’s middle children, according to Tyler Durden, with no special place in history and no special attention.

Consider saying thanks by buying my app. :]
Robert Paulson is offline   Reply With Quote
Old 06-04-2010, 11:31 AM   #7 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 651
kapps11 is on a distinguished road
Default

Quote:
Originally Posted by richifie View Post
I tried that. Exactly the same thing happened- about 3 seconds then crash.

Would more of my code maybe help
More code would be great. I have a feeling that since you call this method so often, it is probably a memory problem, but im not sure
kapps11 is offline   Reply With Quote
Old 06-04-2010, 12:00 PM   #8 (permalink)
A Single-Serving Friend
 
Join Date: Mar 2010
Location: Groningen, NL
Posts: 491
Robert Paulson is on a distinguished road
Default

Ye, that was my guess as well. Like a memory leak in your goLeft method. But to find the potential problem, we'd need to see the code.

Cheers,
Bob
__________________
We are God’s middle children, according to Tyler Durden, with no special place in history and no special attention.

Consider saying thanks by buying my app. :]
Robert Paulson is offline   Reply With Quote
Old 06-05-2010, 04:46 AM   #9 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 31
richifie is on a distinguished road
Smile Sorted

Quote:
Originally Posted by Robert Paulson View Post
Ye, that was my guess as well. Like a memory leak in your goLeft method. But to find the potential problem, we'd need to see the code.

Cheers,
Bob
For some reason i just re-wrote the code that had the problems and it's working perfectly!

Thanks 4 all the help!

I guess we'll never know what was wrong...

Cheers all.
richifie is offline   Reply With Quote
Old 06-05-2010, 06:27 AM   #10 (permalink)
A Single-Serving Friend
 
Join Date: Mar 2010
Location: Groningen, NL
Posts: 491
Robert Paulson is on a distinguished road
Default

Well, whatever you did to make it work: I'm glad it does.

Cheers,
Bob
__________________
We are God’s middle children, according to Tyler Durden, with no special place in history and no special attention.

Consider saying thanks by buying my app. :]
Robert Paulson is offline   Reply With Quote
Reply

Bookmarks

Tags
experienced, line, problem, timer, xcode

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 354
13 members and 341 guests
ajay123123, Anwerbl, Arty Tales, ashaman64, baja_yu, ChrisYates, HemiMG, mini998, mottdog, newDev, Objective Zero, oceanlablight, Steven.C
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,878
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:59 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0