Re: trouble with method passing a value to a custom view
site_archiver@lists.apple.com Delivered-To: Cocoa-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=SX3Zt5DV6EcVe0m6F4AdxcS2/XMehdHigZ/QKrFsw03EPqqfqlrYrYmB7nKV6mrQqCV0EGjWtP/0gaECrQmgpyzcRzwqApNDbfwNvqNOgP6icEreguHssYVynj90uwy7C7tRwtaz76YH82Ap6TVsA2XL44mUn9EP/MfhWGiqRik= Julia: Any suggestions? Just four ... :-) IBOutlet id myCustomView; [myCustomView setnTrials:someIntegerValue]; You should also read the Cocoa Fundamentals Guide here: Also, go over the "Cocoa Application Tutorial": I hope this helps. -- I.S. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/site_archiver%40lists.apple... On Jan 2, 2007, at 7:36 AM, julia Cline wrote: 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: ... then from within MyDocument.m, you can send your custom view a message like: 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. http://developer.apple.com/documentation/Cocoa/Conceptual/ CocoaFundamentals/index.html 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). This email sent to site_archiver@lists.apple.com
participants (1)
-
I. Savant