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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:18:14+00:00 2026-06-17T14:18:14+00:00

Trying to pass default values to instance of ViewController object. The code compiles without

  • 0

Trying to pass default values to instance of ViewController object. The code compiles without warning and I step through and see values being set, however, when app launches the values on UI are back to zero. It’s as if I’m creating two distinct instances, but for the life of me can’t figure why initialized value are not part of launched application. Here’s implementation and main.m code. Any help is appreciated.

#import "AppDelegate.h"
#import <UIKit/UIKit.h>
#import "ViewController.h"
int main(int argc, char *argv[]) {
//NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    @autoreleasepool {
        ViewController *viewController;
        viewController = [[ViewController alloc]initWithBinauralFrequencyLeft:82.4
                                                        binauralFreqRight:82.4 
                                                              octaveValue:1
                                                         baseScaleSetting:82.4
                                                       binauralBaseVolume:800
                                                      globalBaseSongCount:0];
        int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));




        //[pool release];
        return retVal;
    }
}

-(id)initWithBinauralFrequencyLeft:(double)binauralFreqL
             binauralFreqRight:(double)binauralFreqR
                   octaveValue:(double)octaveVal
              baseScaleSetting:(double)baseScaleSet
            binauralBaseVolume:(int)binauralVolume
           globalBaseSongCount:(int)globalSongCount;
{
    self = [super init];
    if (self){
    [self setBinauralFreqL:82.4];
    [self setBinauralFreqR:82.4];
    [self setOctaveVal:1];
    [self setBaseScaleSet:82.4];
    [self setBinauralVolume:800];
    [self setGlobalSongCount:0];   
}
return self;
}

-(id)init
{
   return [self initWithBinauralFrequencyLeft:82.4 binauralFreqRight:82.4 octaveValue:1              baseScaleSetting:82.4 binauralBaseVolume:800 globalBaseSongCount:0];
}
  • 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-17T14:18:15+00:00Added an answer on June 17, 2026 at 2:18 pm

    It’s likely that the ViewController is actually being instantiated from your AppDelegate.m file – check in there. It’s probably just sending the standard init message, rather than your customised one.

    I don’t think the ViewController should be created before the call to UIApplicationMain.

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

Sidebar

Related Questions

I am trying to set some default values for an object using after_initialize .
I'm getting the following exception trying to pass an object through wcf: There was
I was trying to pass the current value of length as the default parameter
im trying to pass two parameters to a function, i being an int value
I want to pass a default argument to an instance method using the value
I've been trying to pass a std::vector to a function by reference with default
I'm trying to figure out how I can override default values of functions that
I am trying to pass two values ie.,a & b values,to the x-axis and
I'm trying to pass data into my function and if there's no data being
I am trying pass class as value in hashmap. I need to get the

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.