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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:02:25+00:00 2026-06-11T21:02:25+00:00

I have a problem with protocols. I have a class like this : @class

  • 0

I have a problem with protocols. I have a class like this :

@class SideToolBarDelegate;
@interface AuthentificationViewController : UIViewController <ASIHTTPRequestDelegate, UITextFieldDelegate,SideToolBarDelegate> {
}
...

I would like that my class “AuthentificationViewController” conforms to the protocol “SideToolBarDelegate” just i am in the iPhone version and not to conform it i am in the iPad version. How i can declare this ? thanks.

  • 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-11T21:02:27+00:00Added an answer on June 11, 2026 at 9:02 pm

    You can make some defins set in project properties and use ifdefs. Like:

    @interface AuthentificationViewController : UIViewController <ASIHTTPRequestDelegate, UITextFieldDelegate
    #ifdef IPAD
    ,SideToolBarDelegate>
    #else
    >
    #endif
    

    But this is old C way. It is a very bad idea to do this in program conforming to Object Oriented Application Design. In this case you have two more ways:

    1. make separate subclasses for iPhone and iPad
    2. make this one class as is and dont use SideToolBarDelegate methods from iPhone. This makes code clear and better to maintain in the future.

    After all I suggest making two classes for viewControllers:

    AuthentificationiPadViewController : UIViewController <ASIHTTPRequestDelegate, UITextFieldDelegate>
    AuthentificationiPhoneViewController : UIViewController <ASIHTTPRequestDelegate, UITextFieldDelegate, SideToolBarDelegate>
    

    Just think of future debugging of your code!

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

Sidebar

Related Questions

I have this problem.... in my viewcontroller.h I defined my class like this: myClass*
I have an noob problem and I would like you yo point me in
I have a design problem I'd like to solve. I have an interface, lets
I have problem with my query on C, I’m using the oci8 driver. This
I have problem with TableView its empty. In (.h) file: @interface TableViewController : UITableViewController{
Say I create a class and a protocol like this: @protocol MyProtocol @required -
I am writing a server that receives SOAP 1.2 messages. The problem I have
So, I'm extending a social media class that I have (that works with Twitter,
This is a strange problem that I am having with WCF trying to send
We have an ASP.NET web application running in IIS that uses the SoapHttpClientProtocol class

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.