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 8617497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:52:26+00:00 2026-06-12T05:52:26+00:00

I’m using a serial cable bought from RedPark(ios device to RS232) for my first

  • 0

I’m using a serial cable bought from RedPark(ios device to RS232) for my first project. I already got it to work by sending and receiving data.(Not too far yet.)
How I want my app to work is iphone acts as Master in the communication by sending commands and external device reply with the data required.

And lots of times, I need to ask for several data package at a same time.

I ran into a problem that is the readByteAvaible() provided by RedPark, event driven, So I can’t send several commands together in viewDidLoad or other methods.
I’ve tried different ways to get all the packages I need. Like multithread. None of them works. From the library FAQ, it’s said “you must be returned to your run loop before these are processed”.

I’m still fairly new to objective C, and still feel a little confused. Can anyone tell me how to achieve this? Or maybe some information about main run loop of objective C?

  • 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-06-12T05:52:27+00:00Added an answer on June 12, 2026 at 5:52 am

    The run loop is Cocoa’s version of an event loop. So it’s just a queue of things to do. Objective-C is dynamic so that list tends to be targets and selectors; this isn’t like one of the old purely static runtimes like Win32 or the Mac Classic Toolbox where you’d need to wait for a messages struct then enter some elaborate branches based on message type.

    Run loops and threads have a one to one relation and the main run loop is that which runs on the main thread.

    On the whole, if you put no extra thought into it whatsoever then all of your code will occur on the main run loop because UIKit, which provides all the controls, works only on the main run loop.

    So, supposing you had a UIButton and it were wired up to call the didPressButton: then:

    - (IBAction)didPressButton:(id)sender
    {
        // this code is running on the main run loop
    
        NSLog(@"I'm executing on the main run loop");
    
        // when this method ends, control will return to the run loop
    }
    

    You probably don’t want to multithread, you probably just want to schedule on the run loop.

    You can use the performSelectorOnMainThread: methods to schedule something on the main run loop from anywhere. If you’re already on the main thread you can just use performSelector:withObject:afterDelay: to schedule something to happen on the main run loop but only after whatever else is already scheduled. You can pass a delay of 0.0 to have it happen next but also give anything else already scheduled to happen next a chance to run.

    RedPark’s SDK becomes available only once you hand over your email address so I declined to do so; can you give us any more information on exactly how it’s formulated? Is it blocks or callbacks or delegates or something else?

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.