NSDrawNinePartImage autorelease problem

2010-01-19 Thread Richard
hello list i have written a chat client as part of an app i am developing that uses a subclassed NSTextView to draw bubbles around messages, in the iChat style. this works well for me and a few hundred other users, except for one who reports that any time a message is entered the application

Re: NSDrawNinePartImage autorelease problem

2010-01-19 Thread Matt Gough
On 19 Jan 2010, at 09:51:36, Richard wrote: OS Version: Mac OS X 10.5.7 (9J61) Maybe he's the only one still using 10.5.7 and some bug that was fixed in 10.5.8 is causing it. Just a thought Matt Gough___ Cocoa-dev mailing list

Re: Use NSDocument as a variable of another NSDocument

2010-01-19 Thread Kai Brüning
On 18.1.2010, at 23:17, Jarod Wen wrote: Good points guys! In my application the table data depends on the movie it comes from. And also, there will be several tables for one movie (for example, one is for the video information and the other is about the audio information). The reason

Parameters Bindings

2010-01-19 Thread Richard Somers
The Cocoa Bindings Reference lists many bindings under the heading Parameters Bindings. Parameters are values passed into a function. What does that have to do with bindings? --Richard ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: Blocking for input during a loop?

2010-01-19 Thread Ben Haller
On 18-Jan-10, at 9:29 PM, Per Bull Holmen wrote: ...Again, I have clearly not explained what I wanted to do properly. No, I did not want what you describe. I have done it now, I chose to use threads, and it got far cleaner than the standard Cocoa way. No, I don't have to handle any other

changing ipaddress

2010-01-19 Thread kirankumar
hi everyone, I am developing an application to change IPADDRESS for my network card (device) i am using command like : 1)ifconfig en5 192.168.2.99 or 2)sudo ifconfig en5 alias 192.168.2.99 netmask 255.255.255.255 After reboot the system ipaddress is not set to my card ie,it s not

Re: Blocking for input during a loop?

2010-01-19 Thread Per Bull Holmen
Ben Haller wrote: On 18-Jan-10, at 9:29 PM, Per Bull Holmen wrote: ...Again, I have clearly not explained what I wanted to do properly. No, I did not want what you describe. I have done it now, I chose to use threads, and it got far cleaner than the standard Cocoa way. No, I don't have

Re: Parameters Bindings

2010-01-19 Thread Keary Suska
On Jan 19, 2010, at 4:44 AM, Richard Somers wrote: The Cocoa Bindings Reference lists many bindings under the heading Parameters Bindings. Parameters are values passed into a function. What does that have to do with bindings? Conventionally, values passed to a function are called

Re: Parameters Bindings

2010-01-19 Thread Richard Somers
On Jan 19, 2010, at 4:44 AM, Richard Somers wrote: The Cocoa Bindings Reference lists many bindings under the heading Parameters Bindings. Parameters are values passed into a function. What does that have to do with bindings? To answer my own question, parameters are actually variables

Re: Blocking for input during a loop? (Yahoo mail destroyed my indentation)

2010-01-19 Thread Per Bull Holmen
Hi all Sorry that Yahoo mail (my mail service) destroyed my indentation on the last post. I guess that wasn't easy to read... :( Actually I don't know how to send the code properly with Yahoo Mail. If I find it out I might repost. Perhaps pasting it into XCode would restore the indentation.

Re: Parameters Bindings

2010-01-19 Thread Richard Somers
On Jan 19, 2010, at 7:28 AM, Keary Suska wrote: Is there something you don't understand about the binding options, or are you arguing semantics? Just trying to comprehend controllers and bindings. I think you confirmed the answer my question. Parameters Bindings are called such because

Re: Moderated post on self going out of scope

2010-01-19 Thread David Blanton
Yes, the C++ Class is in a BSD Static library. I am checking the compiler options etc now. I'll let you know the result. -db On Jan 18, 2010, at 10:09 PM, Ken Thomases wrote: On Jan 18, 2010, at 9:50 PM, David Blanton wrote: So I set stack-protector-all as other C++ flags and got

Re: Use NSDocument as a variable of another NSDocument

