Customizing an NSToolbar to wrap it's tools.

2009-03-14 Thread Ken Tozier
Hi I would like to customize an NSToolbar to make it's tools wrap rather than overflow, but I can't see any way to control the toolbar height. Is there some way to do this? I've had a lot of practice writing wrapping views but NSToolbar seems to be locked up pretty tight as far as how it

Re: NSManagedObject validateForDelete problem

2009-03-14 Thread Ward Ruth
Thanks for the feedbacks -- makes total sense to me now. Yeah, I was under the mistaken impression NSManagedObject's -validateForDelete was something that would work for me to call before actually attempting the delete. After actually performing a delete and save (based on my toy example)

Re: Performance problem with GC enabled

2009-03-14 Thread Paul Sanders
How about perl instead? (I don't think egrep is a fair test, it doesn't have to 'do anything' with the results, like create a new string from them). This is a rough perl equivalent of my original problem: I guess that's the point I was trying to get across - the overhead of creating all

Re: Calling Script Objects in Applescript

2009-03-14 Thread has
Karen van Eck wrote: We have a lot of code in libraries in Applescript. Now starting to look at using Cocoa to move forward, as we are really using Applescript to pretty much its limit. But it is not a short term solution to rewrite all our Applescript libraries in Objective-C. We need to be

Re: Performance problem with GC enabled

2009-03-14 Thread Michael Ash
On Sat, Mar 14, 2009 at 6:11 AM, Paul Sanders p.sand...@dsl.pipex.com wrote: If Apple later on wants to change how it works internally so that the function returns a temporary object instead, well, too bad, can't! Well, that's patently untrue.  It can just return a temporary object with a

Re: Calling Script Objects in Applescript

2009-03-14 Thread Ken Tozier
Have you looked at OSAKit? It has methods for executing subroutines of scripts without having to do that initWithSource hack. You can find the header files here: /System/Library/Frameworks/ OSAKit.framework/Versions/A/Headers/ A couple of caveats about using it though. Subroutine names have

Re: How to use MySql, which api is for that

2009-03-14 Thread Karolis Ramanauskas
I happily used ActiveRecord http://github.com/aptiva/activerecord/tree/master Look how nice it is to connect: NSDictionary * databaseConnectionInfo = [NSDictionary dictionaryWithObjectsAndKeys: @127.0.0.1, @host, @obama, @user, @supersecretpassword, @password, @databasename, @database,

Any interest in an article comparing and contrasting Cocoa with MS Managed C++ with CLI

2009-03-14 Thread Erik Buck
I am a Cocoa expert, and I have been teaching myself Microsoft Managed C++ (a language very different from ANSI/ISO standard C++) along with Microsoft's CLR/CLI (.Net) frameworks. I am still a novice with Managed C++ and .Net, but I have already drawn some conclusions that were surprising

Re: Performance problem with GC enabled

2009-03-14 Thread Bill Bumgarner
On Mar 14, 2009, at 3:29 AM, Paul Sanders wrote: I'm sorry Bill, but the more I hear about GC and in particular the difficulties of using it with malloc'd memory the gladder I am not to be using it. I guess that one should not be surprised that it is difficult to retro-fit it in the way

Re: Performance problem with GC enabled

2009-03-14 Thread Kyle Sluder
On Sat, Mar 14, 2009 at 12:22 PM, Bill Bumgarner b...@mac.com wrote: On Mar 14, 2009, at 3:29 AM, Paul Sanders wrote: GC is similar to Core Data.   If you had a Core Data app on Tiger, there were numerous operations on Leopard that were significantly faster -- many, many times faster -- that

How to create an NSDecimal?

2009-03-14 Thread WT
Hello all, I was reading the Number and Value Programming Topics for Cocoa section about decimal numbers and now I'm confused. If I want to use the C interface rather than the NSDecimalNumber class, how do I instantiate an NSDecimal struct? According to the Foundation Data Types

Re: Performance problem with GC enabled

