Re: Bypassing Interface Builder

2008-05-14 Thread Johnny Lundy
Hi, On this topic, when I drag an object out of the Library and set its class, IB sets the label of the object to the Class Name. Since this is an instance of the class, and not the Class Object itself, why is the name capitalized? And if I want to refer by name to that instance in my cod

Re: Bypassing Interface Builder

2008-05-14 Thread Johnny Lundy
Actually, I have read that many times. My reason for reading it was that so many example codes and tutorials say to bind an interface item to File's Owner, but don't say why or what that binding accomplishes. So it's the application instance. I don't understand what the application instance

Re: Bypassing Interface Builder

2008-05-14 Thread Johnny Lundy
Just another note - the reason that I asked this is that I finally added a second class to my project. I had never had 2 classes in a project before because I didn't understand how to have them communicate. Actually, I still don't - I just try everything until something works. I wrote the

Re: Bypassing Interface Builder

2008-05-15 Thread Johnny Lundy
On May 15, 2008, at 5:26 AM, [EMAIL PROTECTED] wrote: Message: 6 Date: Thu, 15 May 2008 08:15:41 +0200 From: Uli Kusterer <[EMAIL PROTECTED]> Subject: Re: Bypassing Interface Builder To: Johnny Lundy <[EMAIL PROTECTED]> Cc: cocoa-dev@lists.apple.com Message-ID: <[EMAIL PROTECTED

Re: Bypassing Interface Builder

2008-05-15 Thread Johnny Lundy
OK - I am getting a lot of education here. I am not a total n00b with Cocoa, and have been studying it and coding it for six years, but I realize that a lot of stuff I memorized how to do, I never understood what I was doing. On May 15, 2008, at 3:06 PM, [EMAIL PROTECTED] wrote: Right.

Re: Bypassing Interface Builder

2008-05-15 Thread Johnny Lundy
One final reply and I will have cluttered up this list enough for now. I thank everyone who took the time to help me. On May 15, 2008, at 3:06 PM, [EMAIL PROTECTED] wrote: From: Uli Kusterer <[EMAIL PROTECTED]> Subject: Re: Bypassing Interface Builder To: Johnny Lundy <[EMAIL

Re: The challenge for Cocoa's on-line documentation

2008-05-17 Thread Johnny Lundy
I never had any problem with a language's documentation since 1970 with the IBM 360 Reference Manual. That is, until I came across Apple's documentation of Cocoa. I have never been so frustrated in my life. - Everything is defined in terms of something else. - Interface Builder User Guide i

Cocoa et al as HCI usability problem

2008-05-18 Thread Johnny Lundy
For the record, my comments weren't about it being difficult; it's about the documentation not providing the information needed to use it. It's a beautiful API, as you say with tons of work done to implement these reusable constructs. The documentation is voluminous, but in too many cases j

Cocoa bindings and reluctance to use NSPopupButon

2008-05-19 Thread Johnny Lundy
: text/plain; charset=US-ASCII; format=flowed; delsp=yes Johnny Lundy had a difficult time using NSPopupButon along with bindings. The struggles are archived via www.cocoabuilder.com for posterity. Mr. Lundy recently wrote "...I am still very very hesitant to put another NSPopUpButto

Conceptual MVC Help

2008-05-20 Thread Johnny Lundy
Greetings I got my NSPopUpButton working, but have been informed that it is done wrong. The last time I submitted this it had a typo and I was chastised and told to read the Objective-C introduction, so the question wasn't addressed. I'd like to submit this bare-bones example for comment.

Trying to understand -- please help...

2008-05-21 Thread Johnny Lundy
Here's why the OP was not aware of the behavior of an NSArray class method: Here's the verbatim documentation for +arrayWithObjects: arrayWithObjects: Creates and returns an array containing the objects in the argument list. + (id)arrayWithObjects:(id)firstObj, ... ParametersfirstObj, ..

Trying to understand -- please help...

2008-05-21 Thread Johnny Lundy
On May 21, 2008, at 3:03 PM, [EMAIL PROTECTED] wrote: It is expected that you have at least looked at the getting started documentation before you attempt to dive much into anything else. You would quickly run across the following... Well, that makes the point that some of us are trying to m

fundamental question: how do I call controller methods from other classes?

2008-05-21 Thread Johnny Lundy
These are the exact same 2 questions that I had bugging me a while back. It's amazing. I still don't know how to call one class from another (the reason I always only have one class in my projects), but I was told that to solve the "instance has no name" issue you have to make an IBOutlet

ObjC Question - labeled arguments

2008-05-21 Thread Johnny Lundy
You're correct - there is no first argument per se: it is part of the method selector, together they are called a "keyword." http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_3.html A message with a single argument affixes a colon to the

Re: Trying to understand -- please help...

2008-05-22 Thread Johnny Lundy
]> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes On May 22, 2008, at 11:43 AM, Greg Titus wrote: On May 21, 2008, at 12:37 PM, Johnny Lundy wrote: This is just one example of that "little tidbit" that is always left out of these references by Apple. It seems to

File's Owner

2008-05-23 Thread Johnny Lundy
I decided to once again go verbatim through Cocoa Fundamentals. So far it has been largely "uh-huh, yep", but the File's Owner, my nemesis, comes up again. http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_3.html You connec

Re: File's Owner

2008-05-23 Thread Johnny Lundy
Thank you. That is the crucial issue. If Aaron says people don't understand it, and I haven't understood it even after reading all three editions of his book plus the other two Cocoa books plus the Apple documentation many times, then it must be difficult. On May 23, 2008, at 6:17 PM, St

Re: File's Owner

2008-05-23 Thread Johnny Lundy
sp=yes On May 23, 2008, at 2:49 PM, Johnny Lundy wrote: I decided to once again go verbatim through Cocoa Fundamentals. So far it has been largely "uh-huh, yep", but the File's Owner, my nemesis, comes up again. I tried to answer your File's Owner and NSApp questions last week (c

Re: File's Owner

2008-05-23 Thread Johnny Lundy
OK that's the first step towards saying what it is - the controller object that manages the corresponding user interface objects in the nib file. Now to find out what "managing" them means. This implies that NSApp is a "controller object" that manages the user interface objects in my nib fi

Re: File's Owner

2008-05-24 Thread Johnny Lundy
I dunno. Your book seems to be one of the few, if not the only, that is not on my bookshelf. If you email me your page on File's Owner, I can give feedback. On May 23, 2008, at 9:59 PM, [EMAIL PROTECTED] wrote: I despair that I am unable to adequately explain the concept and utility of File'

Re: File's Owner

2008-05-25 Thread Johnny Lundy
Well, tell that to the guy who wrote the Currency Converter Using Bindings tutorial. See the last sentence here: "This concrete example should help you understand what the value binding’s configuration implies: The content of the text field is bound to the value of the exchangeRate key, whi

Re: File's Owner

2008-05-25 Thread Johnny Lundy
LOL - all of what you just described was the hair-pulling extravaganza that led me to a more detailed look at File's Owner in the first place. Several weeks ago I was trying to get my model object out of the nib, or more specifically, to figure out how to connect the controller to it if the

Re: File's Owner

2008-05-25 Thread Johnny Lundy
Thanks to everyone who replied and supplied sample code and anecdotes. I will study these carefully and take notes. N.B. My 16 hours a day comment did not imply that I am losing sleep. I really have been reading and adding features to my project, and creating dozens of test projects, and loa

File's Owner

2008-05-25 Thread Johnny Lundy
Forgot one thing. If anyone would be interested to critique my whole project, I would appreciate it. It on my iDisk "johnnylundy", a zip file named "MafiaC9Arrays.zip" ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

NSArrayController's "selectionIndex" weirdness

2008-04-10 Thread Johnny Lundy
Hello all, In a TableView column bound to an NSArrayController which has playerArray, a mutable array, as its content. An NSButton binding selectionIndex of the controller as the Argument 1, and the Selector Name to the method below, here's what I get in the method: - (void) nightKill:(

Re:NSArrayController's "selectionIndex" weirdness

2008-04-11 Thread Johnny Lundy
On Apr 10, 2008, at 19:09, Quincey Morris wrote: Thanks a bunch, Quincey. That worked fine. I was going by NSArrayController's documentation that its "selectionIndex" method returned an NSUInteger. Either that is wrong or the NSButton wraps it in an object wrapper when it uses the "Argument

Simple TextView not updating view

2008-04-13 Thread Johnny Lundy
First, thanks to Quincey Morris for clarifying the mutableArrayValueForKey issue to get proper KVO on a mutableArray when deleting objects from the Model. It works just fine. I think that will also allow me to get my addObject button to work. I am tackling these issues one at a time. My goa

Get "end-editing" notice from simple NSTextField?

2008-04-13 Thread Johnny Lundy
This list has been a great thing for me. I got 2 of my 3 stumpers solved with the help of people here. What's the most clean and elegant (MVC compliant) way to receive an end-editing notice from a plain vanilla NSTextField? I want my user to be able to just type in a string, end editing (by

Re: is this badly written code?

2008-04-15 Thread Johnny Lundy
My Cocoa coding is for hobby only, and only for about 4 years, so I do not have experience with working in teams or on multi-developer projects. But I see this issue in other development environments of recent issue as well. Apple has provided a rich set of finely-granulated APIs, which a

Setting the value of an array element

2008-04-17 Thread Johnny Lundy
I imagine this is a very dumb question, but I am perplexed. NSArray says you can change the values of elements, but not add/ subtract/replace elements. Let's say I have an NSArray @"Tom", @"Dick", @"Harry", nil And I want to change Tom and Dick to Mutt and Jeff. Is my only option to make it

NSPopupButton Bindings

2008-04-19 Thread Johnny Lundy
Good evening, I am having trouble understanding the bindings for NSPopupButton. View: NSPopupButton Controller: NSArrayController, just for the popup button Model: NSMutableArray of NSMutableDictionaries. I have the array controller bound to the array in the model, and that is working fine.

Fwd: NSPopupButton Bindings

2008-04-20 Thread Johnny Lundy
20, 2008 12:49:43 AM EDT To: Johnny Lundy <[EMAIL PROTECTED]> Cc: cocoa-dev@lists.apple.com Subject: Re: NSPopupButton Bindings On Apr 19, 2008, at 5:58 PM, Johnny Lundy wrote: Good evening, I am having trouble understanding the bindings for NSPopupButton. View: NSPopup

Re: NSPopupButton Bindings

2008-04-20 Thread Johnny Lundy
As follow-up, I set the bindings of the popup to be content: Array Controller.arrangedObjects content objects: not used content values: Array Controller.arrangedObjects.name When I pass the selection of the Array Controller to my method, all I get for the parameter in NSLog is victim: <_NSCo

Re: Cocoa-dev Digest, Vol 5, Issue 648

2008-04-20 Thread Johnny Lundy
That works. I did not use the selectedObjects before because my understanding was that was for detail controllers of detail views. It is passed wrapped in a one-element NSArray, and I can extract the dictionary with objectAtIndex:0. Thanks ever so much - two days struggling with this. I was

Copying contents of an NSString to the Clipboard

2008-04-21 Thread Johnny Lundy
Greetings, I've studied the pasteboard docs, and wonder if there is a simple way to copy the contents of an NSString to the general clipboard. In AS or AS Studio it's just "set the clipboard to ." Is there such a convenience method in Cocoa? Thanks, Johnny ___

-init and awakeFromNib called twice.

2008-04-25 Thread Johnny Lundy
I know I saw something somewhere in reference to these methods getting called twice on app launch, but can't find it with searching. Is this expected behavior for vanilla -init and (void) awakeFromNib methods? I'm doing some short loops in these methods and calling other instance methods. F

Re: Cocoa-dev Digest, Vol 5, Issue 682

2008-04-25 Thread Johnny Lundy
only in one NIB. If you're object loads additional NIB files and is the file's owner, it will be called additional times. Good Luck - Jon Hess On Apr 25, 2008, at 9:41 AM, Johnny Lundy wrote: I know I saw something somewhere in reference to these methods getting called twice on app la

Binding a popup button's selected index to a model integer

2008-04-29 Thread Johnny Lundy
Hello all, I would appreciate some guidance in getting a popup button to use its selectedIndex to set an integer in my model. I am having trouble understanding how to properly bind the selection of a popup to an integer in the model so that changes in the popup's selection changes the mod

NSPopupButton displaying extra item when model changed

2008-05-03 Thread Johnny Lundy
Hello all, Thanks for your previous help. I'm trying to firm up my understanding of NSPopupButton. I wrote a test project modeled after Kevin Wojniak's example here: http://forums.macrumors.com/showthread.php?p=4839485 , post #7, referencing matt neuburg's example. One NSPopupButton On

NSPopUpButton again

2008-05-08 Thread Johnny Lundy
Hi, still having no luck with NSPopUpButton and getting the selected item in the popup back into my model string. Simplified down to the bone, here's my class Popup: // Popup.h // TestPopup #import @interface Popup : NSObject { NSArray *popupArray; NSString *selectedGame; }

Re: NSPopUpButton again

2008-05-09 Thread Johnny Lundy
controller... My popup button now sets the model object string value. If you have any more tips I would love to hear them. I have literally read every word I can find about this class and still could not make it work. Thanks again Johnny On May 8, 2008, at 10:05 PM, Ken Thomases wrote:

Re: NSPopUpButton again

2008-05-09 Thread Johnny Lundy
On May 9, 2008, at 12:52 AM, Ken Thomases wrote: It seemed to me that I wasn't allowed to bind a View item's (the NSPopUpButton) property directly to a model object's (popup.selectedGame) property. But I do not see any way to use the controller here to communicate with a property in the M

"Controller Cannot Be nil" on binding NSTextField

2008-05-12 Thread Johnny Lundy
I am stuck on this error. 2008-05-12 20:58:58.257 TimerTest[65919:10b] An uncaught exception was raised 2008-05-12 20:58:58.259 TimerTest[65919:10b] Controller cannot be nil 2008-05-12 20:58:58.260 TimerTest[65919:10b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException'

Re: "Controller Cannot Be nil" on binding NSTextField

2008-05-12 Thread Johnny Lundy
Yeah, a stupid mistake. Thanks for noticing that. I had that as awakeFromNib and changed it but forgot to give it a nonvoid return value. Since the error was about a controller, and only happened when I bound an IB textField, and the app ran perfectly to the console, it never occurred to me

"Controller Cannot Be nil" on binding NSTextField

2008-05-13 Thread Johnny Lundy
ype: text/plain; charset="US-ASCII" on 2008-05-13 12:06 AM, Johnny Lundy at [EMAIL PROTECTED] wrote: I still have to do the crazy self.hoursString = [[NSNumber numberWithInt: self.hours] stringValue]; To get a string from an int for the textField to bind to. If I bind it