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

  • Home
  • SEARCH
  • 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 6943865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:12:43+00:00 2026-05-27T13:12:43+00:00

In my code, I’ve customized the initWithNibName to receive some data it needs to

  • 0

In my code, I’ve customized the initWithNibName to receive some data it needs to do it’s thing. Here’s the code:

    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil theArray:(NSArray *)theDataArray theVal:(NSInteger)theDataValue bRange:(BOOL)isRange bColor:(BOOL)isColor{

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.data = theDataArray;
        self.selectedValue = theDataValue;
        NSLog(@"NCG - initWithNibName setting selectedValue = %d.", self.selectedValue);
        //self.originalValue = theDataValue;
        self.isTheRange = isRange;
        self.isTheColor = isColor;
        self.selectedIndex = [self indexFromValue:theDataValue bRange:self.isTheRange bColor:self.isTheColor];
        self.doneClicked = NO;
        //NSLog(@"Selected Row = %d.", self.selectedIndex);
    }
    return self;
}

When this view runs, it updates self.selectedValue to a new value. I need this value in the view that pushed this view once this view is popped.

How do I get this data?

  • 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-27T13:12:43+00:00Added an answer on May 27, 2026 at 1:12 pm

    When I have this I usually have a ‘parentReference’ data member
    ex:

    #import "A.h";
    #import "B.h";
    
                @implementation A
    
                    - (void) f
                    {
                      B *bInstance = [[B alloc] init];
                      bInstance.parentRef = self;
    
                      [self.navigationController pushViewController: bInstance];
                    }
    

    //while ‘B’ class is declared like

    @class A;
    @interface B : UIViewController
    {
      A *parentRef;
    }
    @property (nonatomic, assign) A *parentRef;
    

    that way, you can go back to the class that ‘summoned’ you and do whatever you want

    (you might think that [self.view superview] == parentRef , but that’s not true)

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

Sidebar

Related Questions

Code and preview: <html> <head> <title>Testing some CSS</title> <style type=text/css> .dDay { font-size:205% }
Code in here: jsfiddle Demo I wanna to get the div#content height when it
Code: public class SMH extends Activity { public void onCreate(Bundle b) { super.onCreate(b); setContentView(R.layout.main);
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Code can be found here: http://www.myhorizon.ca/client_central/sortable_test.php Hello folks of Stackoverflow, I have a list
code is here I am trying to make the Parent element visible when the
Code that was working fine last week is suddenly throwing this exception: System.Data.SqlClient.SqlException (0x80131904):
Code below does not run correctly and throws InvalidOperationExcepiton . public void Foo() {
Code: <html xmlns=http://www.w3.org/1999/xhtml> <head> <title>Unusual Array Lengths!</title> <script type=text/javascript> var arrayList = new Array();
Code I have: cell_val = CStr(Nz(fld.value, )) Dim iter As Long For iter =

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.