2010-01-19 Thread Jarod Wen
Got it! Thanks guys for all your suggestions! On Jan 19, 2010, at 2:51 AM, Kai Brüning wrote: On 18.1.2010, at 23:17, Jarod Wen wrote: Good points guys! In my application the table data depends on the movie it comes from. And also, there will be several tables for one movie (for

Re: changing ipaddress

2010-01-19 Thread Fritz Anderson
On 19 Jan 2010, at 6:58 AM, kirankumar wrote: After reboot the system ipaddress is not set to my card ie,it s not taking Persistent store. is there any command to store ipaddress as Persistent. or is there any examples to change in plist. You mention only command-line tools, but assuming you

My Cocoa App is crashing randomly.

2010-01-19 Thread Arun
Hi All I have an application which crashes with the following logs. Thread 0 Crashed: 0 libobjc.A.dylib 0x93c9e699 objc_msgSend + 41 1 com.apple.CoreGraphics 0x9267a3eb image_finalize + 82 2 com.apple.CoreFoundation 0x92431788 _CFRelease + 216 3

Re: changing ipaddress

2010-01-19 Thread Paul Sanders
You might consider inserting a suitable command into one of the Unix startup scripts. Where they live, or which one you would need to modify, I don't really know, sorry, but I'm sure you can track the information down if you try. /etc/rc.netboot looks promising, and googling 'os x startup

Re: My Cocoa App is crashing randomly.

2010-01-19 Thread Rui Pacheco
Try this: http://www.corbinstreehouse.com/blog/2007/10/instruments-on-leopard-how-to-debug-those-random-crashes-in-your-cocoa-app/ 2010/1/19 Arun arun...@gmail.com Hi All I have an application which crashes with the following logs. Thread 0 Crashed: 0 libobjc.A.dylib

Re: Cocoa equivalent to HIViewGetOptimalBounds?

2010-01-19 Thread Kyle Sluder
On Jan 18, 2010, at 6:48 PM, Jo Meder jome...@ihug.co.nz wrote: Is there a Cocoa equivalent to HIViewGetOptimalBounds()? That function would return the optimal bounds for an HIView and I found it very useful. Not entirely. -sizeToFit and other NSCell methods will get you bounds

Re: My Cocoa App is crashing randomly.

2010-01-19 Thread Fritz Anderson
On 19 Jan 2010, at 10:23 AM, Arun wrote: I have an application which crashes with the following logs. Thread 0 Crashed: 0 libobjc.A.dylib 0x93c9e699 objc_msgSend + 41 1 com.apple.CoreGraphics 0x9267a3eb image_finalize + 82 ... Does any one has idea why this can be

Re: Parameters Bindings

2010-01-19 Thread Kyle Sluder
On Jan 19, 2010, at 7:34 AM, Richard Somers rsomers.li...@infowest.com wrote: To answer my own question, parameters are actually variables named in the parenthesized list in a function definition. So Parameters Bindings must be referring to the binding of variables which are used in

Re: Docs by Contradiction: -isDocumentEdited vs. -updateChangeCount:

2010-01-19 Thread Corbin Dunn
On Jan 18, 2010, at 9:14 AM, Jerry Krinock wrote: In documentation, updateChangeCount: if the change count is 0, the document has no changes to save, and if the change count is greater than 0, the document has been edited and is unsaved isDocumentEdited Returns YES if the receiver

Re: Make sheets open instantly

2010-01-19 Thread David Catmull
On Jan 18, 2010, at 5:19 PM, Chris Hanson wrote: On Jan 18, 2010, at 2:43 PM, David Catmull wrote: Is there any way to make sheets open instantly, instead of animating? I'd just like to speed up my unit tests. Why do your unit tests need to bring up sheets? I'll just call them tests

Re: Blocking for input during a loop? (Yahoo mail destroyed my indentation)

2010-01-19 Thread Greg Guerin
Per Bull Holmen wrote: Sorry that Yahoo mail (my mail service) destroyed my indentation on the last post. I guess that wasn't easy to read... :( Actually I don't know how to send the code properly with Yahoo Mail. If I find it out I might repost. Perhaps pasting it into XCode would

Application crashes

2010-01-19 Thread yogin bhargava
HI All, I have a cocoa application. Rarely it crashes with the following log crash messages : Thread 0 Crashed: 0 libobjc.A.dylib 0x93960699 objc_msgSend + 41 1 com.apple.Foundation 0x90ecf483 __NSFireTimer + 147 2 com.apple.CoreFoundation 0x918108f5

NSDictionary trouble

2010-01-19 Thread Shawn Rutledge
I wish NSDictionary (NSMutableDictionary actually) could handle arbitrary mappings of one type of object to another, without copying the keys. A string makes a good key most of the time but what about the case where you want to do the reverse mapping, to find the string which you have associated

IKImageView Filters

2010-01-19 Thread Manners, Tony
Hi, I've been working on a image viewer that uses the IKImageView to replace an old OS9 image window thats used in some of our old internal apps. Looking at the ImageKit programming guide there is a section on how to use the built in interface to select filters and their parameters but the

Re: NSDictionary trouble

2010-01-19 Thread Paul Bruneau
On Jan 19, 2010, at 11:53 AM, Shawn Rutledge wrote: I wish NSDictionary (NSMutableDictionary actually) could handle arbitrary mappings of one type of object to another, without copying the keys. A string makes a good key most of the time but what about the case where you want to do the

Re: Application crashes

2010-01-19 Thread Joar Wingfors
Yogin, It seems very likely that the target for your timer (the object that would receive the delayed method call) has been deallocated. I would use zombies to figure out why that is. You can use them either from Xcode, or via Instruments. Google has more info. j o a r On 19 jan 2010, at

Re: Blocking for input during a loop?

2010-01-19 Thread Jens Alfke
On Jan 19, 2010, at 6:10 AM, Per Bull Holmen wrote: I have made one class called GameController, which is overridden by subclasses to control one specific type of game (PS: I will soon rename the class Controller to MainController, and instance variable controller to mainController). The

Re: Blocking for input during a loop? (Yahoo mail destroyed my indentation)

2010-01-19 Thread Per Bull Holmen
Greg Guerin wrote: Per Bull Holmen wrote: Sorry that Yahoo mail (my mail service) destroyed my indentation on the last post. I guess that wasn't easy to read... :( Actually I don't know how to send the code properly with Yahoo Mail. If I find it out I might repost. Perhaps pasting

Re: NSDictionary trouble

2010-01-19 Thread Jens Alfke
On Jan 19, 2010, at 8:53 AM, Shawn Rutledge wrote: I wish NSDictionary (NSMutableDictionary actually) could handle arbitrary mappings of one type of object to another, without copying the keys. It can. If you have a custom class you want to be able to use as a dictionary key without

Re: Blocking for input during a loop?

2010-01-19 Thread Per Bull Holmen
Jens Afke wrote: You've basically implemented coroutines, actually a simple form of an actor, using multiple threads. Each coroutine is running an event loop, and the game one blocks waiting for incoming events from the UI one. /.../ This is a fine way to do things, except that you can't

Re: NSDictionary trouble

2010-01-19 Thread Jens Alfke
On Jan 19, 2010, at 10:09 AM, Paul Bruneau wrote: When I want to find the key(s) for a given object, I use the - allKeysForObject method This is fine, but keep in mind that it's a lot slower since it does a linear search instead of a hash lookup. (It's O(n) instead of O(1).) If you're

