Re: Launching Cocoa Application externally (Yann Disser)

2008-05-14 Thread Hamish Allan
Please stop copying Yann Disser's name into the subject line! It breaks up threads unnecessarily. Hamish ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators

Re: NSRectFillListWithColors question

2008-05-14 Thread Hamish Allan
On Wed, May 14, 2008 at 6:47 PM, Nick Zitzmann <[EMAIL PROTECTED]> wrote: > On May 14, 2008, at 11:19 AM, Davide Scheriani wrote: > >> okkei,good,this is working,but I wanted to use NSArray instead a simple >> C-style array. >> In many case I have NSArray it hold NSValue for each NSRect. > > You c

Re: Conditionally modifying NIBs?

2008-05-14 Thread Hamish Allan
On Wed, May 14, 2008 at 6:37 PM, Mike Fischer <[EMAIL PROTECTED]> wrote: > I remember in the very dim past (when MacApp was still a modern framework > ;-) that I had text based resource files (.r) to build the 'View' resources > (rough analog to nibs) which included preprocessor macros to control

Re: Conditionally modifying NIBs?

2008-05-14 Thread Hamish Allan
On Wed, May 14, 2008 at 11:25 PM, Mike Fischer <[EMAIL PROTECTED]> wrote: > (I know this can be hacked, and that while verbose it's only xml. But I'd > want my apps building in the next Xcode (sub-)release as well.) Sure, well, you can't eat your cake and have it ;) I'd have thought that you cou

Re: Finding my way through binding

2008-05-15 Thread Hamish Allan
On Thu, May 15, 2008 at 2:54 PM, Laurent Cerveau <[EMAIL PROTECTED]> wrote: > I then try to add an entity through the NSTreeController addObject method, > and ...nothing happens, except a message in the console that says > "Cocoa Bindings: Cannot create NSArray from object NSCFString of class > NS

Re: Using NSThreads in command-line apps

2008-05-15 Thread Hamish Allan
On Thu, May 15, 2008 at 8:16 PM, ben syverson <[EMAIL PROTECTED]> wrote: > I don't want to listen to any input, and I want the loop to execute as fast > as possible. However, NSRunLoop says I need to set a timer or an input... On Thu, May 15, 2008 at 8:53 PM, ben syverson <[EMAIL PROTECTED]> wrot

Re: Using NSThreads in command-line apps

2008-05-15 Thread Hamish Allan
On Thu, May 15, 2008 at 11:40 PM, ben syverson <[EMAIL PROTECTED]> wrote: > I know it's kevent "style," but unless it's actually kevent (or a similar > kernel-level event system) under there, I have my doubts about the > performance under heavy load. I guess I could (should) do benchmarks of both

Re: Problem with NSFileManger directoryContentsAtPath

2008-05-16 Thread Hamish Allan
On Fri, May 16, 2008 at 6:02 AM, JanakiRam <[EMAIL PROTECTED]> wrote: > When i perform ls command it shows file name as "Icon?". When i perform cp > command & tab it shows the file name as "Icon^M". > Why Terminal does show different names for the same file. Because the filename contains a non-pr

Re: Problem with NSFileManger directoryContentsAtPath

2008-05-16 Thread Hamish Allan
On Fri, May 16, 2008 at 3:28 PM, JanakiRam <[EMAIL PROTECTED]> wrote: > When i give this filename as part of rsync source file ( using --files-from > ) , rsync is treating this filename as 2 different file names , because > rsync expects each filen name separated by \r. > Hence my rsync command is

Re: Learning Curve/Documentation Challenge/Recommendation

2008-05-17 Thread Hamish Allan
On Sat, May 17, 2008 at 3:03 PM, colo <[EMAIL PROTECTED]> wrote: > F-Script [...] gives you the code to Create a window from scratch > and logically place the buttons on the window by coordinates. That > kind of "knowing" how to make a window without IB is priceless to me > imo. I know you're nev

Re: Learning Curve/Documentation Challenge/Recommendation

2008-05-17 Thread Hamish Allan
On Sat, May 17, 2008 at 4:09 PM, Steve Weller <[EMAIL PROTECTED]> wrote: > He's quite happy to walk across the floor, but knowing how the floor is > constructed adds enormously to his confidence of doing so. Don't forget this > is an unfamiliar building, a type of which he has not encountered befo

Re: Background Application.

2008-05-19 Thread Hamish Allan
On Mon, May 19, 2008 at 8:21 AM, ninad walvekar <[EMAIL PROTECTED]> wrote: > I have an existing GUI application and now i want to run that same > application in the background at startup and then when the user wants to run > the application run it as a normal GUI application.The application has be

Re: Background Application.

