Outlet between 2 controller object

Ask a Question related to Mac Programming, Design and Development.

  1. #1

    Default Outlet between 2 controller object

    In Interface Builder the IBOulet "from_A_to_B" was added to Controller_A
    and a connection made from Controller_A to Controller_B

    Controller_A.m hold the code

    int v;

    v = [from_A_to_B test_int];

    Controller_A.h hold the declaration (in @interface Controller_A : NSObject)

    IBOutlet id from_A_to_B;

    Controller_B.m hold the code

    - (int)test_int
    {
    return 12345;
    }

    Controller_B.h hold the declaration

    - (int)test_int;

    The compiler report this error

    Error : unknown message selector
    Controller_A.m line 13 v = [from_A_to_B test_int];

    Do I have made an illegal IB connection ?
    What code is missing/wrong ?

    Thank you.
    Alain Birtz Guest

  2. Similar Questions and Discussions

    1. Temperature controller
      Hi all I need to make a temperature controller. How can i bring a live temperature inside flash I have a external text file that have the value....
    2. Removing a controller
      I upgraded a network to Windows 2003 Server from Windows 2000 Server. I did this by adding a Windows 2000 server, adding AD on it, and then...
    3. cue point controller?
      Hi! I'm trying to make a generic script that will let me go to the previous marker, and play the previous cuepoint in a .wav file. Here is the code...
    4. ActiveX-controller
      Hi, when trying to send my Flash web-page as an e-mail I'm displayed with the message: "You can not run ActiveX-controller with this settings". ...
    5. A1000 controller
      I recently had to replace a failed controller in an A1000, however, rm6 or Solaris is unable to see the original RAID 5 LUN. I am unable to find a...
  3. #2

    Default Re: Outlet between 2 controller object

    In <abz-1609031544460001@192.168.1.3> Alain Birtz wrote:
    > The compiler report this error
    >
    > Error : unknown message selector
    > Controller_A.m line 13 v = [from_A_to_B test_int];
    >
    > Do I have made an illegal IB connection ?
    > What code is missing/wrong ?
    You need to learn Objective-C. The form of an Objective-C method call is:

    [classOrInstance methodName];

    You have just [methodName] alone, which is meaningless. m.

    --
    matt neuburg, phd = [email]matt@tidbits.com[/email], [url]http://www.tidbits.com/matt[/url]
    REALbasic: The Definitive Guide! 2nd edition!
    [url]http://www.amazon.com/exec/obidos/ASIN/0596001770/somethingsbymatt[/url]
    Subscribe to TidBITS. It's free and smart.
    matt neuburg Guest

  4. #3

    Default Re: Outlet between 2 controller object

    But from_A_to_B is just a "classOrInstance"
    By example to get a pointer to an NSWindow from an IBOutlet
    named main_wind the [main_wind window] is uded.
    from_A_to_B is an IBOutlet to the Controller_B object
    In fact the problem is only a missing declaration.
    Adding the 3 line below in Controller_A.h solve the problem

    @interface Controller_B : NSObject
    - (int)test_int;
    @end

    In Controller_A.m the v value is correctly set to 12345 by the instruction

    v = [from_A_to_B test_int];

    But there is one thing I am not sure: is it correct to connect two controller
    object (with an IBOutlet) in this way...

    Thank you.

    In article <20030916155043535-0700@news.la.sbcglobal.net>, matt neuburg
    <matt@tidbits.com> wrote:
    > In <abz-1609031544460001@192.168.1.3> Alain Birtz wrote:
    > > The compiler report this error
    > >
    > > Error : unknown message selector
    > > Controller_A.m line 13 v = [from_A_to_B test_int];
    > >
    > > Do I have made an illegal IB connection ?
    > > What code is missing/wrong ?
    >
    > You need to learn Objective-C. The form of an Objective-C method call is:
    >
    > [classOrInstance methodName];
    >
    > You have just [methodName] alone, which is meaningless. m.
    Alain Birtz Guest

  5. #4

    Default Re: Outlet between 2 controller object

    Alain Birtz <abz@videotron.ca> wrote:
    > But from_A_to_B is just a "classOrInstance"
    Right - sorry! m.


    --
    matt neuburg, phd = [email]matt@tidbits.com[/email], [url]http://www.tidbits.com/matt/[/url]
    Read TidBITS! It's free and smart. [url]http://www.tidbits.com[/url]
    matt neuburg Guest

  6. #5

    Default Re: Outlet between 2 controller object

    [email]abz@videotron.ca[/email] (Alain Birtz) wrote in message news:<abz-1609031544460001@192.168.1.3>...
    > The compiler report this error
    >
    > Error : unknown message selector
    > Controller_A.m line 13 v = [from_A_to_B test_int];
    >
    > Do I have made an illegal IB connection ?
    > What code is missing/wrong ?
    >
    > Thank you.
    Are you sure this was an error? or was it just a warning? Or is your
    compiler set to treat all warnings as errors?

    I think you just need to import Controller_B.h from Controller_A.m.
    Usually this makes a warning instead of an error...

    Michael
    Michael Milvich Guest

  7. #6

    Default Re: Outlet between 2 controller object

    [email]abz@videotron.ca[/email] (Alain Birtz) wrote in message news:<abz-1609031544460001@192.168.1.3>...
    > Do I have made an illegal IB connection ?
    > What code is missing/wrong ?
    Simple problem.
    > IBOutlet id from_A_to_B;
    The "id" means "it's an object of unspecified type." The compiler
    does not know to look in Controller_B.h.

    You can fix it by changing it to

    IBOutled (Controller_B *) from_A_to_B;

    In the future, you can make this kind of thing not happen by,
    when creating an outlet, giving it a type using the pull-down
    menu. I'm guessing you probably didn't do that, not knowing
    what it was for. Well, this is what it's for.
    Eric Pepke Guest

  8. #7

    Default Re: Outlet between 2 controller object

    In CW 8.0 this is a (Compiler or Linker) error not a warning...

    In article <21ff4ea2.0309171018.2ec08b10@posting.google.com >,
    [email]michael@milvich.com[/email] (Michael Milvich) wrote:
    > [email]abz@videotron.ca[/email] (Alain Birtz) wrote in message
    news:<abz-1609031544460001@192.168.1.3>...
    > > The compiler report this error
    > >
    > > Error : unknown message selector
    > > Controller_A.m line 13 v = [from_A_to_B test_int];
    > >
    > > Do I have made an illegal IB connection ?
    > > What code is missing/wrong ?
    > >
    > > Thank you.
    >
    > Are you sure this was an error? or was it just a warning? Or is your
    > compiler set to treat all warnings as errors?
    >
    > I think you just need to import Controller_B.h from Controller_A.m.
    > Usually this makes a warning instead of an error...
    >
    > Michael
    Alain Birtz Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139