Re: Blocking for input during a loop?

2010-01-19 Thread Jens Alfke
On Jan 19, 2010, at 10:16 AM, Jens Alfke wrote: You've basically implemented coroutines, actually a simple form of an actor, using multiple threads. The listserv stripped the links from that sentence. They were: http://en.wikipedia.org/wiki/Coroutine

Re: NSDictionary trouble

2010-01-19 Thread Shawn Rutledge
On Tue, Jan 19, 2010 at 11:24 AM, Jens Alfke j...@mooseyard.com wrote: On Jan 19, 2010, at 8:53 AM, Shawn Rutledge wrote: I wish NSDictionary (NSMutableDictionary actually) could handle arbitrary mappings of one type of object to another, without copying the keys. It can. If you have a

Re: Parameters Bindings

2010-01-19 Thread Richard Somers
On Jan 19, 2010, at 9:40 AM, Kyle Sluder wrote: This is incorrect. A parameter is a value that defines boundaries or behavior. The parameter bindings are kept separate from the value bindings because the latter deal with the data presented by the view, while the former deal with how that

Re: NSDictionary trouble

2010-01-19 Thread Sixten Otto
On Tue, Jan 19, 2010 at 1:24 PM, Jens Alfke j...@mooseyard.com wrote: On Jan 19, 2010, at 8:53 AM, Shawn Rutledge wrote: I didn't try CFDictionary yet; is that appropriate for an iPhone app? But try NSMapTable first. It's sort of halfway between the two — it's an Objective-C class but it has