2008-05-19 Thread Hamish Allan
On Mon, May 19, 2008 at 10:31 AM, Brett Powley <[EMAIL PROTECTED]> wrote: > You actually can have a GUI application in the background True, but the OP said "at startup" (i.e. daemon not agent), and also wants to run the *same* application "as a normal GUI application" (i.e. in the foreground and

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Hamish Allan
On Mon, May 19, 2008 at 6:03 AM, Peter Duniho <[EMAIL PROTECTED]> wrote: > And as long as you guys keep insisting that there's nothing wrong with the > environment, and that people "just need to get used to it" and "then they'll > love it", you're not going to get the kind of developer excitement

Re: Programmatically get treecontroller selection

2008-05-19 Thread Hamish Allan
On Mon, May 19, 2008 at 8:18 PM, Jonathan Dann <[EMAIL PROTECTED]> wrote: > The way its > traditionally (and designed to be) used is that the tree controller is the > outline view's data source. This statement is a little misleading: the tree controller is designed to have bindings from the outli

Re: Forcing a refresh on a bound control

2008-05-20 Thread Hamish Allan
On Tue, May 20, 2008 at 12:43 AM, Christiaan Hofman <[EMAIL PROTECTED]> wrote: > The problem is that at some point the dependent key depends on a key for > /another/;object. And this can not give automatic KVO notifications for the > dependent key (using Tiger API), unless you actually use a KVC c

Re: Forcing a refresh on a bound control

2008-05-20 Thread Hamish Allan
On Tue, May 20, 2008 at 8:12 PM, Hamish Allan <[EMAIL PROTECTED]> CCed the wrong list -- I meant to CC MacOSX-dev. Sorry! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to th

Re: Fetching related objects in CoreData without NSManagedObject

2008-05-20 Thread Hamish Allan
On Wed, May 21, 2008 at 2:31 AM, Nick Zitzmann <[EMAIL PROTECTED]> wrote: > I've got a data model with a many-to-one relationship. > [...] > I am not using NSManagedObject at all. > [...] > So how do I query for related objects without NSManagedObjects? Query what? What collection are you using t

Re: Attempting to create NSTableView with Single Header

2008-05-20 Thread Hamish Allan
On Wed, May 21, 2008 at 12:11 AM, Brent Fulgham <[EMAIL PROTECTED]> wrote: > | My single column header | > |Label 1 | Value 1| > |Label 2 | Value 2| > Does anyone have any ideas for how to accomplish this? How about using a single column, with a data cell that d

Re: Fetching related objects in CoreData without NSManagedObject

2008-05-20 Thread Hamish Allan
On Wed, May 21, 2008 at 4:16 AM, Nick Zitzmann <[EMAIL PROTECTED]> wrote: > I'm using my own object caches. So can you not iterate through them, checking for equality to an object on the "one" side or on the "many" side? Hamish ___ Cocoa-dev mailing l

Re: Fetching related objects in CoreData without NSManagedObject

2008-05-20 Thread Hamish Allan
On Wed, May 21, 2008 at 4:31 AM, Nick Zitzmann <[EMAIL PROTECTED]> wrote: > That involves a linear search, which is too slow with thousands of records. > SQLite should be faster than that. But if you're using your own object caches, and not using NSManagedObject, in what way are you using Core Da

Re: Fetching related objects in CoreData without NSManagedObject

2008-05-20 Thread Hamish Allan
On Wed, May 21, 2008 at 4:44 AM, Nick Zitzmann <[EMAIL PROTECTED]> wrote: > I'm getting the attributes from the records in the database using > NSManagedObjectContext and NSFetchRequest and installing them into my own > model objects. If you don't throw away the NSManagedObjects, you can use them

Re: Cocoa et al as HCI usability problem

2008-05-21 Thread Hamish Allan
On Wed, May 21, 2008 at 8:49 AM, Peter Duniho <[EMAIL PROTECTED]> wrote: > And again: it's not that I'm on a crusade to have Objective-C changed, or to > have Cocoa made fully accessible via some other language. I just want > people to have some empathy for what at least some of us go through upo

Re: Programmatically get treecontroller selection

2008-05-21 Thread Hamish Allan
I'd like to reiterate what Quincey noted: "BTW, I notice that the "Cannot perform operation without a managed object context" error is logged *before* you log "default". The problem is not apparently anything to do with getting the selection in the code you posted, since it happens before you do t

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

2008-05-21 Thread Hamish Allan
On Wed, May 21, 2008 at 7:35 PM, Johnny Lundy <[EMAIL PROTECTED]> wrote: > All it would take is a single sentence under the "Class Methods" header, to > say that these methods autorelease the returned object (AND that such > autoreleasing means that the object will be deallocated if the method in

Re: Core-Data Multithreading question about save

2008-05-21 Thread Hamish Allan
On Wed, May 21, 2008 at 9:25 PM, Dex Morgan <[EMAIL PROTECTED]> wrote: > note: I need to 'see' both > previous newly inserted object and old objects). Not sure I understand your question, but if you need to differentiate between objects inserted before some point in time and objects inserted afte

Re: Core-Data Multithreading question about save

2008-05-21 Thread Hamish Allan
On Wed, May 21, 2008 at 11:36 PM, Dex Morgan <[EMAIL PROTECTED]> wrote: > This link actions happend in the main thread (so inside the main object > context) and the app can't see objects inserted into the second > managedobject until I perform a -save: to it. > However it seems to be a damn expens

Re: Cocoa et al as HCI usability problem

2008-05-22 Thread Hamish Allan
On Thu, May 22, 2008 at 12:37 AM, Peter Duniho <[EMAIL PROTECTED]> wrote: > It's true, the phrase "riff-raff" wasn't actually used. But it's the > essence of what was written. > > I'm not reading between the lines. People are explicitly stating the > opinions I've described. I don't think you u

Re: Core-Data Multithreading question about save

2008-05-22 Thread Hamish Allan
On Thu, May 22, 2008 at 11:37 AM, Dex Morgan <[EMAIL PROTECTED]> wrote: > What's I'm wrong? The ID still temporany until I save the second managed > object but If I can do it I can also make my relationship, the overhead it's > the same. Surely the overhead is less when you do many rather than on

Re: Cocoa et al as HCI usability problem

2008-05-22 Thread Hamish Allan
ferred to was that of *commitment* to the Cocoa design philosophy, and the specific side-effect I didn't mind was gentle growth of the platform: On Mon, May 19, 2008 at 9:04 PM, Hamish Allan <[EMAIL PROTECTED]> wrote: > On Mon, May 19, 2008 at 6:03 AM, Peter Duniho <[EMAI

Re: Cocoa et al as HCI usability problem

2008-05-22 Thread Hamish Allan
On Thu, May 22, 2008 at 7:40 PM, Andy Lee <[EMAIL PROTECTED]> wrote: > Thanks for the clarification. I agree there is a sort of psychological > hurdle that has to be overcome: one has to accept that Cocoa will require > learning a lot of fundamentals, and learning to think differently about some

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

2008-05-22 Thread Hamish Allan
On Thu, May 22, 2008 at 1:07 AM, Matthew Youney <[EMAIL PROTECTED]> wrote: > What am I missing? Adam Leonard's reply is an excellent description of the concepts you need to understand first and foremost. But if I understand your purposes correctly from your classnames, once you have a better gras

Layout of form to mimic six paper pages (was "updated post")

2008-05-23 Thread Hamish Allan
On Fri, May 23, 2008 at 12:33 AM, Hernandez & Associates, Inc <[EMAIL PROTECTED]> wrote: > How would I accomplish this? It's difficult to ascertain how much of an answer to give. Would you, for instance, be able to create such a program if the text fields etc. were just in a normal window, rather

Re: File's Owner

2008-05-23 Thread Hamish Allan
On Fri, May 23, 2008 at 11:17 PM, Steve Weller <[EMAIL PROTECTED]> wrote: > The hang up that I see is that this documentation give no clue as to the > reason for File's Owner's existence. >From >http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CoreAppArchitecture/chapt

Re: Errors from NSTreeController (or NSOutlineView?)

2008-05-23 Thread Hamish Allan
On Fri, May 23, 2008 at 11:11 PM, Brent Fulgham <[EMAIL PROTECTED]> wrote: > "unexpected state: found the same object more than once, but can't > find the treenode for it" > > I'm not sure if this: > a) indicates IP address conflicts that cause the same IP address to > attempt to be added multiple

Re: File's Owner

2008-05-24 Thread Hamish Allan
On Sat, May 24, 2008 at 1:21 AM, Johnny Lundy <[EMAIL PROTECTED]> wrote: > I have used it to set my class as its delegate so that I could implement the > delegate method applicationWillTerminate:, and that was great. Easy to > understand, it calls respondsToSelector: and then calls my delegate met

Re: File's Owner

2008-05-25 Thread Hamish Allan
On Sun, May 25, 2008 at 2:31 PM, Andy Lee <[EMAIL PROTECTED]> wrote: > If I can make a rough analogy, many of our answers have been like different > re-implementations of an algorithm. Like the guy on the guillotine in that > engineer joke, we each think we see what the problem is. And so we "re

Re: running an external app

2008-05-27 Thread Hamish Allan
On Tue, May 27, 2008 at 6:35 PM, Peter Duniho <[EMAIL PROTECTED]> wrote: > As I said, no one ever suffered from having too many code samples. Again, I disagree. We are seeing an ever-increasing number of people on this list who don't care about learning Cocoa, they just want to piece together bit

Re: running an external app

2008-05-27 Thread Hamish Allan
On Tue, May 27, 2008 at 9:03 PM, Peter Duniho <[EMAIL PROTECTED]> wrote: > Inasmuch as anyone has an option as to what platform they will support -- > and many of us do -- high barriers discourage careful programmers as much as > they discourage bad programmers. I don't see any evidence of that o

Re: NSMetadataItem attributes

2008-05-28 Thread Hamish Allan
Hi Gerriet, On Wed, May 28, 2008 at 5:35 PM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: > > I have an NSMetadataItem, which gives me via attributes a list of keywords. > > But: kMDItemPath is not in this list, although >NSString *itemPath = [ item valueForAttribute: (NSString > *)kMDIt

Re: Cocoa bug? release/removeObserver from inside observeValueForKeyPath

2008-05-29 Thread Hamish Allan
On Thu, May 29, 2008 at 11:15 PM, Geoff Schmidt <[EMAIL PROTECTED]> wrote: > 3) If this is already known, is there a customary pattern for avoiding the > problem? "Never release from observeValueForKeyPath" is a bit harsh! I don't know if it's known, but you could try [obj performSelector:@select

Re: KVO: I get called on change, but then can't get the object

2008-05-31 Thread Hamish Allan
On Sat, May 31, 2008 at 8:48 AM, Rick Mann <[EMAIL PROTECTED]> wrote: > > On May 31, 2008, at 00:32:30, j o a r wrote: > >> Search for "NSKeyValueObservingOptionNew" here: > > Already using that: Read it again: "The change dictionary doesn't contain old and new values. This is not your fault, it'

Re: KVO: I get called on change, but then can't get the object

2008-05-31 Thread Hamish Allan
On Sat, May 31, 2008 at 11:11 AM, Jonathan del Strother <[EMAIL PROTECTED]> wrote: > On Sat, May 31, 2008 at 10:03 AM, Hamish Allan <[EMAIL PROTECTED]> wrote: >> On Sat, May 31, 2008 at 8:48 AM, Rick Mann <[EMAIL PROTECTED]> wrote: >>> On May 31, 2008, at 00:3

Re: Predicate expressions

2008-06-01 Thread Hamish Allan
On Sat, May 31, 2008 at 9:57 PM, Fabian <[EMAIL PROTECTED]> wrote: > I'm trying to figure out how to use NSExpressions in a predicate but > find the documentation a bit deficient. I'm not convinced it's a documentation issue! You could achieve what you want to do by creating a transient, read-on

Re: Predicate expressions

2008-06-01 Thread Hamish Allan
On Sun, Jun 1, 2008 at 8:26 PM, Kyle Sluder <[EMAIL PROTECTED]> wrote: > On Sat, May 31, 2008 at 4:57 PM, Fabian <[EMAIL PROTECTED]> wrote: >> NSArray *arrayB = [self getObjects] ; >> >> NSArray *titles = [arrayB arrayByApplyingSelector:@selector(title)]; >> NSArray *subtitles = [arrayB arrayByApp

Re: Xcode - IB problems

2008-06-01 Thread Hamish Allan
On Sun, Jun 1, 2008 at 8:56 PM, Ashley Perrien <[EMAIL PROTECTED]> wrote: > Should I create all the actions and outlets in IB and let it create the > class? No. I'm not even sure that's possible in the latest version of IB. What version are you using? Hamish _

Re: KVO: I get called on change, but then can't get the object

2008-06-01 Thread Hamish Allan
On Sun, Jun 1, 2008 at 1:02 AM, Scott Anguish <[EMAIL PROTECTED]> wrote: > swearing isn't appropriate here. :-) After Apple have failed to fix this glaring known bug after another two major releases of the operating system? I beg to differ :P Hamish __

Re: Hiding NSImageView

2008-06-01 Thread Hamish Allan
On Sun, Jun 1, 2008 at 11:07 PM, Damien Cooke <[EMAIL PROTECTED]> wrote: > finding any other way of hiding them is eluding me. NSImageView derives from NSView, which has a "hidden" property. But you might find a tabless NSTabView easier: programmatically switching between two tabs, one for each m

Re: Core Data "entity required" error

2008-06-02 Thread Hamish Allan
On Mon, Jun 2, 2008 at 3:01 AM, Chataka <[EMAIL PROTECTED]> wrote: > I am developing a non-document-based Core Data application and > am facing a trouble with "entity required" error message. > > When I quit the app, the error message is shown on the console and > the app fails to save data, altho

Re: File still in use after closing document window

2008-06-02 Thread Hamish Allan
On Mon, Jun 2, 2008 at 8:10 AM, Antonio Nunes <[EMAIL PROTECTED]> wrote: > My NSDocument based app loads (imports) PDF files into its documents. What code are you using to load them? Hamish ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Pleas

Re: Core Data "entity required" error

2008-06-02 Thread Hamish Allan
On Mon, Jun 2, 2008 at 3:21 PM, Chataka <[EMAIL PROTECTED]> wrote: > On the console, I just get > >> entity required > > That's it. Just two words. > Nothing else I can include... Ah, I see! Sorry, how frustrating. Try setting a breakpoint on NSLog() (or fprintf(), or syslog()) to see if you can

Re: core data: awakeFromFetch, awakeFromInsert, didTurnIntoFault

2008-06-02 Thread Hamish Allan
On Mon, Jun 2, 2008 at 4:34 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > however, if i then redo the action, neither awakeFromFetch nor > awakeFromInsert is called, and thus i'm left without my observing in place. I had the same problem recently, and wrote a workaround for it: http://www.c

Re: Spotlight multiple results for file

2008-06-02 Thread Hamish Allan
On Mon, Jun 2, 2008 at 10:26 PM, Dex Morgan <[EMAIL PROTECTED]> wrote: > I've made a custom format used in a program of mine and I would to make a > spotlight importer. I've looked at same examples and everything looks good; > hovewer I've a question: is there a way to get multiple results item fo

Re: Key-Value pairs

2008-06-02 Thread Hamish Allan
On Mon, Jun 2, 2008 at 10:30 PM, john darnell <[EMAIL PROTECTED]> wrote: > I just read Hillegass' chapter that introduces Key-Value coding. > My question is, if this is such a necessary thing, why didn't the > designers simply design the compiler to auto-generate setter and getter > functions as

Re: Apple Remote and exclusivity

2008-06-03 Thread Hamish Allan
On Tue, Jun 3, 2008 at 12:36 AM, Elan Feingold <[EMAIL PROTECTED]> wrote: > From the lack of responses I'm guessing I posted this to the wrong list :-) Four hours you gave everyone in all the different timezones of the world to respond before giving up! I don't even know what the Cocoa interface

Re: NSPredicate: To be, or not to be

2008-06-03 Thread Hamish Allan
On Tue, Jun 3, 2008 at 1:37 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: > This one also works for me. Only it kind of works too well, finding > thousands of files. > > Another example: finds > ".../Test.txt" which only contains the line: "Briggel and Braggel" . > But I really want only fil

Re: NSPredicate: To be, or not to be

2008-06-03 Thread Hamish Allan
On Tue, Jun 3, 2008 at 10:23 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: > On 3 Jun 2008, at 15:33, Hamish Allan wrote: > >> Are you using Tiger? > > Yes, I am. In that case, finding "Briggel and Braggel" for "Briggel Braggel" is expected behavi

Re: How to sort smoothly when NSTableColumn's Sort Key is empty

2008-06-03 Thread Hamish Allan
On Tue, Jun 3, 2008 at 4:52 PM, an0 <[EMAIL PROTECTED]> wrote: > And the NSTableView's sortDescriptors are found cumulated instead of > changed by NSLog in dataSource's tableView:sortDescriptorsDidChange: > method. Hmm, could be a bug. Try giving your object a readonly property that returns self,

Re: The KVO Race

2008-06-03 Thread Hamish Allan
On Tue, Jun 3, 2008 at 5:53 PM, Gordon Apple <[EMAIL PROTECTED]> wrote: > Both observations are set up in the same Nib > in "awakeFromNib". If you have dependencies between objects in your nib, you can use -[NSApplication applicationWillFinishLaunching:] to set things up. Hamish

Re: Best Practice for Returning Immutable Objects?

2008-06-03 Thread Hamish Allan
On Tue, Jun 3, 2008 at 5:28 PM, Karl Moskowski <[EMAIL PROTECTED]> wrote: > Since I can expect people to follow the conventions defined by the API, I'll > just cast and expect the callers not to mutate. Remember, the cast has no effect whatsoever... Hamish ___

Re: Main window disappears. Sometimes.

2008-06-03 Thread Hamish Allan
On Tue, Jun 3, 2008 at 6:02 PM, Andy Lee <[EMAIL PROTECTED]> wrote: > On Jun 2, 2008, at 1:50 PM, Bill Bumgarner wrote: > >> If your window is sometimes disappearing under GC -- is sometimes being >> collected prior to when you think it should be -- that means that the >> collector doesn't believe

Re: The KVO Race

2008-06-04 Thread Hamish Allan
On Tue, Jun 3, 2008 at 8:20 PM, Gordon Apple <[EMAIL PROTECTED]> wrote: >I guess I don't know hw to use that. The particular situation was a nib > that is document related, but loaded and opened later by menu. Ah, okay. But the solution is essentially the same: set up the observers when you'

Re: IBOutlet, multiple nibs, method duplication

2008-06-04 Thread Hamish Allan
On Tue, Jun 3, 2008 at 10:21 PM, Trygve Inda <[EMAIL PROTECTED]> wrote: > Since the IBOutlets in Main point to a different Nib than the IBOutlets in > Aux (even though they are functionally identical) is there a good, clean way > to manage this? Can you not wire the IBOutlets in Aux to the File's

Re: IBOutlet, multiple nibs, method duplication

2008-06-04 Thread Hamish Allan
On Wed, Jun 4, 2008 at 8:17 PM, Trygve Inda <[EMAIL PROTECTED]> wrote: > I'd need two instances of WindowController. The way I see it, you have a choice: either a single instance of a controller with 2n outlets, or two instances of a controller with n outlets. If you want to have "one controller

Re: IBOutlet, multiple nibs, method duplication

2008-06-04 Thread Hamish Allan
On Wed, Jun 4, 2008 at 8:46 PM, Trygve Inda <[EMAIL PROTECTED]> wrote: > Thoughts? It sounds like you're going for the "two instances of the same class" approach. In which case, you have a single combined controller class with your singe set of outlets and actions. Set your File's Owner in each

Re: Newbie Question on a method signature

2008-06-04 Thread Hamish Allan
On Wed, Jun 4, 2008 at 9:14 PM, James Cicenia <[EMAIL PROTECTED]> wrote: > why does it tell me: > > warning: (Messages without a matching method signature will be assumed to > return 'id' and accept... I'm guessing your method's definition comes after the code that uses that method, and you have

Re: Newbie Question on a method signature

2008-06-04 Thread Hamish Allan
On Wed, Jun 4, 2008 at 9:38 PM, James Cicenia <[EMAIL PROTECTED]> wrote: > What the heck is wrong with my declaration? It's for a method called returnUIForFont:, not returnUIColorForFont:. Take a few minutes to try to work out what's wrong before asking the list. Finding your own mistakes is an

Re: Bindings Cocoa and new Thread (Spinning Beach Ball an new Thread)

2008-06-04 Thread Hamish Allan
Hi Alex, On Thu, Jun 5, 2008 at 12:10 AM, Alexander Hartner <[EMAIL PROTECTED]> wrote: > 1.) I gathered i have to create a new NSAutoReleasePool in my "threaded" > method. Is this correct ? Yes. > 2.) During execution of this I am updating the UI components from a thread > which is not the main

Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-05 Thread Hamish Allan
On Fri, Jun 6, 2008 at 6:26 AM, Graham Cox <[EMAIL PROTECTED]> wrote: > I guess the question is, given an object type 'id', which method signature > will the compiler go with? Does the return type affect the method signature? > (In C++ it doesn't for example), so two methods: > > - (CGPoint) posit

Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-05 Thread Hamish Allan
On Thu, Jun 5, 2008 at 4:43 PM, Graham Cox <[EMAIL PROTECTED]> wrote: > If I turn this on, I get thousands of warnings, none of which appear to be > telling me anything useful (i.e. the code is perfectly legitimate). With > that amount of noise if it does pick up the odd case like this I'm never >

Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-05 Thread Hamish Allan
On Thu, Jun 5, 2008 at 5:12 PM, Brian Stern <[EMAIL PROTECTED]> wrote: > While float and int are the same size they are returned from functions in > different registers (on both ppc and intel). If the calling function expects > a float returned type but an int is returned instead the calling funct

Re: Regular Expressions?

2008-06-06 Thread Hamish Allan
On Fri, Jun 6, 2008 at 8:31 AM, Cemil Browne <[EMAIL PROTECTED]> wrote: > This might be a really silly question - but am I missing something obvious? > Is there any support at all for regular expressions in the Cocoa libraries? You can use NSPredicate for regexp matching, though no substitution

Re: Garbage collector vs variable lifetime

2008-06-06 Thread Hamish Allan
On Fri, Jun 6, 2008 at 11:48 PM, Bill Bumgarner <[EMAIL PROTECTED]> wrote: > The garbage collector does not currently interpret inner pointers as > something that can keep an encapsulating object alive. But it's not the inner pointers I would expect to keep the object alive -- it's the fact that

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Hamish Allan
On Sat, Jun 7, 2008 at 12:31 AM, Bill Bumgarner <[EMAIL PROTECTED]> wrote: > Yes, it is an exceedingly important optimization. Most likely, that stack > slot is being reused by some variable later on. I can see how this might be "exceedingly important" for deeply recursive functions, but for the

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Hamish Allan
On Sat, Jun 7, 2008 at 12:42 AM, Bill Bumgarner <[EMAIL PROTECTED]> wrote: > The easiest way to do this is to simply to use data once after the for() > loop: > >NSData* data = ; >const unsigned char* bytes = [data bytes]; >NSUInteger count = [data length]; >for (NSU

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Hamish Allan
On Sat, Jun 7, 2008 at 12:34 PM, Michael Ash <[EMAIL PROTECTED]> wrote: > The problem here is > that you're expecting one pointer to keep a *different* pointer live, > which the GC does not make any guarantees about. Pre garbage collection, this was straightforward: as long as you retain your NSD

Re: Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread Hamish Allan
On Sat, Jun 7, 2008 at 8:20 AM, Allison Newman <[EMAIL PROTECTED]> wrote: > Really, once you figure out how to translate > > obj = [[SomeClass alloc] initWithName: @'my name' size: 16] > > to > > obj = SomeClass.alloc.initWithName_size('my name', 16) > > you're ready to start programming with Ruby

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Hamish Allan
On Sat, Jun 7, 2008 at 2:18 PM, Michael Ash <[EMAIL PROTECTED]> wrote: > The business about scanning the stack is essentially an > implementation detail; the promise that is being made is that objects > which you're still pointing to won't go away. We're just interpreting this promise differently

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Hamish Allan
On Sat, Jun 7, 2008 at 7:34 PM, Peter Duniho <[EMAIL PROTECTED]> wrote: >> Date: Sat, 7 Jun 2008 15:31:43 +0100 >> From: "Hamish Allan" <[EMAIL PROTECTED]> >> >> We're just interpreting this promise differently. To my mind, while >> the

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Hamish Allan
On Sat, Jun 7, 2008 at 7:35 PM, Michael Ash <[EMAIL PROTECTED]> wrote: > This is pretty nitpicky. If it's in scope but you don't use it, then > it doesn't matter. Kind of like a Zen koan: if an object is collected > in the forest but nobody is pointing to it anymore, does it make a > sound? :) I

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Hamish Allan
On Sat, Jun 7, 2008 at 11:24 PM, Hamish Allan <[EMAIL PROTECTED]> wrote: > Sure, you could design NSData differently to mask a design problem in > GC. But GC won't be easier to use than retain/release/autorelease > without simple rules like "if you declare it on the stac

Re: Garbage collector vs variable lifetime

2008-06-08 Thread Hamish Allan
Hi Peter, On Sun, Jun 8, 2008 at 1:15 AM, Peter Duniho <[EMAIL PROTECTED]> wrote: > Maybe it's just because I've been using GC systems more than you have, and > so I've gotten used to thinking about memory allocations in the paradigm > that GC systems impose. I'm starting to realise that this is

Re: Garbage collector vs variable lifetime

2008-06-08 Thread Hamish Allan
On Sun, Jun 8, 2008 at 1:23 AM, Bill Bumgarner <[EMAIL PROTECTED]> wrote: > Consider: > > { >int foo; > >... calculate on foo ... > >int bar = getirdone(foo); > >while(1) { >func(bar); >func2(bar); >... etc ... >} > } > > Without being able to recycle th

Re: Garbage collector vs variable lifetime

2008-06-08 Thread Hamish Allan
On Sun, Jun 8, 2008 at 3:10 AM, Michael Ash <[EMAIL PROTECTED]> wrote: > In many cases, including this one, the release build is actually > exposing faulty code, whereas the debug build is hiding it by working > as the programmer wants it to despite the code not actually being > correct. My thank

Re: Garbage collector vs variable lifetime

2008-06-09 Thread Hamish Allan
On Mon, Jun 9, 2008 at 7:02 PM, Chris Hanson <[EMAIL PROTECTED]> wrote: > The reason these kinds of methods have a return type of (id) is that there > is no way to say "returns an object of the receiver's class." For example, > +[NSArray array] returns (id) rather than (NSArray *) because otherwi

Re: Garbage collector vs variable lifetime

2008-06-09 Thread Hamish Allan
On Mon, Jun 9, 2008 at 7:39 PM, Chris Hanson <[EMAIL PROTECTED]> wrote: > It is perfectly legal to return an NSMutableArray from a hypothetical > +(NSArray *)array method. > > However, all the sender of that +(NSArray *)array message can know is that > the result can be treated as an NSArray. It

Re: Updating a progress bar from a code loop

2008-06-10 Thread Hamish Allan
On Tue, Jun 10, 2008 at 7:24 AM, Graham Cox <[EMAIL PROTECTED]> wrote: > How do I give some time to the event loop while I'm running my own loop? See here for a recent discussion: http://www.cocoabuilder.com/archive/message/cocoa/2008/6/5/209308 Hamish __

Re: Garbage collector vs variable lifetime

2008-06-10 Thread Hamish Allan
On Tue, Jun 10, 2008 at 4:28 PM, Charles Srstka <[EMAIL PROTECTED]> wrote: > I think the problem is that if NSArray has +[NSArray array] returning an > NSArray, then NSMutableArray has to return an NSArray also, since it can't > have a different method signature for the same method. As a result, i

Re: Updating a progress bar from a code loop

2008-06-10 Thread Hamish Allan
On Tue, Jun 10, 2008 at 11:17 AM, Graham Cox <[EMAIL PROTECTED]> wrote: > In this case I can do that... though out of curiosity I wonder if there is a > way to do this "cooperatively" on the main thread without having to break up > the loop doing the actual work. For example, in Carbon one can run

Re: applicationWillTerminate and asynchronous orderly shutdown

2008-06-10 Thread Hamish Allan
On Tue, Jun 10, 2008 at 9:12 PM, Stuart Malin <[EMAIL PROTECTED]> wrote: > I have an app that establishes multiple TCP connections. If the user quits > the app, I'd like to shut all those connections gracefully (i.e., conduct a > bit of protocol) rather than just close them abruptly. To most prope

Re: Garbage collector vs variable lifetime

2008-06-11 Thread Hamish Allan
On Wed, Jun 11, 2008 at 8:01 AM, John Engelhart <[EMAIL PROTECTED]> wrote: > A return type of NSArray * means something very explicit. "But all you can > expect is an object that behaves like a NSArray, so returning a subclass of > NSArray, like NSMutableArray, is perfectly legal!" You're exactl

Re: Bound NSTreeNode - Inserting Children

2008-06-11 Thread Hamish Allan
On Wed, Jun 11, 2008 at 8:50 PM, Robert Sesek <[EMAIL PROTECTED]> wrote: > I have no other ideas for how to get this to work. Basically, the tree > displayed is incomplete, and as the user expands the tree, data is fetched > from a server and then inserted beneath a node. Do you really want to ad

Re: From c array to NSImage

2008-06-11 Thread Hamish Allan
On Wed, Jun 11, 2008 at 9:50 PM, Bill Prinzmetal <[EMAIL PROTECTED]> wrote: > I would like to create an NSImage starting from a c array. I have a c > array, e.g., > > float myArray[256][256]; > > Where the values go from 0.0 (will be black) to 1.0 (will be white) > I would like to may a gray leve

Re: argument checks

2008-06-12 Thread Hamish Allan
On Thu, Jun 12, 2008 at 6:50 AM, Ashley Perrien <[EMAIL PROTECTED]> wrote: > Noob question: I'm putting together a small code library and I'm trying to > include some error checking in the methods; what I want to protect against > is the following: > > NSNumber *myNum; > > // Lots of code where I'

Re: NSTreeController's arrangedObjects returning _NSControllerTreeProxy for KVC path?

2008-06-12 Thread Hamish Allan
On Thu, Jun 12, 2008 at 4:35 PM, Danny Price <[EMAIL PROTECTED]> wrote: > What I don't understand is why the same binding returns a different object > in two cases? Why don't get this proxy object when I bind the view directly > to the controller? Good question. I would guess that not everything

Re: Simple question - Subclassing NSView

2008-06-12 Thread Hamish Allan
Hi Vikas, On Thu, Jun 12, 2008 at 6:26 PM, Vikas <[EMAIL PROTECTED]> wrote: > I have recently started programming on Mac using Objective-C and Cocoa. I am > coming from C++/C# world. So, its a fairly basic question. Please help me > understand the following code: > > @implementation MyView

Re: Simple question - Subclassing NSView

2008-06-12 Thread Hamish Allan
On Thu, Jun 12, 2008 at 6:54 PM, Vikas <[EMAIL PROTECTED]> wrote: > NSRectFill() is a C function, not part of any class e.g. NSView. aRect is > simply a struct which specify location points (doesnt contain reference of > any window). How the function knows about the drawing surface, in which > win

Re: NSNotifications & background apps?

2008-06-15 Thread Hamish Allan
On Sat, Jun 14, 2008 at 8:52 PM, dream cat7 <[EMAIL PROTECTED]> wrote: > Seeing notifications from outside: > [...] > Sometimes 2 process are > communicating And one of them is launching / closing multiple times during > the session (e.g. sending kill message as NSNotification). You refer to NSNo

Re: Converting to NSPersistentDocument

2008-06-15 Thread Hamish Allan
On Sun, Jun 15, 2008 at 11:42 AM, Steven Hamilton <[EMAIL PROTECTED]> wrote: > I've been a busy bee learning Cocoa and core data (as my frequent postings > may reveal) and now I wish to add NSPersistentDocument functionality. I > started my project using the normal Core Data template so how do I c

Re: How can an object know when another object has gone away?

2008-06-15 Thread Hamish Allan
On Sun, Jun 15, 2008 at 11:20 PM, James W. Walker <[EMAIL PROTECTED]> wrote: > Here's my specific situation. I have several controllers that can create > tasks, using an NSTask wrapper based on the Moriarty sample. When a task > completes, it sends a message to the controller that created it. I

  1   2   3   >