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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:33:48+00:00 2026-05-26T22:33:48+00:00

Typically, I would call another class method like this: MyClass *class = [[MyClass alloc]

  • 0

Typically, I would call another class method like this:
MyClass *class = [[MyClass alloc] init];
[class myMethod];

But the problem is that, it will call the ViewDidLoad. That is a problem for me.

Is there any way to access a property in another method or call a class in another method without calling the ViewDidLoad?

Thanks!

Edit1: So are you are saying that if I do this it will not call my VDL?:

MyClassB *classB = [[[MyClassB alloc] init] autorelease];
[classB.pauseButton setHidden:NO];

Also how about when I call a method will that trigger the ViewDidLoad?

  • 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-26T22:33:49+00:00Added an answer on May 26, 2026 at 10:33 pm

    Sure; refactor myMethod to not call viewDidLoad.

    That is, if you call method a and method a calls b, but you don’t want to call b, then you need to modify the implementation of a to sometimes not call b. Either by modifying a or creating a new method c on the class containing a that doesn’t call b.

    If the problem is that you are calling a method in the system frameworks and it is calling viewDidLoad when you don’t want, then the answer is that you really can’t do what you think you want to do. But that is just a symptom; the real answer is that your app’s architecture needs to be revisited to better fit with the system’s frameworks.


    Edit1: So are you are saying that if I do this it will not call my
    VDL?:

    MyClassB *classB = [[[MyClassB alloc] init] autorelease];
    

    That is creating a new instance of MyClassB. If there is already an instance being displayed on screen, then you most likely do not need a new instance and, yes, that is the reason why viewDidLoad is being called.

    Either create an instance variable that can point to the already existing instance of classB or otherwise have a means of grabbing that instance; hang it off the app delegate or something.

    Overall, it sounds like you are confused about what it means to instantiate an object vs. simply referring to one and how all that fits into the UIKit model of app creation. It is a bit tricky until you get the hang of it. Study some of the many examples that show how to use view controllers as they will likely have solved a similar problem.

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

Sidebar

Related Questions

I can use Eric Martin's simplemodal somewhat. But I would like to call it
How would one typically create a dynamic factory method in PHP? By dynamic factory
When working with Domain Objects, how do you typically unit test a method that
This benchmark appears to show that calling a virtual method directly on object reference
How would one typically implement a service layer in an MVC architecture? Is it
I would like to have reusable ratings (typical layout with 5 stars). I have
I would select multiple DOM elements using a typical code such as this: $('#ele1,
During a typical day programming, I implement functions in a way that I would
I have a typical form_for for registering user. But in the end I would
Typically when writing new code you discover that you are missing a #include because

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.