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 07-08-2010, 05:57 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: Spain
Posts: 176
lefty is on a distinguished road
Default won't compile in SDK4?

I compiled my project with SDK4 and now I get the following compile error:
"usleep was not declared in this scope"
this compiled fine in the previous SDK, so they must have changed something. Anyone know of a fix?
lefty is offline   Reply With Quote
Old 07-08-2010, 06:02 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 8
Spyder9 is on a distinguished road
Default

man usleep

#include <unistd.h>
Spyder9 is offline   Reply With Quote
Old 07-08-2010, 06:02 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: Spain
Posts: 176
lefty is on a distinguished road
Default

Quote:
Originally Posted by lefty View Post
I compiled my project with SDK4 and now I get the following compile error:
"usleep was not declared in this scope"
this compiled fine in the previous SDK, so they must have changed something. Anyone know of a fix?
nevermind, I fixed it. Seems like you need a new include now:
#include <unistd.h>
lefty is offline   Reply With Quote
Old 07-08-2010, 11:14 AM   #4 (permalink)
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

Are you sleeping your own thread that you created, or the main thread? You should probably not sleep the main thread. That would prevent touches and other events from reaching your app during the sleep.

I'd look into NSTimer or performSelector:withObject:afterDelay: instead. That's a better way to delay something.
__________________

Free Games!
smasher is offline   Reply With Quote
Old 07-08-2010, 12:07 PM   #5 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: Spain
Posts: 176
lefty is on a distinguished road
Default

Don't worry, it's not in the main thread
lefty is offline   Reply With Quote
Reply

Bookmarks

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: 344
14 members and 330 guests
akacaj, c2matrix, cgokey, esoteric, EXOPTENDAELAX, GHuebner, givensur, HemiMG, Mirotion22, mjnafjke, Pudding, SLIC, Sloshmonster, Sonuye857
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,652
Threads: 94,115
Posts: 402,887
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Sonuye857
Powered by vBadvanced CMPS v3.1.0

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