2009-03-14 Thread Bill Bumgarner
On Mar 14, 2009, at 9:27 AM, Kyle Sluder wrote: On Sat, Mar 14, 2009 at 12:22 PM, Bill Bumgarner b...@mac.com wrote: On Mar 14, 2009, at 3:29 AM, Paul Sanders wrote: GC is similar to Core Data. If you had a Core Data app on Tiger, there were numerous operations on Leopard that were

Re: Performance problem with GC enabled

2009-03-14 Thread Paul Sanders
Well, that's patently untrue. It can just return a temporary object with a retain count of 1. No, it can't. I specified a Get function, where convention specifies that the caller does not own it. Even if Apple were willing to break with convention, such a change would cause every existing

Re: Customizing an NSToolbar to wrap it's tools.

2009-03-14 Thread Joar Wingfors
On 13 mar 2009, at 23.55, Ken Tozier wrote: I would like to customize an NSToolbar to make it's tools wrap rather than overflow, but I can't see any way to control the toolbar height. Is there some way to do this? I've had a lot of practice writing wrapping views but NSToolbar seems to be

Messages between Threads

2009-03-14 Thread Gerriet M. Denkmann
I have a Main object which has: - (void)add2Number: (NSNumber *)n; { self.sum += [ n intValue ];;// bound to TextField self.count++; // bound to TextField and ProgressIndicator } The UserInterface has a Start/Stop button which does (on

Re: Performance problem with GC enabled

2009-03-14 Thread Paul Sanders
But, heck, if you think it will serve your product's time to market better by focusing on the innards than the directly customer facing bits and then playing catch-up when Apple significantly advances the state of the art of similar technologies, well... bully for you! I believe I mentioned

Re: Any interest in an article comparing and contrasting Cocoa with MSManaged C++ with CLI

2009-03-14 Thread Paul Sanders
Is anyone interested in an article or series of articles comparing and contrasting Managed C++ with Objective-C and CLI (.Net) with Cocoa ? Yes, very much so. It would be good if you could post a notification to this list when you have decided where to publish this. The Code Project might

Re: How to create an NSDecimal?

2009-03-14 Thread Ashley Clark
On Mar 14, 2009, at 11:28 AM, WT wrote: I was reading the Number and Value Programming Topics for Cocoa section about decimal numbers and now I'm confused. If I want to use the C interface rather than the NSDecimalNumber class, how do I instantiate an NSDecimal struct? According to the

Re: NSProgressIndicator's setUsesThreadedAnimation only works sometimes?

2009-03-14 Thread Keary Suska
On Mar 13, 2009, at 4:20 PM, Sean McBride wrote: Hi all, I'm trying to make a cheap, modal, indeterminate progress dialog, but I'm having trouble animating the progress bar. (Yes, I know this is only slightly better than the spinning wheel of death. Yes, I know I should thread my long

Re: Messages between Threads

2009-03-14 Thread Paul Sanders
So: what should be done? 1. Do the calculations in a sub-thread. 2. Test a 'please stop' variable each time round the loop in that thread. 3. Set this variable in the main thread when the user clicks the Stop button. 4. To show progress, call performSelectorOnMainThread from the

Re: Calling Script Objects in Applescript

2009-03-14 Thread Matt Neuburg
On Fri, 13 Mar 2009 14:23:37 +, Karen van Eck karen.van@sonoco-trident.com said: We have a lot of code in libraries in Applescript. Now starting to look at using Cocoa to move forward, as we are really using Applescript to pretty much its limit. But it is not a short term solution to

Re: Performance problem with GC enabled

2009-03-14 Thread Sean McBride
Bill Bumgarner (b...@mac.com) on 2009-03-14 12:40 PM said: On Mar 14, 2009, at 9:27 AM, Kyle Sluder wrote: On Sat, Mar 14, 2009 at 12:22 PM, Bill Bumgarner b...@mac.com wrote: On Mar 14, 2009, at 3:29 AM, Paul Sanders wrote: GC is similar to Core Data. If you had a Core Data app on Tiger,

Re: Performance problem with GC enabled

2009-03-14 Thread Sean McBride
Paul Sanders (p.sand...@dsl.pipex.com) on 2009-03-14 6:29 AM said: I'm sorry Bill, but the more I hear about GC and in particular the difficulties of using it with malloc'd memory the gladder I am not to be using it. My unsolicited 2¢: :) I am happy that the GC implementation keeps GC memory

Re: How to create an NSDecimal?

2009-03-14 Thread Luca Pazzerello
You can also create NSDecimals using NSDecimalFromString(). --Luca C. 2009/3/14 Ashley Clark acl...@ghoti.org You can get an NSDecimal structure from any NSNumber or NSDecimalNumber object by sending it the -decimalValue message. As far as I know that's the only way to create one. Ashley

Re: Performance problem with GC enabled

2009-03-14 Thread Bill Bumgarner
To bring this back around to the concrete... First -- a very hearty and public THANK YOU to Sean for filing quality bug reports that often include minimal examples. The community has definitely benefited from your contributions to the bug database! On Mar 14, 2009, at 11:17 AM, Sean

Re: EXC_BAD_ACCESS on NSImageView::setImage

2009-03-14 Thread Volker in Lists
Hi, retainCount is not in anyway useful when debugging - I had many cases of rc 5 with the object being gone the next instance. your error sounds like you loose the image at some point in time. retain it and use Instruments to see if you leak or over alloc. Volker Am 14.03.2009 um

Re: Performance problem with GC enabled

2009-03-14 Thread Wade Tregaskis
Ah, right, sorry. I'm not saying the existing API would permit such a change, more's the pity. All I'm saying (and I doubt that saying this has any value) is that it could, and in my opinion should, have been done that way in the first place. It's very tempting to try to enforce this in

Re: How to create an NSDecimal?

2009-03-14 Thread Ashley Clark
I don't see NSDecimalFromString() in any of the docs or header files, only NSDecimalString() to create strings. Where is that defined? Ashley On Mar 14, 2009, at 2:08 PM, Luca Pazzerello wrote: You can also create NSDecimals using NSDecimalFromString(). --Luca C. 2009/3/14 Ashley Clark

How to flash two rectangles in a frame?

2009-03-14 Thread Philip Kime
I am trying to work out how to flash two rects in a frame. I have it working with one rect using the view cacheImageInRect method but this only works on one rect. I tried putting two such calls in serial but the second one doesn't work for some (optimisation?) reason. Then I tried copying and

PDFView drag and drop

2009-03-14 Thread Uribe Emiro
Hello my name is Emiro Uribe and I am new to Cocoa. My system is OS X 10.4 and Xcode 2.5. I am trying to make PDFView a source for drag and drop. I would like to be able to drag the inner view into other applications. I see that I can set it to be destination by setting setAllowsDragging:YES,

[MODERATOR] Re: GC Thread - Please, do _not_ crosspost

2009-03-14 Thread Scott Anguish
The GC thread that is ongoing has been crossposted between cocoa-dev and obj-c. Please do not do this. Crossposting between cocoa-dev and other groups is not allowed. Starting threads that are crossposted will cause your messages to be moderated, and that will slow down posting. Also,

Re: PDFView drag and drop

2009-03-14 Thread Jean-Daniel Dupas
Le 14 mars 09 à 21:24, Uribe Emiro a écrit : Hello my name is Emiro Uribe and I am new to Cocoa. My system is OS X 10.4 and Xcode 2.5. I am trying to make PDFView a source for drag and drop. I would like to be able to drag the inner view into other applications. I see that I can set it to

Re: How to create an NSDecimal?

2009-03-14 Thread Keary Suska
On Mar 14, 2009, at 2:35 PM, Ashley Clark wrote: I don't see NSDecimalFromString() in any of the docs or header files, only NSDecimalString() to create strings. Where is that defined? It's part of Foundation, defined in NSDecimal.h. On Mar 14, 2009, at 2:08 PM, Luca Pazzerello wrote:

Re: [MODERATOR] Re: GC Thread - Please, do _not_ crosspost

2009-03-14 Thread Paul Sanders
I think a lot of that was aimed at me, although I didn't start the cross-post. Once again I'd like to apologise for cluttering up the list with irrelevant chit-chat. That was not the intention and it's not as if it's going to change anything, however valid or otherwise my opinion might be. I

iPhone UIWebView height?

2009-03-14 Thread William Jon Shipley
Is it possible to set an HTML string on a UIWebView and have it resize automatically to the right height, but NOT take up the entire screen? I sure can't figure it out. I feel like the iPhone really HATES rich text. Here's what I've tried so far. Most of these are Hail Mary attempts,

Re: Messages between Threads

2009-03-14 Thread Michael Ash
On Sat, Mar 14, 2009 at 1:29 PM, Paul Sanders p.sand...@dsl.pipex.com wrote: So: what should be done? 1.  Do the calculations in a sub-thread. 2.  Test a 'please stop' variable each time round the loop in that thread. 3.  Set this variable in the main thread when the user clicks the Stop

Re: How to create an NSDecimal?

2009-03-14 Thread Michael Ash
On Sat, Mar 14, 2009 at 6:55 PM, Keary Suska cocoa-...@esoteritech.com wrote: On Mar 14, 2009, at 2:35 PM, Ashley Clark wrote: I don't see NSDecimalFromString() in any of the docs or header files, only NSDecimalString() to create strings. Where is that defined? It's part of Foundation,

Re: HTTP response using CFHTTPMessageCreateEmpty/CFHTTPMessageAppendBytes

2009-03-14 Thread Greg Hoover
Wow. Don't you hate it when its staring you in the face and you still can't see it. Thanks. On Mar 14, 2009, at 5:31 PM, Michael Ash wrote: On Sat, Mar 14, 2009 at 5:17 PM, Greg Hoover ghoo...@greg-web.net wrote: I'm trying to parse an HTTP Post response using the following code. The

Re: How to create an NSDecimal?

2009-03-14 Thread Michael Vannorsdel
Use the NSDecimalNumber class (subclass of NSNumber) and create it like you would any other NSNumber. Then use decimalValue to get the NSDecimal struct from it. There is no NSDecimalFromString, only the other way NSDecimalString. The only other way is to do it is manually by setting the

Custom NSManagedObject Class Initializer

2009-03-14 Thread Richard Somers
I have a custom NSManagedObject class MyEntity. It works just fine. However when I add an initializer and override the superclass's designated initializer an error occurs. [ MyEntity 0x1f3f70 valueForUndefinedKey:]: the entity (null) is not key value coding-compliant for the key

Re: Custom NSManagedObject Class Initializer

2009-03-14 Thread mmalc Crawford
On Mar 14, 2009, at 8:02 PM, Richard Somers wrote: I have a custom NSManagedObject class MyEntity. It works just fine. However when I add an initializer and override the superclass's designated initializer an error occurs. [...] { [super initWithEntity:entity

Re: Custom NSManagedObject Class Initializer

2009-03-14 Thread Kyle Sluder
On Sat, Mar 14, 2009 at 11:02 PM, Richard Somers rsomers.li...@infowest.com wrote: I have a custom NSManagedObject class MyEntity. It works just fine. However when I add an initializer and override the superclass's designated initializer an error occurs. Not only should you not do this, if you

Re: Performance problem with GC enabled

2009-03-14 Thread John Engelhart
On Fri, Mar 13, 2009 at 11:21 PM, Peter Ammon pam...@apple.com wrote: I think you're saying that it's more convenient for you to work with a pointer than directly with an array.  If so, another way you can defeat write barriers is with a cast to void*: void func(id *ptr) {    ptr[0] = @foo;

Re: How to create an NSDecimal?

2009-03-14 Thread WT
On Mar 15, 2009, at 1:50 AM, Michael Vannorsdel wrote: The only other way is to do it is manually by setting the struct members. typedef struct { signed int _exponent:8; unsigned int _length:4; unsigned int _isNegative:1; unsigned int _isCompact:1;

Re: iPhone UIWebView height?

2009-03-14 Thread Jesse Armand
This is also what I'm looking for. I want to create a UIWebView with a frame size that will adjust itself according to the contents of the HTML string, or even more simpler an image. Anybody have any experiences with this ? Jesse Armand