RE: NSDictionary trouble

2010-01-19 Thread Kirk Kerekes
I wish NSDictionary (NSMutableDictionary actually) could handle arbitrary mappings of one type of object to another, without copying the keys. A string makes a good key most of the time but what about the case where you want to do the reverse mapping, to find the string which you have

Asynchronous IO lags at close

2010-01-19 Thread Justin Delegard
I am writing a screen saver that forks a process and reads its stdout chunk by chunk. Since I didn't want it to block on reads, I tried to find the non-blocking IO parts of Cocoa. I found Cocoa's NSNotificationCenter, and the associated methods with the NSFileHandle class, and that seemed to

Re: How to show progress indicator for background job

2010-01-19 Thread Scott Ribe
However the apple UI guidelines state not to use any controls in the bottom bar. ??? I don't see that. I see a pretty detailed discussion of what kinds of controls to use in the bottom bar and why. http://developer.apple.com/mac/library/documentation/UserExperience/Concept

Re: Blocking for input during a loop?

2010-01-19 Thread Per Bull Holmen
Jens Afke wrote: The listserv stripped the links from that sentence. They were: http://en.wikipedia.org/wiki/Coroutine http://en.wikipedia.org/wiki/Actor_model Thanks. This is will be very useful as I learn more about game programming. :) Per

Getting filesize when downloading file with NSURLDownload?

2010-01-19 Thread Laurent Daudelin
I'm using an NSURLDownload to download a file from a server. Is there any way I could find what the size of the file will be so that I could put up a nice progress indicator? -Laurent. -- Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin

Re: Getting filesize when downloading file with NSURLDownload?

2010-01-19 Thread Sherm Pendley
On Tue, Jan 19, 2010 at 2:13 PM, Laurent Daudelin laurent.daude...@gmail.com wrote: I'm using an NSURLDownload to download a file from a server. Is there any way I could find what the size of the file will be so that I could put up a nice progress indicator? Implement the

Re: Getting filesize when downloading file with NSURLDownload?

2010-01-19 Thread Laurent Daudelin
On Jan 19, 2010, at 11:21, Sherm Pendley wrote: On Tue, Jan 19, 2010 at 2:13 PM, Laurent Daudelin laurent.daude...@gmail.com wrote: I'm using an NSURLDownload to download a file from a server. Is there any way I could find what the size of the file will be so that I could put up a nice

Re: [iphone] Release Navigation View Controller Question

2010-01-19 Thread Philip Vallone
Thanks, You are correct. I needed to retain it @property (nonatomic, retain) NSMutableArray *tableList; @property (nonatomic, retain) NSMutableArray *cfrTitleList; Then dealloc it: - (void)dealloc { [tableList release]; [cfrTitleList release]; [super dealloc]; } I

Proper Memory Management

