• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Accessing instance method in nib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing instance method in nib


  • Subject: Re: Accessing instance method in nib
  • From: Charilaos Skiadas <email@hidden>
  • Date: Wed, 27 Jul 2005 15:45:37 -0500

On Jul 27, 2005, at 2:11 PM, Chen Wang wrote:

Assuming that classA and classB are all subclasses of NSObject, and are
respectively instantiated as objA and objB in the same nib with IB. objB
is hooked on objA's IBOutlet, so that objA can access objB. Everything
goes fine so far, but the problem is: when objA tries to access objB's
method (Foo), the compiler report that no - Foo methos is found.



The method Foo is not an IBAction, it is defined in classB like following:

- (NSString*) Foo (NSString*)theString;

You probably meant to write:

- (NSString*) Foo: (NSString*)theString;

Notice the colon. In that case, how are you calling Foo? Supposing outletB is the name of the outlet that A has connecting it to B, and the following code is within some method of objA, the following should work:

result = [outletB Foo:someString];

If not, then you better tell us what the exact compiler warning/error you are getting is.
Oh, of course you should also include in class A , at the top, a line like:


#include "classB.h"

or at the very least

@class classB;

So that the compiler knows about it.

Not knowing anything about mixing Obj-C with Obj-C++, I'll stay clear of the second part of your email. But if all these are Obj-C classes, then it should have nothing to do with it.

Haris


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Accessing instance method in nib (From: "Chen Wang" <email@hidden>)

  • Prev by Date: (no subject)
  • Next by Date: Re: Newbie Help understanding Core Data
  • Previous by thread: Accessing instance method in nib
  • Next by thread: RE: Accessing instance method in nib
  • Index(es):
    • Date
    • Thread