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

  • SEARCH
  • Home
  • 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 6588459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:03:03+00:00 2026-05-25T17:03:03+00:00

I am attempting to write an app for iOS that will take advantage of

  • 0

I am attempting to write an app for iOS that will take advantage of iOS 4.0 features, but also work on an earlier version of the OS (3.1.3). I have set the deployment target to 3.1.3 and the Base SDK to 4.3 (latest)

Specifically, I am trying to take advantage of the ability to intercept commands from the remote control.

The document linked below is very useful in explaining how to (at run-time) check for the presence of classes and methods, but I still get a compiler error when attempting to reference an enum from the UIEvent class which only appears in iOS 4.0 and later.

https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-SW3

Here is the section of code which causes the compilation to fail:

- (void)remoteControlReceivedWithEvent:(UIEvent *)receivedEvent {   
    if (receivedEvent.type == UIEventTypeRemoteControl) {
        switch (receivedEvent.subtype) {
            case UIEventSubtypeRemoteControlTogglePlayPause:
                [self playPauseAction:nil];
                break;
            case UIEventSubtypeRemoteControlPreviousTrack:
                [self previousChapter:nil];
                break;
            case UIEventSubtypeRemoteControlNextTrack:
                [self nextChapter:nil];
                break;
            default:
                break;
        }
    }
}

The compiler complains that:

error: 'UIEventTypeRemoteControl' undeclared (first use in this function)

UIEventTypeRemoteControl is an enum that isn’t defined until 4.0
(from UIEvent.h)

typedef enum {
    UIEventTypeTouches,
    UIEventTypeMotion,
    UIEventTypeRemoteControl,
} UIEventType;

typedef enum {
    // available in iPhone OS 3.0
    UIEventSubtypeNone                              = 0,
    
    // for UIEventTypeMotion, available in iPhone OS 3.0
    UIEventSubtypeMotionShake                       = 1,
    
    // for UIEventTypeRemoteControl, available in iOS 4.0
    UIEventSubtypeRemoteControlPlay                 = 100,
    UIEventSubtypeRemoteControlPause                = 101,
    UIEventSubtypeRemoteControlStop                 = 102,
    UIEventSubtypeRemoteControlTogglePlayPause      = 103,
    UIEventSubtypeRemoteControlNextTrack            = 104,
    UIEventSubtypeRemoteControlPreviousTrack        = 105,
    UIEventSubtypeRemoteControlBeginSeekingBackward = 106,
    UIEventSubtypeRemoteControlEndSeekingBackward   = 107,
    UIEventSubtypeRemoteControlBeginSeekingForward  = 108,
    UIEventSubtypeRemoteControlEndSeekingForward    = 109,
} UIEventSubtype;

So how do I stop the compiler complaining about it?

Also – how do i stop the compiler warnings that someClass may not respond to someMethod (where I check at runtime if that class does actually respond to the method, before calling it.) I suppose I could turn off that warning in the compiler settings – but it’s a useful warning in other cases.

  • 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-25T17:03:03+00:00Added an answer on May 25, 2026 at 5:03 pm

    OK – Here’s what I have discovered:

    1. Switching the deployment_target to 4.3 then 3.1.3 causes the compilation errors and warnings to appear.

    2. Once they appear you can get rid of them by compiling using a simulator scheme.

    3. Once you have done that, you can compile using a real device scheme and the errors and warnings are gone.

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

Sidebar

Related Questions

I am attempting to write a C# app that will attach to the 2008
I'm attempting to write a small app that will do something similar to what
I am attempting to write a one-line Perl script that will toggle a line
TiSDK 1.7.1 iOS 5.0 I'm attempting to take the URL of an image that
I'm attempting to write an app that can arrange timed playback of some (mostly
I'm attempting to write an iPhone App that automates actions on a certain website.
I'm attempting to make an iOS app communicate with a server that uses Bonjour
I am attempting to write a service, that will every X minutes attempt to
I'm attempting to write an app that involves connecting two android devices via bluetooth.
So I'm attempting to write a Django reusable app that provides a method for

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.