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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:10:36+00:00 2026-05-27T18:10:36+00:00

I have an application where when I pass an object into the method sometimes

  • 0

I have an application where when I pass an object into the method sometimes the object’s value is changed to null. I could not find any thing like this in blogs, please suggest what I should do. I feel that is it like pass by reference or value but don’t know much.

The variable declare in *.h file like

     NSNumber* resultSelectedWeekValue;

and property

     @property (nonatomic, retain) NSNumber* resultSelectedWeekValue;

and in implimentaion

    @synthesize resultSelectedWeekValue =       _resultSelectedWeekValue;

This is delegate method which get the value from one popover

// Show discription of Selected week
         -(void) getSelectedWeekDelegateMethod:(NSString*) getSelectedWeek {

        _resultSelectedWeekValue = [_dbObject getSelectedWeekValue:getSelectedWeek];

        NSLog(@"This is _tempOzs %@ ", _resultSelectedWeekValue);

        if ([_productAttributePopover isPopoverVisible]) {

          [_productAttributePopover dismissPopoverAnimated:YES];
       }
  }

      NSLog(@"This is _resultSelectedWeekValue %@ and class %@", _resultSelectedWeekValue, [_resultSelectedWeekValue class]);  // This say the object is deallocate? this is the code below

if ((_resultSelectedWeekValue != nil) && (_tempGranularProduct != nil || _tempLiquidProduct != nil) && ( _tempLbs != nil || _tempOzs != nil)) {

    if ([_tempLbs intValue] != 0) {

        NSDate* _createdDate = [NSDate date];
        //Create the dateformatter object
        NSDateFormatter* _formatter = [[[NSDateFormatter alloc] init] autorelease];
        //Set the required date format
        [_formatter setDateFormat:@"yyyy-MM-dd"];
        //Get the string date
        NSString* _formatDate = [_formatter stringFromDate:_createdDate];
        NSNumber* _getNumBags = [self calculateGranularBags];
        NSNumber* _getProductID = [[_dbObject getAppliedProductWeightAttribute:_tempGranularProduct] objectForKey:@"productid"];
        NSNumber* _totalInvestment = [[NSNumber alloc] initWithInt:0];


        NSLog(@"This is _tempScenarioId %@ and class %@", _tempScenarioId, [_tempScenarioId class]);
        NSLog(@"This is _resultSelectedWeekValue %@ and class %@", _resultSelectedWeekValue, [_resultSelectedWeekValue class]);
        NSLog(@"This is _getProductID %@ and class %@", _getProductID, [_getProductID class]);
        NSLog(@"This is _tempLbs %@ and class %@", _tempLbs, [_tempLbs class]);
        NSLog(@"This is _getNumBags %@ and class %@", _getNumBags, [_getNumBags class]);
        NSLog(@"This is _totalInvestment %@ and class %@", _totalInvestment, [_totalInvestment class]);
        NSLog(@"This is _tempCarryover %@ and class %@", _tempCarryover, [_tempCarryover class]);



        NSMutableDictionary* _scenarioProductAttribute = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                  _tempScenarioId, @"scenarioid",
                                                  _resultSelectedWeekValue, @"weekvalue",
                                                  _getProductID, @"productid",
                                                  _tempLbs, @"lbper1000ft",
                                                  _getNumBags, @"numberofbags",
                                                  _totalInvestment, @"totalinvestment",
                                                  _tempCarryover, @"carry_n",
                                                  _formatDate, @"date",
                                                  nil];
        [_totalInvestment release];

        _tempScenarioId = [_dbObject insertScenarioProductAttribute:_scenarioProductAttribute andScenarioId:_tempScenarioId andProductId:_getProductID andSelectedWeekValue:_resultSelectedWeekValue];

        // Check Point
        [TestFlight passCheckpoint:@"INSERT_GRANULAR_RECORD"];
    } 

    if ([_tempOzs intValue] != 0) {

        NSDate* _createdDate = [NSDate date];
        //Create the dateformatter object
        NSDateFormatter* _formatter = [[[NSDateFormatter alloc] init] autorelease];
        //Set the required date format
        [_formatter setDateFormat:@"yyyy-MM-dd"];
        //Get the string date
        NSString* _formatDate = [_formatter stringFromDate:_createdDate];
        NSNumber* _getGallons = [self calculateLiquidGallons];
        NSNumber* _getProductID = [[_dbObject getAppliedProductWeightAttribute:_tempLiquidProduct] objectForKey:@"productid"];
        NSNumber* _totalInvestment = [[NSNumber alloc] initWithInt:0];


        NSLog(@"This is _tempScenarioId %@ and class %@", _tempScenarioId, [_tempScenarioId class]);
        NSLog(@"This is _resultSelectedWeekValue %@ and class %@", _resultSelectedWeekValue, [_resultSelectedWeekValue class]);  // This say the object is deallocate?
        NSLog(@"This is _getProductID %@ and class %@", _getProductID, [_getProductID class]);
        NSLog(@"This is _tempOzs %@ and class %@", _tempOzs, [_tempOzs class]);
        NSLog(@"This is _getGallons %@ and class %@", _getGallons, [_getGallons class]);
        NSLog(@"This is _totalInvestment %@ and class %@", _totalInvestment, [_totalInvestment class]);
        NSLog(@"This is _tempCarryover %@ and class %@", _tempCarryover, [_tempCarryover class]);



        NSMutableDictionary* _scenarioProductAttribute = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                                          _tempScenarioId, @"scenarioid",
                                                          _resultSelectedWeekValue, @"weekvalue",
                                                          _getProductID, @"productid",
                                                          _tempOzs, @"ounces",
                                                          _getGallons, @"gallons",
                                                          _totalInvestment, @"totalinvestment",
                                                          _tempCarryover, @"carry_n",
                                                          _formatDate, @"date",
                                                          nil];
        [_totalInvestment release];
        _tempScenarioId = [_dbObject insertScenarioProductAttribute:_scenarioProductAttribute andScenarioId:_tempScenarioId      andProductId:_getProductID andSelectedWeekValue:_resultSelectedWeekValue];
  • 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-27T18:10:37+00:00Added an answer on May 27, 2026 at 6:10 pm

    change the line to:

    self._resultSelectedWeekValue = [_dbObject getSelectedWeekValue:getSelectedWeek];
    

    if you were facing issues with the “_resultSelectedWeekValue” variable value.

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

Sidebar

Related Questions

Anyone have idea how to pass value from iPhone application to the REST-Webservice using
I have an application that uses simple sockets to pass some characters between two
I have an application in which I need to pass an array from C#
I have a java application I need to pass some info to a C++
I have to use an other application (console) to pass some parameter to this
I have to pass information from a desktop application to Web application and vice
I have an activity that implements LocationListener in my application and my onLocationChanged method
So I have an asp.net Web Application (Not Web Site) that I am trying
Is it possible to pass a pointer to an object into a DLL, initialize
I have a List(Of AddlInfo) with AddlInfo being an object. I'm trying to pass

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.