How can set label value of window B from window A?

Discussion in 'Mac Programming' started by newformac, May 25, 2011.

  1. macrumors regular

    Joined:
    May 24, 2011
    #1
    Hi all,

    i am having two window form Window A and Window B.

    i m open Window B from Window A,now i want to set text label value of Window B from Window A .

    please tell me how can i do this?

    thanks in advance.
     
  2. macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    #2
    Could you explain what you mean by "set text label value of Window B from Window A"?

    And could you further explain how we can know whether you are writing for MacOS X, using Cocoa or Carbon, iOS, which version, Linux, Windows or whatever?
     
  3. thread starter macrumors regular

    Joined:
    May 24, 2011
    #3
    i m working on mac 10.5 and xcode4 3.2
    i m new for this.

    i am creating two window form from interface builder,

    1. is Window A or Parent Window
    2. is Window B or Child Window

    Child window open over the parent window,child window have one label view and i want to display some text here

    so please tell me how can i do this?

    thanks in advance.
     
  4. macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    #4
    Open the NSTextField reference. (Developer Documentation in the Help menu). Enter NSTextField.

    Look through the methods that are available. Anything like "title" or "value" or something like that that looks right?

    If you can't find anything, look at the top if the NSTextField class reference where it says "Inherits from NSControl : NSView : NSResponder : NSObject". So try clicking on NSControl. Or look at "Companion Guide Text fields" and click on that.

    You should find what you are looking for in the NSControl reference. Now that method is useful if you want to change or set the text when the program runs. If it is fixed, go into Interface Builder and look for a place to enter the property that you just found.
     
  5. thread starter macrumors regular

    Joined:
    May 24, 2011
  6. macrumors regular

    Joined:
    Jan 27, 2011
    #6
    Learner: your question, while precise to your particular application, is fairly generic and covered by Apple's documentation. It's exciting that you are learning Cocoa / Objective C, and we want you to succeed, but learn to use the available resources -- there is a wealth of information and examples there.
     
  7. macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    #7
    I gave you an example. Open the NSTextField class reference document. There are probably hundred other class reference documents that you can open for other things. I gave you an example what to search for, I gave you an example where to look further when you don't find things. I suggest you just go and follow my example step by step.

    Alternatively, you can install GotoMyPC, give me access to your machine, and I'll do it all for you. I'll charge £100 per hour.
     
  8. thread starter macrumors regular

    Joined:
    May 24, 2011

Share This Page