2010-01-19 Thread Philip Vallone
I am I trying to learn proper memory management and have question: In the following example, which objects am I responsible to release? - (void) viewDidLoad{ NSString *tempStr = nil; NSString *filepath = [[NSBundle mainBundle] pathForResource:@filename ofType:@xml];

Re: Proper Memory Management

2010-01-19 Thread Dave DeLong
None of them. According to the memory management rules, you're only responsible for objects you create via an alloc, new, or copy method, which none of these are. All of these objects are autoreleased. Dave On Jan 19, 2010, at 1:50 PM, Philip Vallone wrote: I am I trying to learn proper

Re: Proper Memory Management

2010-01-19 Thread Dave Carrigan
On Jan 19, 2010, at 12:52 PM, Dave DeLong wrote: None of them. According to the memory management rules, you're only responsible for objects you create via an alloc, new, or copy method, which none of these are. All of these objects are autoreleased. Unless PerformXMLXPathQuery returns

Re: Proper Memory Management

2010-01-19 Thread Philip Vallone
Awesome - Thanks! On Jan 19, 2010, at 3:52 PM, Dave DeLong wrote: None of them. According to the memory management rules, you're only responsible for objects you create via an alloc, new, or copy method, which none of these are. All of these objects are autoreleased. Dave On Jan

Re: Proper Memory Management

2010-01-19 Thread Philip Vallone
Thanks.. Good question. The method in question PerformXMLXPathQuery is a wrapper that was obtained: http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html NSArray *PerformXMLXPathQuery(NSData *document, NSString *query) { xmlDocPtr doc; /* Load XML document

Re: Proper Memory Management

2010-01-19 Thread Jack Carbaugh
It is my understanding that, the array returned as result would be auto released. Therefore, you would want to retain it for your use, then release it later. On Jan 19, 2010, at 4:14 PM, Philip Vallone wrote: Thanks.. Good question. The method in question PerformXMLXPathQuery is a

Re: Proper Memory Management

2010-01-19 Thread Philip Vallone
Thanks Jack, Considering the original example: - (void) viewDidLoad{ NSString *tempStr = nil; NSString *filepath = [[NSBundle mainBundle] pathForResource:@filename ofType:@xml]; NSData *xmlData = [NSData dataWithContentsOfFile:filepath];

Re: Proper Memory Management

2010-01-19 Thread Dave Carrigan
On Jan 19, 2010, at 1:20 PM, Jack Carbaugh wrote: It is my understanding that, the array returned as result would be auto released. Therefore, you would want to retain it for your use, then release it later. Again, that's impossible to know, without looking at the PerformXPathQuery

Re: NSDictionary trouble

2010-01-19 Thread Jeremy Pereira
On 19 Jan 2010, at 16:53, Shawn Rutledge wrote: I'm accustomed to things like Qt and Java where hashtables can contain anything for both key and value. This is not true (at least for Java and probably for QT for the same reason). From the API docs for the Map abstract class: Note: great

Re: NSDictionary trouble

2010-01-19 Thread Graham Cox
On 20/01/2010, at 5:33 AM, Shawn Rutledge wrote: I forgot to mention, another problem I ran into was that my dictionary is a member variable of my UIViewController, I inited it in initWithNibName, then later when I go to use it in another member function, I found that it had been

MKPinAnnotationView callout behind other pins

2010-01-19 Thread Jacob Schwartz
Hey everyone, To start off, Im sorry if this is the wrong mailing for cocoa touch and iPhone MapKit related questions but I didn't know where else to go and you guys haven't let me down in the past. Onto my question. I have an iPhone app that has pins dispersed across an area. When I click on

Re: NSDictionary trouble

2010-01-19 Thread Shawn Rutledge
On Tue, Jan 19, 2010 at 2:38 PM, Graham Cox graham@bigpond.com wrote: On 20/01/2010, at 5:33 AM, Shawn Rutledge wrote: I forgot to mention, another problem I ran into was that my dictionary is a member variable of my UIViewController, I inited it in initWithNibName, then later when I go

Re: MKPinAnnotationView callout behind other pins

2010-01-19 Thread Graham Cox
On 20/01/2010, at 9:49 AM, Jacob Schwartz wrote: Onto my question. I have an iPhone app that has pins dispersed across an area. When I click on a pin, the callout pops up as normal, but it is SOMETIMES hidden by the other pins. I cannot find an answer anywhere on why this would be the

Re: NSDictionary trouble

2010-01-19 Thread Kyle Sluder
On Tue, Jan 19, 2010 at 2:57 PM, Shawn Rutledge shawn.t.rutle...@gmail.com wrote: I think dictionaryWithCapacity should both alloc and init it, right? Please stop making conjectures. The documentation explains all of this. --Kyle Sluder ___ Cocoa-dev

Re: NSDictionary trouble

2010-01-19 Thread Graham Cox
On 20/01/2010, at 9:57 AM, Shawn Rutledge wrote: I think dictionaryWithCapacity should both alloc and init it, right? Why do you think that? I repeat: You MUST learn the memory management rules and have them down pat so you can write correctly managed code without having to really think

Re: NSDictionary trouble

2010-01-19 Thread Jens Alfke
On Jan 19, 2010, at 2:57 PM, Shawn Rutledge wrote: I think dictionaryWithCapacity should both alloc and init it, right? Yes, and it autoreleases it too. :-o That means it'll conveniently be released later on, which is exactly what you're running into. If you want to keep a reference to

Re: NSDictionary trouble

2010-01-19 Thread Jens Alfke
On Jan 19, 2010, at 10:46 AM, Kirk Kerekes wrote: NSDictionary will use almost any object as a key: From the docs: In general, a key can be any object (provided that it conforms to the NSCopying protocol...) -- and if it is an immutable object, that -copy is just a -retain. Yes, but he

Re: NSDictionary trouble

2010-01-19 Thread Shawn Rutledge
On Tue, Jan 19, 2010 at 2:33 PM, Jeremy Pereira a...@jeremyp.net wrote: On 19 Jan 2010, at 16:53, Shawn Rutledge wrote:  I'm accustomed to things like Qt and Java where hashtables can contain anything for both key and value. This is not true (at least for Java and probably for QT for the

Re: NSDictionary trouble

2010-01-19 Thread Kyle Sluder
On Tue, Jan 19, 2010 at 3:09 PM, Shawn Rutledge shawn.t.rutle...@gmail.com wrote: Well yeah, that's one of the reasons java.lang.String is immutable. But it helps that java.lang.Object has both hashCode and equals, so any object can be put into a collection that depends on those... you just

Re: NSDictionary trouble

2010-01-19 Thread Jean-Daniel Dupas
Le 20 janv. 2010 à 00:18, Kyle Sluder a écrit : On Tue, Jan 19, 2010 at 3:09 PM, Shawn Rutledge shawn.t.rutle...@gmail.com wrote: Well yeah, that's one of the reasons java.lang.String is immutable. But it helps that java.lang.Object has both hashCode and equals, so any object can be put

NSTableView Column Header Restrictions?

2010-01-19 Thread Daniel Wambold
I have an NSTableView that I populate with columns programmatically. I use the following to establish the header titles: NSTableHeaderCell *myGenericHeaderCell = [[[NSTableHeaderCell alloc] initTextCell:myTableColumnTitle] autorelease]; [myGenericHeaderCell setAlignment:NSCenterTextAlignment];

Re: NSTableView Column Header Restrictions?

2010-01-19 Thread Corbin Dunn
On Jan 19, 2010, at 3:30 PM, Daniel Wambold wrote: I have an NSTableView that I populate with columns programmatically. I use the following to establish the header titles: NSTableHeaderCell *myGenericHeaderCell = [[[NSTableHeaderCell alloc] initTextCell:myTableColumnTitle] autorelease];

Re: NSTableView Column Header Restrictions?

2010-01-19 Thread Daniel Wambold
On Jan 19, 2010, at 3:30 PM, Daniel Wambold wrote: I have an NSTableView that I populate with columns programmatically. I use the following to establish the header titles: NSTableHeaderCell *myGenericHeaderCell = [[[NSTableHeaderCell alloc] initTextCell:myTableColumnTitle] autorelease];

Re: Cocoa equivalent to HIViewGetOptimalBounds?

2010-01-19 Thread Jo Meder
Hi Kyle, On 20/01/2010, at 5:34 AM, Kyle Sluder wrote: On Jan 18, 2010, at 6:48 PM, Jo Meder jome...@ihug.co.nz wrote: Is there a Cocoa equivalent to HIViewGetOptimalBounds()? That function would return the optimal bounds for an HIView and I found it very useful. Not entirely.

RE: NSDictionary trouble

2010-01-19 Thread Jeff Laing
I think dictionaryWithCapacity should both alloc and init it, right? Yes, and it autoreleases it too. :-o That means it'll conveniently be released later on, which is exactly what you're running into. If you want to keep a reference to the dictionary, you should call alloc and init

Re: NSDictionary trouble

2010-01-19 Thread mmalc Crawford
On Jan 19, 2010, at 5:50 pm, Jeff Laing wrote: Yes, and it autoreleases it too. :-o That means it'll conveniently be released later on, which is exactly what you're running into. If you want to keep a reference to the dictionary, you should call alloc and init yourself. No, you should

Re: Make sheets open instantly

2010-01-19 Thread Joar Wingfors
For developers it's typically preferable to pass debug user default values as arguments to your executable from within Xcode. Select Project Edit Active Executable in Xcode, and go to the Arguments tab. Hit the plus button to add a new argument: -NSWindowResizeTime 0.1 When you

Re: NSDictionary trouble

2010-01-19 Thread Shawn Rutledge
On Tue, Jan 19, 2010 at 7:01 PM, mmalc Crawford mmalc_li...@me.com wrote: No, you should just *retain* the result of dictionaryWithCapacity. No, you shouldn't. If you're writing an init method and want to assign the dictionary to an instance variable, you should use alloc/init. Why?

Re: NSDictionary trouble

2010-01-19 Thread Ken Thomases
On Jan 19, 2010, at 9:21 PM, Shawn Rutledge wrote: On Tue, Jan 19, 2010 at 7:01 PM, mmalc Crawford mmalc_li...@me.com wrote: No, you should just *retain* the result of dictionaryWithCapacity. No, you shouldn't. If you're writing an init method and want to assign the dictionary to an

Re: MKPinAnnotationView callout behind other pins

2010-01-19 Thread John Joyce
On Jan 19, 2010, at 9:06 PM, cocoa-dev-requ...@lists.apple.com wrote: On 20/01/2010, at 9:49 AM, Jacob Schwartz wrote: Onto my question. I have an iPhone app that has pins dispersed across an area. When I click on a pin, the callout pops up as normal, but it is SOMETIMES hidden by the

Re: Help Understanding CFRunLoopSourceSignal and CFRunLoopWakeUp

2010-01-19 Thread Ken Thomases
On Jan 19, 2010, at 9:03 PM, Francisco Tolmasky wrote: I have an application that is using a custom CFRunLoopSource (CFRunLoopSourceCreate), however I am not sure about the appropriate way it should be used. Specifically, I don't know whether I am supposed to call CFRunLoopWakeUp after

Validating NSXMLDocument against external DTD

2010-01-19 Thread Rainer Standke
Hello, I am trying to validate an NSXMLDocument against an external DTD. Here is what I do: NSError *error = nil; NSXMLDocument *doc = [[[NSXMLDocument alloc] initWithXMLString:beamedXML options:NSXMLNodeOptionsNone error:error] autorelease]; if (!doc) {

RE: NSDictionary trouble

2010-01-19 Thread Jeff Laing
Yes, and it autoreleases it too. :-o That means it'll conveniently be released later on, which is exactly what you're running into. If you want to keep a reference to the dictionary, you should call alloc and init yourself. I wrote: No, you should just *retain* the result of

Re: NSDictionary trouble

2010-01-19 Thread Jens Alfke
On Jan 19, 2010, at 8:47 PM, Jeff Laing wrote: With all due respect, why not? Apple gives us all those convenience methods but you say we shouldn't use them? Convenience ≠ performance. The autoreleased factory methods are very convenient when you're using the result temporarily, so you

Re: NSDictionary trouble

2010-01-19 Thread mmalc Crawford
On Jan 19, 2010, at 8:47 pm, Jeff Laing wrote: I wrote: No, you should just *retain* the result of dictionaryWithCapacity. mmalc wrote: No, you shouldn't. With all due respect, why not? Because it's difficult to imagine a common situation in which your advice will be valid, for

OS X equivalent of UIImage stretchableImageWithLeftCapWidth:topCapHeight: method

2010-01-19 Thread PCWiz
Is there a Cocoa equivalent (Mac) of Cocoa Touch's (iPhone) stretchableImageWithLeftCapWidth:topCapHeight: method? If not, how can I achieve the same function? Thanks ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: OS X equivalent of UIImage stretchableImageWithLeftCapWidth:topCapHeight: method

2010-01-19 Thread Kyle Sluder
On Tue, Jan 19, 2010 at 9:34 PM, PCWiz pcwiz.supp...@gmail.com wrote: Is there a Cocoa equivalent (Mac) of Cocoa Touch's (iPhone) stretchableImageWithLeftCapWidth:topCapHeight: method? If not, how can I achieve the same function? NSDrawNinePartImage. --Kyle Sluder

Re: NSDictionary trouble

2010-01-19 Thread Ken Thomases
On Jan 19, 2010, at 10:47 PM, Jeff Laing wrote: I'm assuming you are saying 'don't use the convenience methods because the autorelease pool won't empty quickly enough'. Certainly Ken said it, though he seemed to assume that there was only one pool, that people would not be creating their