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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:29:42+00:00 2026-05-23T15:29:42+00:00

I am accessing object of one class in the another class. But instance variable

  • 0

I am accessing object of one class in the another class. But instance variable is Showing null.

This is my code.

fvcObj = [[FirstViewController alloc]init];
NSLog(@"%@",fvcObj.user);

Which things to take care in declaring object of another class?
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-05-23T15:29:42+00:00Added an answer on May 23, 2026 at 3:29 pm

    As PengOne has said it is a new instance of the class FirstViewController and it cannot hold the data which you have assinged to the “user” variable in FirstViewController class. I think you want to pass data from one view controller class to other. If so then declare a method in the class to which you want to send the data and call this method from the other class and pass the data as a parameter of the method.
    Hope this might help u.
    Happy coding

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

Sidebar

Related Questions

when accessing foo() of base using derived class's object. #include <iostream> class base {
how does one go about accessing a decorator from a base class in a
Hopefully this will be an easy one to answer. I created a class in
This is a slightly different question to this one ([ Accessing a method from
Been using Django for < 1yr now, but this one is new-to-me. Hopefully someone?
Django uses Meta class for lots of additional object information. However, they store this
Note : Part of a series: C#: Accessing form members from another class and
Sometime this weekend one of our databases (11.1.0.7) began having problems accessing certain folders
When accessing an object in a DataTable retrieved from a database, are there any
I am having a problem accessing the ViewData object through javascript. I have set

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.