Re: trouble with method passing a value to a custom view
Re: trouble with method passing a value to a custom view
- Subject: Re: trouble with method passing a value to a custom view
- From: "I. Savant" <email@hidden>
- Date: Tue, 2 Jan 2007 08:41:53 -0500
Julia:
On Jan 2, 2007, at 7:36 AM, julia Cline wrote:
Any suggestions?
Just four ... :-)
1 - You're going to need to take the time to read and learn the
correct terminology or getting help from others is going to be a
along, arduous process. Unless you really mean you've subclassed an
NSWindow and added an instance method called "setnTrials:" you
probably mean you have a controller object (like "MyAppController.m")
or an NSDocument subclass (by default, "MyDocument.m"). You need to
specify which.
2 - If you're trying to call the method -setnTrials: from one
controller and it's in another controller / view / object-in-general,
you can create an IBOutlet in that controller and connect it to the
target object. Example: You have an NSDocument subclass (MyDocument)
and in your nib, you have a custom view. In your MyDocument.h you
must create an outlet:
IBOutlet id myCustomView;
... then from within MyDocument.m, you can send your custom view a
message like:
[myCustomView setnTrials:someIntegerValue];
3 - With respect, I think you're putting the cart before the horse,
so to speak. You would do well to get yourself a Cocoa book and
follow a more structured course on Cocoa / Objective-C. Search this
list's archives for *many* threads suggesting various books.
You should also read the Cocoa Fundamentals Guide here:
http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaFundamentals/index.html
Also, go over the "Cocoa Application Tutorial":
http://developer.apple.com/documentation/Cocoa/Conceptual/
ObjCTutorial/index.html
Go over these until you thoroughly understand them. Those two
alone will go a long way toward helping you understand how to
structure your application and get its various parts talking together
the "Cocoa Way" (and believe me, not doing things the Cocoa Way in a
Cocoa application with Cocoa objects is 99.9% of the time a *bad*
design choice).
I hope this helps.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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