Re: Garbage collector vs variable lifetime

2008-06-07 Thread Antonio Nunes
On 7 Jun 2008, at 06:16, Ken Thomases wrote: On Jun 6, 2008, at 10:48 PM, Antonio Nunes wrote: Why not explicitly turn off collection for the data pointer: NSData* data = ; [[NSGarbageCollector defaultCollector] disableCollectorForPointer:data]; const unsigned char* bytes = [data bytes]; NS

Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread Allison Newman
I can't for the life of me imagine why you would think that. I mean, I'm not theorising here, I have actually done it. My very first Cocoa app was a RubyCocoa app, and my second, a true, full-featured app, is just about done. And you know what, I never did regret my decision to not really lea

Re: Core Data Questions

2008-06-07 Thread William Turner
Hi Gordon, If you're designing a data model using Core Data, it's actually very useful to step back and look at your data the way a layperson would. By this I mean forget about classes and inheritance and all that stuff. You can come back to it later, but the main thing is to look at the

FTP framework

2008-06-07 Thread Davide Scheriani
hello guys, where can I find an FTP framework? I need to implement my application but the native ftp isnt soo good. tnx ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: FTP framework

2008-06-07 Thread Seth Willits
On Jun 7, 2008, at 12:54 AM, Davide Scheriani wrote: hello guys, where can I find an FTP framework? I need to implement my application but the native ftp isnt soo good. http://opensource.utr-software.com/connection/ None better. -- Seth Willits __

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Quincey Morris
I'm fairly satisfied with Bill's (and others') suggested workarounds about how to keep the object from being collected, but if I might ramble just a little: On Jun 6, 2008, at 22:03, Bill Bumgarner wrote: On Jun 6, 2008, at 9:16 PM, Ken Thomases wrote: And... we're back to retain/release.

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Quincey Morris
On Jun 7, 2008, at 00:07, Antonio Nunes wrote: Although I maybe did not make it that clear, I actually meant my suggestion also as a question. I'm surprised no-one else suggested to temporarily turn of garbage collection for this pointer. I'm curious as to why Bill suggested his solution r

Re: Regular Expressions?

2008-06-07 Thread Ilan Volow
What I found so useful about Cocoa-Java was that it was the perfect tool for easily writing Cocoa Apps that made heavy use of technologies that Apple was too short-sighted to add, largely because Java came out- of-the-box with so many useful classes for basic stuff like regular expressions.

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Ken Thomases
On Jun 7, 2008, at 12:03 AM, Bill Bumgarner wrote: On Jun 6, 2008, at 9:16 PM, Ken Thomases wrote: And... we're back to retain/release. The issue is, how can one know when this technique is necessary? The supposed rules of GC are, if it's in a stack variable, it's safe. The compiler here

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Ken Thomases
On Jun 7, 2008, at 3:41 AM, Quincey Morris wrote: On Jun 7, 2008, at 00:07, Antonio Nunes wrote: Although I maybe did not make it that clear, I actually meant my suggestion also as a question. I'm surprised no-one else suggested to temporarily turn of garbage collection for this pointer. I'

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Michael Ash
On Sat, Jun 7, 2008 at 7:13 AM, Ken Thomases <[EMAIL PROTECTED]> wrote: > Nobody is claiming that it should. It's not about the char* pointer. It's > about the NSData* pointer. Actually I think that it is about the char * pointer, and this bug should be considered an NSData bug rather than a com

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: Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread Felipe Monteiro de Carvalho
On Sat, Jun 7, 2008 at 4:20 AM, Allison Newman <[EMAIL PROTECTED]> wrote: > obj = [[SomeClass alloc] initWithName: @'my name' size: 16] > > to > > obj = SomeClass.alloc.initWithName_size('my name', 16) And in Pascal: obj := SomeClass.initWithName_size('my name', 16); (alloc is called automatical

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: Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread David Troy
Syntactical transformations, especially those where semantic parity is retained, have never struck me as much of a barrier. I am new to Objective C (though not to C) and have had a lot of experience in Ruby, and I am struck by how structurally similar Objective C and Ruby actually are. The

Re: Learning Cocoa with RubyCocoa

2008-06-07 Thread has
Allison Newman wrote: I can't for the life of me imagine why you would think that. I mean, I'm not theorising here, I have actually done it. My very first Cocoa app was a RubyCocoa app, and my second, a true, full- featured app, is just about done. And you know what, I never did regret

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Michael Ash
On Sat, Jun 7, 2008 at 8:47 AM, Hamish Allan <[EMAIL PROTECTED]> wrote: > 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. > >

Re: knowing when WebView is done

2008-06-07 Thread Timothy Ritchey
On Jun 7, 2008, at 1:32 AM, Adam R. Maxwell wrote: Never. Since the frameworks retain/(auto)release stuff all the time behind your back, logging -retainCount is worse than useless, in my opinion. Very good point. It looks like he call to setMainFrameURL is what bumps up the retain coun

SOLVED: Programatically manipulating an xcdatamodel package?

2008-06-07 Thread Allen Cronce
As suspected, I couldn't come up with a way to directly edit the xcdatamodel. I tried using NSKeyedUnarchiver to obtain the object graph for the xcdatamodel's "elements" plist. This failed because the resulting objects are implemented in the private XDBase framework. To solve the problem I

Re: SOLVED: Programatically manipulating an xcdatamodel package?

2008-06-07 Thread I. Savant
Allen: Once I've got the modified mom file, I manually import it back into a clean data model using Xcode. At this point, the updated model can be viewed or edited using Xcode's data modeling tool. First, please don't cross-post between lists. Second, what manipulations are you doing? J

xCode resources and paths in bundle

2008-06-07 Thread Mike
I need to include few different resource-types to my project and app.bundle. In my xcode-project -folder (finder) I have "resourcefiles"- subdirectory and under that few subdirectories for these different resource types (fonts, textures, etc). I have dragged those dirs to xcode "group & fi

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Ricky Sharp
On Jun 7, 2008, at 8:18 AM, Michael Ash wrote: It *does* do this. The error is not in the GC, but rather in the assumption that "declared in the current scope" is equivalent to "is on the stack frame". This assumption is not valid. The fact that you can't make this assumption is extremely incon

Re: SOLVED: Programatically manipulating an xcdatamodel package?

2008-06-07 Thread Allen Cronce
On Jun 7, 2008, at 6:54 AM, I. Savant wrote: Once I've got the modified mom file, I manually import it back into a clean data model using Xcode. At this point, the updated model can be viewed or edited using Xcode's data modeling tool. First, please don't cross-post between lists. Sorry.

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

Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread Jose Raul Capablanca
Allison Newman said: It's just that I can't help thinking about all of the comments that we see on this list from people coming from Java or some other language where header files aren't necessary, or which don't have pointers. They are confused by these things, and having to learn that

3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-07 Thread Jason Stephenson
Ilan Volow wrote: Back in the Jaguar-era when I had to write applications that made heavy use of XML and regular expressions, Cocoa-Java saved the day--no 3rd-party nonsense required. This in not a knock on Ilan. His mail just happens to embody an attitude that I see quite frequently on thi

Re: knowing when WebView is done

2008-06-07 Thread Adam R. Maxwell
On Jun 7, 2008, at 6:26 AM, Timothy Ritchey wrote: On Jun 7, 2008, at 1:32 AM, Adam R. Maxwell wrote: From a quick check with Instruments, it looks like internal WebKit stuff is retaining the view for callbacks even after it's done loading, then releasing it on a later pass through the r

Re: Garbage collector vs variable lifetime

2008-06-07 Thread John Engelhart
On Jun 6, 2008, at 7:27 PM, Quincey Morris wrote: On Jun 6, 2008, at 15:48, Bill Bumgarner wrote: The garbage collector does not currently interpret inner pointers as something that can keep an encapsulating object alive. Thus, the behavior is undefined and that it changes between debug

Re: ArrayController Out of Bounds

2008-06-07 Thread Gerriet M. Denkmann
On 4 Jun 2008, at 21:50, Shawn Erickson wrote: On Wed, Jun 4, 2008 at 6:18 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: When this table contains some rows and I click on the table column header I always get: *** -[NSCFArray objectAtIndex:]: index (-1) beyond bounds (5) where 5 is the

Finding front view in a Cocoa app

2008-06-07 Thread John James
This seems like it should be easy, but I can not find anything with various googles etc. I want to animate only my front view for performance reasons. How do i determine the current top view (document). I found something in carbon about FrontWindow, but I am trying to stay in Cocoa. Any su

Re: Finding front view in a Cocoa app

2008-06-07 Thread Adam R. Maxwell
On Jun 7, 2008, at 9:11 AM, John James wrote: This seems like it should be easy, but I can not find anything with various googles etc. I want to animate only my front view for performance reasons. How do i determine the current top view (document). I found something in carbon about FrontWi

Re: 3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-07 Thread Ken Ferry
In math, a result is 'elegant' if it just _does_ something, simply and quickly, rather than relying on a mass of machinery done elsewhere, that you either have to assume works or spend time understanding. A large dependency can make it harder to say what, exactly, are the key lynchpins that make t

Re: Regular Expressions?

2008-06-07 Thread John Engelhart
On Jun 6, 2008, at 1:27 PM, Vincent E. wrote: When I mentioned "perl -pe 's/\b(.*?)/\u\L$1/g'" I actually wasn't asking for any ObjC method with a look-alike syntax. I actually wouldn't give a damn about "how" ("s///g") to pass a regex pattern to a method. ;) I was rather asking whether Re

Re: Finding front view in a Cocoa app

2008-06-07 Thread Kyle Sluder
On Sat, Jun 7, 2008 at 12:11 PM, John James <[EMAIL PROTECTED]> wrote: > Any suggestions? I have no idea what you're talking about when you say "front view." Do you mean the first responder of the foremost window? Or the content view of the foremost window? Or the key view? There is no concept

Re: 3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-07 Thread Kyle Sluder
On Sat, Jun 7, 2008 at 10:43 AM, Jason Stephenson <[EMAIL PROTECTED]> wrote: > As someone who has worked on a number of 3rd party [open source and > otherwise] frameworks, I wonder where this attitude comes from in the case > of Cocoa/Mac OS X. I have some ideas, but I hesitate to share them. Four

Re: 3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-07 Thread Kevin Grant
It is possible to link your application through C to an interpreter like Python or Perl, and rely on the built-in regular expression libraries to do your work. If you really wanted to, you could fire off a call to /usr/bin/egrep. These are all part of the default Mac OS X platform, they require

Re: 3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-07 Thread glenn andreas
On Jun 7, 2008, at 12:37 PM, Kevin Grant wrote: It is possible to link your application through C to an interpreter like Python or Perl, and rely on the built-in regular expression libraries to do your work. If you really wanted to, you could fire off a call to /usr/bin/egrep. That last one

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Quincey Morris
On Jun 7, 2008, at 04:34, Michael Ash wrote: Actually I think that it is about the char * pointer, and this bug should be considered an NSData bug rather than a compiler bug or a GC bug. The fact that it's really a design bug in NSData rather than something that can be easily fixed definitely m

Re: Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread Michael Ash
On Sat, Jun 7, 2008 at 10:38 AM, Jose Raul Capablanca <[EMAIL PROTECTED]> wrote: > I know that Obj-C is more dynamic than Java (and that's quite important for > Cocoa to work its magic), but if Apple had never developed Cocoa and were to > do it now, from scratch, I doubt that they would choose to

Re: 3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-07 Thread Michael Ash
On Sat, Jun 7, 2008 at 10:43 AM, Jason Stephenson <[EMAIL PROTECTED]> wrote: > It seems that many on this list feel that Apple should provide everything > that the programmer needs to work on Mac OS X and that there should not be > 3rd party frameworks for much of anything. > > This attitude really

Re: Drawing over a QTCaptureView

2008-06-07 Thread douglas a. welton
HI Gordon, perhaps I'm missing something really basic (and if I am please set me straight)... Have you tried using CICrop to clip the CIImage? To me, that would seem like a straightforward solution to your needs and get rid of any conversion to an NSImage and back. Additionally, CIAffi

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Michael Ash
On Sat, Jun 7, 2008 at 9:59 AM, Ricky Sharp <[EMAIL PROTECTED]> wrote: > I will hope though that within the context of say memcpy, that the GC thread > could not collect data. For example, the following should be safe: > > memcpy(myLocalGCAwareBuffer, [data bytes], numberOfBytes); Not at all. The

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Peter Duniho
Date: Sat, 7 Jun 2008 15:31:43 +0100 From: "Hamish Allan" <[EMAIL PROTECTED]> 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 stil

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Michael Ash
On Sat, Jun 7, 2008 at 10:31 AM, Hamish Allan <[EMAIL PROTECTED]> wrote: > 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 sti

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Michael Ash
On Sat, Jun 7, 2008 at 2:19 PM, Quincey Morris <[EMAIL PROTECTED]> wrote: > The consequence of this should be either: > > (a) [data bytes] must promise to return a collectable object (so that the > 'bytes' reference keeps it alive), or > > (b) [data bytes] must lock (pseudo-retain) something intern

Re: Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread Felipe Monteiro de Carvalho
On Sat, Jun 7, 2008 at 11:38 AM, Jose Raul Capablanca <[EMAIL PROTECTED]> wrote: > With the exception of the id and SEL types, > categories, and the fact that you can send messages to nil, I can't think of > anything in Obj-C that isn't done better in Java, Here is one: Integration with other lang

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Jean-Daniel Dupas
Le 7 juin 08 à 20:30, Michael Ash a écrit : On Sat, Jun 7, 2008 at 9:59 AM, Ricky Sharp <[EMAIL PROTECTED]> wrote: I will hope though that within the context of say memcpy, that the GC thread could not collect data. For example, the following should be safe: memcpy(myLocalGCAwareBuffer, [d

Java and Objective-C

2008-06-07 Thread Bill Bumgarner
On Jun 7, 2008, at 12:01 PM, Felipe Monteiro de Carvalho wrote: On Sat, Jun 7, 2008 at 11:38 AM, Jose Raul Capablanca <[EMAIL PROTECTED] > wrote: With the exception of the id and SEL types, categories, and the fact that you can send messages to nil, I can't think of anything in Obj-C that isn

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Ricky Sharp
On Jun 7, 2008, at 1:30 PM, Michael Ash wrote: On Sat, Jun 7, 2008 at 9:59 AM, Ricky Sharp <[EMAIL PROTECTED]> wrote: Finally, I think that usages of NSMutableData may also be a bit tricky. In my case I'll probably just obtain a copy of its bytes, manipulate them and then copy the result

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Ricky Sharp
On Jun 7, 2008, at 2:07 PM, Jean-Daniel Dupas wrote: Le 7 juin 08 à 20:30, Michael Ash a écrit : On Sat, Jun 7, 2008 at 9:59 AM, Ricky Sharp <[EMAIL PROTECTED]> wrote: I will hope though that within the context of say memcpy, that the GC thread could not collect data. For example, the fo

Re: Re: Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread WT
Michael Ash said: I disagree with your assessment that there's nothing in ObjC that isn't done better in Java If you read my message again, I think you'll see that I didn't go as far as to say that, or even to suggest it. In fact, I explicitly mentioned features of Obj-C that are useful,

Re: Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread WT
On Jun 7, 2008, at 9:01 PM, Felipe Monteiro de Carvalho wrote: On Sat, Jun 7, 2008 at 11:38 AM, Jose Raul Capablanca <[EMAIL PROTECTED] > wrote: With the exception of the id and SEL types, categories, and the fact that you can send messages to nil, I can't think of anything in Obj-C that isn

Re: Java and Objective-C

2008-06-07 Thread Denis Bohm
On Jun 7, 2008, at 12:38 PM, Bill Bumgarner wrote: On Jun 7, 2008, at 12:01 PM, Felipe Monteiro de Carvalho wrote: On Sat, Jun 7, 2008 at 11:38 AM, Jose Raul Capablanca <[EMAIL PROTECTED] > wrote: With the exception of the id and SEL types, categories, and the fact that you can send messages

Re: Java and Objective-C

2008-06-07 Thread Bill Bumgarner
Thank you -- this is the kind of side by side, purely code oriented, set of comparisons that I think are both largely missing and generally quite useful. Comments inline. On Jun 7, 2008, at 1:30 PM, Denis Bohm wrote: The Objective-C example on that page is: - (void)setGridVisible:(NSNumber

Re: Java and Objective-C

2008-06-07 Thread WT
Bill Bumgarner said: This comes up time and time again -- Why did Apple choose Objective- C vs. Language X? That is off topic for cocoa-dev and, thus, not a useful direction for taking this particular conversation. Point taken. I apologize for feeding this particular topic. I believe, how

Re: Java and Objective-C

2008-06-07 Thread Denis Bohm
On Jun 7, 2008, at 1:49 PM, Bill Bumgarner wrote: Thank you -- this is the kind of side by side, purely code oriented, set of comparisons that I think are both largely missing and generally quite useful. Comments inline. On Jun 7, 2008, at 1:30 PM, Denis Bohm wrote: The Objective-C exam

Re: xCode resources and paths in bundle

2008-06-07 Thread Nick Zitzmann
On Jun 7, 2008, at 7:54 AM, Mike wrote: 1. All these resources-files goes to same single directory inside app.bundle (app.bundle/contents/resources) How do I make them go to separate subfolders under resources? i.e. app.bundle/contents/resources/fonts app.bundle/contents/resources/textures ap

Re: Java and Objective-C

2008-06-07 Thread Bill Bumgarner
On Jun 7, 2008, at 1:49 PM, WT wrote: Actually, I think that discussing the details of how to implement X in Java is also off-topic for this list. Nevertheless, I will point out that Java has a whole package for managing undos (javax.swing.undo). Having taught Objective-C and Cocoa (and pr

Re: Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread John C. Randolph
I didn't say not to use Ruby if you want. What I took exception to is your statement that "you don't have to fully learn Objective-C's syntax at the same time as Cocoa". Use whatever language you like, but if you're going to use Cocoa, you'd *better* learn Objective-C. -jcr

Re: Java and Objective-C

2008-06-07 Thread Bill Bumgarner
On Jun 7, 2008, at 1:54 PM, Denis Bohm wrote: That is handled by the Java example above (via the "Object... args"). A method with any number of arguments can be passed to registerUndoWithTarget. So you could do something like: undoManager.registerUndoWithTarget(this, "setFrame", true, sp

Re: Java and Objective-C

2008-06-07 Thread Denis Bohm
On Jun 7, 2008, at 2:01 PM, Bill Bumgarner wrote: On Jun 7, 2008, at 1:49 PM, WT wrote: But here's the flip-side of your question, which clarifies what I had been saying in previous messages: what features of NSUndoManager require Cocoa's native language to be based on C? I'm not familia

Re: Java and Objective-C

2008-06-07 Thread Denis Bohm
On Jun 7, 2008, at 2:08 PM, Bill Bumgarner wrote: On Jun 7, 2008, at 1:54 PM, Denis Bohm wrote: That is handled by the Java example above (via the "Object... args"). A method with any number of arguments can be passed to registerUndoWithTarget. So you could do something like: undoManag

Re: Java and Objective-C

2008-06-07 Thread Bill Bumgarner
On Jun 7, 2008, at 2:10 PM, Denis Bohm wrote: I don't think the same level of dynamism could be added to any other language without changing the nature of the language. For Java, adding such degrees of dynamism would change the fundamental nature of the virtual machines and JIT compilers i

namespaces and prefixes

2008-06-07 Thread Denis Bohm
I understand that Objective-C doesn't have namespaces and that prefixes are used to help avoid naming conflicts. A couple of the obvious ones (like NS) are easy to pick up glancing at some of the API docs. Is there a list anywhere of all the prefixes that Apple has used so I can avoid the

Re: Java and Objective-C

2008-06-07 Thread Denis Bohm
Java does not have an equivalent of categories, which is what I think you are using below. So that is certainly different. In Java, you can load classes on the fly that derive from other classes and override methods. I'm not aware of any issues with the JIT improperly inlining methods in

Re: Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread John C. Randolph
On Jun 7, 2008, at 7:38 AM, Jose Raul Capablanca wrote: I never understood why Apple stopped supporting the Java bridge to Cocoa. Two reasons: First, not enough people were using it to make it cost- effective to maintain, and second, it was sucking up a lot of development time when new

Re: Java and Objective-C

2008-06-07 Thread Ken Ferry
On Sat, Jun 7, 2008 at 2:10 PM, Denis Bohm <[EMAIL PROTECTED]> wrote: > > On Jun 7, 2008, at 2:01 PM, Bill Bumgarner wrote: > >> Actually, any object oriented language that >> has the ability to inline methods such that they cannot be "out of lined" >> again at runtime cannot support the dynamism

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 variable is still in scope, I *do* have a pointer to the obje

Re: namespaces and prefixes

2008-06-07 Thread James Murdza
Open the documentation and type the prefix in the spotlight box. See if anything comes up. That will cover you for all of Apple's prefixes. For third party prefixes a page like this is useful: http://www.cocoadev.com/index.pl?ChooseYourOwnPrefix On Sat, Jun 7, 2008 at 5:49 PM, Denis Bohm <[EMAIL P

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: 3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-07 Thread Torsten Curdt
Agree with your sentiments. Not everything needs to be shipped by default. The only other environment where I've programmed that this same attitude may rear its head could be Java land, but even there that attitude does not seem to rear its head quite so often as it seems to on this li

Re: Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread Philippe Mougin
Le 7 juin 08 à 22:26, WT a écrit : I still don't see any good-enough *technical* reason to justify basing Cocoa on an extension of C, however. That's all I've been trying to say. WT, I think this is an interesting question (as are your other comments), and I think I have the answer :-) T

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 stack, it's in the > root set,

Re: Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread Torsten Curdt
On Jun 7, 2008, at 07:38, Jose Raul Capablanca wrote: Allison Newman said: It's just that I can't help thinking about all of the comments that we see on this list from people coming from Java or some other language where header files aren't necessary, or which don't have pointers. They

Re: Learning Cocoa with RubyCocoa (was Regular Expressions)

2008-06-07 Thread Torsten Curdt
Here is one: Integration with other languages Java's integration with other languages (as using Java libraries in other languages) is about one of the worse I've ever seen. It basically makes any Java library accessible to only Java. Yepp - the integration sucks but... And a second one: Perfo

Re: Java and Objective-C

2008-06-07 Thread Torsten Curdt
Implementation wise (and this is not to be relied on), when you begin observing an object, the object's class is dynamically subclassed, and the property accessors are overridden. The overrides call the original implementation and also do the notification of interested parties. The original obje

Re: Java and Objective-C

2008-06-07 Thread Peter Duniho
Date: Sat, 07 Jun 2008 12:38:14 -0700 From: Bill Bumgarner <[EMAIL PROTECTED]> This comes up time and time again -- Why did Apple choose Objective-C vs. Language X? That is off topic for cocoa-dev and, thus, not a useful direction for taking this particular conversation. I agree. In spite of

Re: My windows don't cascade

2008-06-07 Thread Boyd Collier
Okay; I'm properly chastised for having originally read the documentation without as much understanding as I should have. That was a couple of years ago, and it worked just as it should have until recently. I've gone back through the documentation and now understand it much better, and I

Re: 3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-07 Thread Mark Munz
On 6/7/08, Michael Ash <[EMAIL PROTECTED]> wrote: > Of course Mac OS X does come with a regex library, it just doesn't > have an ObjC interface. There's more to what's available than Cocoa, > and one of the great things about ObjC is how easy it is to talk to > these pure C libraries and get t

Re: Java and Objective-C

2008-06-07 Thread Peter Duniho
Date: Sat, 07 Jun 2008 14:08:46 -0700 From: Bill Bumgarner <[EMAIL PROTECTED]> On Jun 7, 2008, at 1:54 PM, Denis Bohm wrote: That is handled by the Java example above (via the "Object... args"). A method with any number of arguments can be passed to registerUndoWithTarget. So you could do some

Re: Java and Objective-C

2008-06-07 Thread Peter Duniho
Date: Sat, 07 Jun 2008 14:43:26 -0700 From: Bill Bumgarner <[EMAIL PROTECTED]> Subject: Re: Java and Objective-C [...] More subtly, consider what would happen if an accessor method were inlined by the JIT or compiler. Such an action would effectively make it impossible to do KVO against said ac

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Peter Duniho
Date: Sat, 7 Jun 2008 23:24:22 +0100 From: "Hamish Allan" <[EMAIL PROTECTED]> Whenever you write documentation in a natural language, there is scope for ambiguity. This particular technical specification is only mentioned in a single sentence: "The root set is comprised of all objects reachable

Re: Java and Objective-C

2008-06-07 Thread Bill Bumgarner
On Jun 7, 2008, at 4:16 PM, Peter Duniho wrote: As I pointed out in my other replies, implementing something like NSUndoManager is trivial in C#. It would only be slightly more so in Java, and only because of the above. There's really no need to rehash the discussion; just look at the prev

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Bill Bumgarner
On Jun 7, 2008, at 3:51 PM, Hamish Allan wrote: Sorry to reply to myself, but I just remembered that pointers in registers are also in the root set! That said, I don't think it changes the substance of my proposal: that stack variables (i.e. variables semantically placed on the stack by the progr

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Chris Hanson
On Jun 6, 2008, at 5:36 PM, Quincey Morris wrote: A little inner voice insists on asking, though, how we know some future version of the compiler might not optimize '[data self]' upwards before the loop, if it decides that nothing inside the loop references anything non-local: This won't

Re: Java and Objective-C

2008-06-07 Thread Michael Ash
On Sat, Jun 7, 2008 at 6:08 PM, Ken Ferry <[EMAIL PROTECTED]> wrote: > On Sat, Jun 7, 2008 at 2:10 PM, Denis Bohm <[EMAIL PROTECTED]> wrote: >> >> On Jun 7, 2008, at 2:01 PM, Bill Bumgarner wrote: >> >>> Actually, any object oriented language that >>> has the ability to inline methods such that t

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Michael Ash
On Sat, Jun 7, 2008 at 6:37 PM, Hamish Allan <[EMAIL PROTECTED]> wrote: > 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 t

Re: Cocoa n00b frustrations

2008-06-07 Thread Charles Jenkins
With regard to my problems with delegates, I think maybe my frustrations stem from something about the delegation process or about text fields that I do not understand. Here is how to recreate an example of my problem. STEP 1: Start a new project called 'WhatKb' STEP 2: Add a Cocoa Objective C

Re: Cocoa n00b frustrations

2008-06-07 Thread Robert Nicholson
You can try the following methods - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor { [ MyController logCurrentInputSource ]; return true; } - (void)controlTextDidBeginEditing:(NSNotification *)aNotification { [ MyController logCurrentIn

Re: Cocoa n00b frustrations

2008-06-07 Thread Andy Lee
On Jun 7, 2008, at 11:44 PM, Charles Jenkins wrote: -(BOOL)textShouldBeginEditing:(NSText*)textObject; -(void)textDidBeginEditing:(NSNotification*)aNotification; It seems you've set the delegate of the text fields correctly. (To confirm that they were correctly set by IB, you could NSLog the

Re: Cocoa n00b frustrations

2008-06-07 Thread John Pannell
Hi Charles- On Jun 7, 2008, at 9:44 PM, Charles Jenkins wrote: With regard to my problems with delegates, I think maybe my frustrations stem from something about the delegation process or about text fields that I do not understand. There's just a little twist to NSTextField that you are mi

Re: Cocoa n00b frustrations

2008-06-07 Thread Michael Vannorsdel
textShouldBeginEditing: and textDidBeginEditing: are generally methods you'd override in a subclass. By default they call the control:textShouldBeginEditing: and controlTextDidBeginEditing: of the delegate (if there is one). The latter are the methods your delegate needs to implement.

Re: Cocoa n00b frustrations

2008-06-07 Thread Uli Kusterer
Am 05.06.2008 um 06:32 schrieb Charles Jenkins: I had a Nib file that went bad. Suddenly, my outlets doubled up: IB indicated that a class had two outlets named 'textField1' and 'textField2'. You sure it went bad? If you have IBOutlets and rename them, IB sometimes keeps entries for the

Re: Cocoa n00b frustrations

2008-06-07 Thread Uli Kusterer
Am 07.06.2008 um 20:33 schrieb John Pannell: I think the secret to getting this type of thing right is that the documentation uses the end of the instance methods list for a class to call out specifically when methods are delegate methods. Look at the end of NSControl's list and you can see

Re: Cocoa n00b frustrations

2008-06-07 Thread Uli Kusterer
Am 07.06.2008 um 21:05 schrieb Uli Kusterer: You sure it went bad? If you have IBOutlets and rename them, IB sometimes keeps entries for these connections in the NIB file. It does this since you may be copy-and-pasting in your source files, and it wouldn't want to trash that connection just

NSPopupButton Item to Create New Object

2008-06-07 Thread Jamie Phelps
I have an NSPopupButton bound to an NSArrayController to provide options for the user to select from. What I would like to do is have one option (probably the first item) in the popup for the user to select that would allow them to create a new object if it doesn't yet exist. Is this poss

Re: My windows don't cascade

2008-06-07 Thread Kyle Sluder
On Sat, Jun 7, 2008 at 7:17 PM, Boyd Collier <[EMAIL PROTECTED]> wrote: > Okay; I'm properly chastised for having originally read the documentation > without as much understanding as I should have. That was a couple of years > ago, and it worked just as it should have until recently. I've gone ba

Re: Cocoa n00b frustrations

2008-06-07 Thread Uli Kusterer
Am 07.06.2008 um 20:29 schrieb Andy Lee: NSLog( @"Current input source '%s'", [ name UTF8String ] ); Urrk. bad. You can't expect %s to be UTF8. Instead, do: NSLog(@"Current input source '%@'", name ); Cheers, -- Uli Kusterer "The Witnesses of TeachText are everywhere..." http://www.zathras

  1   2   >