Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 908395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:42:43+00:00 2026-05-15T16:42:43+00:00

How can I loop right in the middle of objective c? For example in

  • 0

How can I loop right in the middle of objective c? For example in the .m file:

#import "untitled.h"


@implementation untitled

- (IBAction) runSample:(id)sender {
(this is running when the button is pressed)
}

(Something here that just constantly repeat that won't mess anything else up)

@end

Any ideas??

Elijah

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:42:44+00:00Added an answer on May 15, 2026 at 4:42 pm

    Short answer; don’t. You don’t ever want to loop actively in a Mac OS X or iPhone application. It burns CPU, makes the UI unresponsive, and is otherwise very inefficient. And you really don’t want to block the main event loop on either platform; on Mac OS X it leads to the rainbow cursor while on the iPhone, your app will be killed.

    Even Modal Event Loops aren’t really active loops; they are a way to grossly limit the kind and scope of events processed by your app.

    The best thing you can do is set yourself up in the run loop to receive whatever events you need. You can also use timers, if you need, but — again — polling is to be actively avoided.

    The Threaded Programming Guide provides information about run loops and otherwise doing processing such that you don’t block the main event loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I iterate over each file in a directory using a for loop?
For some reason i can't seem to get this right ok i have 2
I know I can loop over the string or build a regex or invert
How can I build a loop in JavaScript?
How can polymorphism replace an if-else statement or Switch inside of a loop? In
Can you cast a List<int> to List<string> somehow? I know I could loop through
You can, obviously, put a variable declaration in a for loop: for (int i
If I have a for loop which is nested within another, how can I
I have an comma seperated list of values held as a string: blue, left-right-middle,
Possible Duplicate: Difference between i++ and ++i in a loop? Can anyone explain what's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.