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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:42:52+00:00 2026-06-11T03:42:52+00:00

Hi i am new to the iOS. I have 2 classes one is parent

  • 0

Hi i am new to the iOS.

I have 2 classes one is parent class and another one is child class. i am having one method in parent class that will create a UIScrollView. and i am trying to call that parent class method from child class by creating object of parent class. that method is called when i am calling from child class but it does not create a UIScrollView if i call same method in parent class by using self it creates UIScrollView.

I do not know where i am making problem. Please guide me

//scrollview creation method in parent class//

  -(void)creatingScroll
{
UIScrollView * propertyScrl = [[UIScrollView alloc]initWithFrame:CGRectMake(10, 200, 320, 160)];
propertyScrl.scrollEnabled = YES;
propertyScrl.showsHorizontalScrollIndicator = YES;
propertyScrl.contentSize = CGSizeMake(600, 60);
propertyScrl.backgroundColor = [UIColor redColor];
[self.view addSubview:propertyScrl];

}

//calling above method from child class//

    ParentViewController *vc = [[ParentViewController alloc]init];

    [vc creatingScroll];
  • 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-11T03:42:53+00:00Added an answer on June 11, 2026 at 3:42 am

    u are creating another object of ParentViewController and calling creatingScroll method on that object, which is not the view that is pushed onto your viewController.

    U can call the parent class method by using protocols & delegates.

    please refer http://mobiledevelopertips.com/objective-c/the-basics-of-protocols-and-delegates.html

    hope it helps. happy coding 🙂

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

Sidebar

Related Questions

New to iOS, I have to make an app that will show photos and
I have a new iOS app and would like to add facebook integration. One
If I create a category on one of the core classes in IOS, Eg
Hello.Am new to ios development.What have to do for NSOpenPanel to work in the
I'm using the new iOS 5 core data concurrency options. I have two threads:
I'm quite new here. I have a problem with the new iOS 5.1 slide-in
First of all I have to say I am new to iOS development. My
I am new to iOS projects. In my current project, I have to process
I am completely new to Xcode and iOS developing in general. Basically I have
I'm a new iOS programming and I'm developing a simple iPhone game that needs

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.