• 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
calling a function in one class from another
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

calling a function in one class from another


  • Subject: calling a function in one class from another
  • From: Geoffrey Holden <email@hidden>
  • Date: Thu, 5 Aug 2010 15:42:51 +0100

If I have a class 'Foo' (containing the function 'Wabble'), which loads
another class 'Bar', is it possible a function within 'Bar' to execute the
'Wabble' function within the calling class 'Foo'?


Why do I want to do this?  Well, 'Bar' contains all the code necessary to
control a view.  This view contains an NSTableView for an address book.


'Foo' loads the address book data from a remote server.  'Foo' also loads
another class 'Baz' which has an editor view.  I want 'Bar' to be able to
execute the address book loader code in 'Foo' and I want to be able to
double click on an address in 'Bar' and have it execute code in 'Foo' which
will then appropriately load the editor view in 'Baz'.


I'm sure I've seen this done, and I'm fairly certain that it's easy to do -
but I can't for the life of me remember how or where!


I hope that this makes sense.


Regards,


Geoffrey.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: calling a function in one class from another
      • From: Joanna Carter <email@hidden>
    • Re: calling a function in one class from another
      • From: Quincey Morris <email@hidden>
    • Re: calling a function in one class from another
      • From: Graham Cox <email@hidden>
  • Prev by Date: Resolution of an NSImage(Rep)?
  • Next by Date: Re: Resolution of an NSImage(Rep)?
  • Previous by thread: Re: Resolution of an NSImage(Rep)?
  • Next by thread: Re: calling a function in one class from another
  • Index(es):
    • Date
    • Thread