Select and edit filename field in NSSavePanel

2010-08-18 Thread Sanyam Jain
Hi, I am looking for a way to select and edit the filename in the filename text edit box field in nssavepanel, something similar kNavCtlSelectEditFileName, used to select portion of filename in Navigation services. This filename field needs to be updated by appending new extension, as soon as u

Re: Losing my memory - a caching problem?

2010-08-18 Thread Stuart Rogers
On 18 Aug 2010, at 01:26, Shawn Erickson wrote: > > ... however if your application loads > file data (aka image data in your case) only once or it is unlikely > your application will load the same file data again in the reasonable > near future then you should look at disabling file caching of th

Re: Losing my memory - a caching problem?

2010-08-18 Thread Stuart Rogers
On 18 Aug 2010, at 01:31, Ken Thomases wrote: > On Aug 17, 2010, at 7:26 PM, Shawn Erickson wrote: > >> When you say "free" I assume you mean the "free:" number listed in >> activity viewer for the system as a whole? > >> If so then what you are seeing is an expected result of the "unified >> buf

Re: Losing my memory - a caching problem?

2010-08-18 Thread Stuart Rogers
On 18 Aug 2010, at 06:57, Ken Ferry wrote: > > Did you say that the Object Alloc tool does not report the memory that is > being used? First verify that. You don't want to use the object alloc tool > from the leaks template, its config options are not appropriate. Start from > the "Allocatio

Re: Losing my memory - a caching problem?

2010-08-18 Thread Stuart Rogers
On 18 Aug 2010, at 01:26, Shawn Erickson wrote: > > So in general you shouldn't worry about free RAM shrinking to a sliver > of total system RAM over time... however if your application loads > file data (aka image data in your case) only once or it is unlikely > your application will load the sam

Re: Losing my memory - a caching problem?

2010-08-18 Thread jonat...@mugginsoft.com
On 18 Aug 2010, at 12:50, Stuart Rogers wrote: > On 18 Aug 2010, at 01:26, Shawn Erickson wrote: > > I think we have a winner! I've just implemented Shawn's suggestion > and it seems to solve my problem. I've just passed 9,695 image files > through my code's test phase (at 1.2MB apiece, that'

File system caching of - xxxxWithContentsOfFile:

2010-08-18 Thread jonat...@mugginsoft.com
The following classes implement either -initWithContentsOfFile: or an appropriate similar factory method. NSData NSArray NSCharacterSet NSImageRep NSSound NSString Only NSData provides a method which allows an option to control file read caching - dataWithContentsOfFile:options:error: For no

Re: Losing my memory - a caching problem?

2010-08-18 Thread Sean McBride
On Tue, 17 Aug 2010 23:00:02 +0100, Stuart Rogers said: Have you tried using drain instead of release? That seems to be the >>> preferred way at this point, triggering GC collection if needed (I don't >>> know if your code is GC enabled, but if the library code is GC enabled, >>> then this w

Re: Losing my memory - a caching problem?

2010-08-18 Thread Michael Ash
On Wed, Aug 18, 2010 at 6:45 AM, Stuart Rogers wrote: > I quite understand this, but the practice doesn't quite fit the theory. > If 'inactive' is effectively available as 'free' for all apps, then it should > be > available to my app.  And yet, when 'free' drops to just a few megabytes > I see e

Re: Losing my memory - a caching problem?

2010-08-18 Thread Shawn Erickson
On Wed, Aug 18, 2010 at 3:45 AM, Stuart Rogers wrote: > On 18 Aug 2010, at 01:31, Ken Thomases wrote: >> On Aug 17, 2010, at 7:26 PM, Shawn Erickson wrote: >> >>> When you say "free" I assume you mean the "free:" number listed in >>> activity viewer for the system as a whole? >> >>> If so then wha

key pair generation problem

2010-08-18 Thread Paresh Thakor
> I'm also working on libssh2 API. And my issues is with > libssh2_userauth_publickey_fromfile(). I'm using apple's sample code with > - (void)generateKeyPairPlease{ > } > > and > SecKeyGeneratePair() > inside the above method. You can take a look at apple's sample code for this. > > Now, i ne

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread John C. Randolph
-stringByReplacingCharactersInString: creates and returns a new string, which is autoreleased. You're getting the bus errors when something tries to access that string after it's been released. -jcr On Aug 17, 2010, at 2:03 PM, James Miller wrote: > Hello. > > I'm a little new to Objective-

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Murat Konar
On Aug 18, 2010, at 11:06 AM, John C. Randolph wrote: -stringByReplacingCharactersInString: creates and returns a new string, which is autoreleased. Always? I recall running into a problem that was caused by - stringByReplacingCharactersInString: (or a method like it) simply returning sel

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Dave Carrigan
On Aug 18, 2010, at 11:52 AM, Murat Konar wrote: > > On Aug 18, 2010, at 11:06 AM, John C. Randolph wrote: > >> -stringByReplacingCharactersInString: creates and returns a new string, >> which is autoreleased. > > Always? I recall running into a problem that was caused by > -stringByReplacin

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Murat Konar
Yes, sorry. The problem I had wasn't a memory management problem. I had to do with a custom NSFormatter breaking proper KVO notification because -stringByReplacingCharactersInString: was returning self when no substitution occurred. Bug ID 7775697, in case anyone cares. _murat On Aug 18,

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Sherm Pendley
On Wed, Aug 18, 2010 at 2:52 PM, Murat Konar wrote: > > On Aug 18, 2010, at 11:06 AM, John C. Randolph wrote: > >> -stringByReplacingCharactersInString: creates and returns a new string, >> which is autoreleased. > > Always? Yes, always. > I recall running into a problem that was caused by > -st

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Kyle Sluder
On Wed, Aug 18, 2010 at 12:16 PM, Sherm Pendley wrote: > Possibly, but even in that case it would still have to "return [[self > retain] autorelease];" in order to fulfill its end of the memory > management contract. This is incorrect. It's perfectly valid to just return self if you aren't return

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Sherm Pendley
On Wed, Aug 18, 2010 at 3:33 PM, Kyle Sluder wrote: > On Wed, Aug 18, 2010 at 12:16 PM, Sherm Pendley > wrote: >> Possibly, but even in that case it would still have to "return [[self >> retain] autorelease];" in order to fulfill its end of the memory >> management contract. > > This is incorrec

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Kyle Sluder
On Wed, Aug 18, 2010 at 12:49 PM, Sherm Pendley wrote: > The "[foo release]" is perfectly correct, but if > -stringByReplacingOccurrencesOfString:withString: is implemented with > a simple "return self;" then *both* foo and bar would be immediately > released. Implementing it as "return [[self ret

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Sherm Pendley
On Wed, Aug 18, 2010 at 4:22 PM, Kyle Sluder wrote: > On Wed, Aug 18, 2010 at 12:49 PM, Sherm Pendley > wrote: >> The "[foo release]" is perfectly correct, but if >> -stringByReplacingOccurrencesOfString:withString: is implemented with >> a simple "return self;" then *both* foo and bar would be

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Kyle Sluder
On Wed, Aug 18, 2010 at 2:08 PM, Sherm Pendley wrote: > The caller is doing nothing wrong here. It's finished using foo, and > released it. If the caller's only use of bar is within the scope of > the calling method, it's under no obligation to retain it. It's the > responsibility of -stringByRepl

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Martin Wierschin
On 2010.08.18, at 2:08 PM, Sherm Pendley wrote: Indeed, on that very page, at , it gives this example: - (NSString*) title { return [[titl

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Greg Parker
On Aug 18, 2010, at 2:23 PM, Kyle Sluder wrote: > On Wed, Aug 18, 2010 at 2:08 PM, Sherm Pendley > wrote: >> Indeed, on that very page, at >> , >> i

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Sherm Pendley
On Wed, Aug 18, 2010 at 5:23 PM, Kyle Sluder wrote: > On Wed, Aug 18, 2010 at 2:08 PM, Sherm Pendley > wrote: > >> Indeed, on that very page, at >>

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Sherm Pendley
On Wed, Aug 18, 2010 at 5:25 PM, Martin Wierschin wrote: > On 2010.08.18, at 2:08 PM, Sherm Pendley wrote: > >> Implementing -stringByReplacing... as "return [[self retain] >> autorelease];" makes the same guarantee, that the object returned by >> -stringByReplacing... will remain valid if the ori

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Martin Wierschin
Implementing -stringByReplacing... as "return [[self retain] autorelease];" makes the same guarantee, that the object returned by -stringByReplacing... will remain valid if the original string is released. Yes, but there's no guarantee which technique -stringByReplacing.. will use internall

NSImageView and ZoomFactors

2010-08-18 Thread Brian Postow
I'm trying to convert my program from IKImageView to NSImageView. I've got displaying images, and rotating without too much trouble. The two things that IKImageView gave me that I'm having trouble making NSImageView do a similar thing are 1) zooming and 2) the mouse-tools. 1) I can see how to

Re: NSImageView and ZoomFactors

2010-08-18 Thread Quincey Morris
On Aug 18, 2010, at 15:01, Brian Postow wrote: > The two things that IKImageView gave me that I'm having trouble making > NSImageView do a similar thing are 1) zooming and 2) the mouse-tools. > > 1) I can see how to use scaleUnitSquareToSize to zoom, but that doesn't tell > me the CURRENT zoom,

Best way to draw large tiled images?

2010-08-18 Thread Gideon King
I have a relatively large area on my NSView that I want to tile images into. I tried using CIAffineTile, but it gives me the following error: "CoreImage: ROI is not tilable" for even moderately large images (for small images, it works exactly as I want it to). I tried using [NSColor colorWithP

[iPhone] add touches to MKAnnotationView

2010-08-18 Thread Philip Vallone
Hi, I have a subclass of MKAnnotationView,in which I create a custom pin (customPin, which is a UIImageView). I want to be able to move that custom Pin but I am having trouble. The touch event is being called, but my image is not moving. Here is my subclass: @implementation MyAnnotationView

Re: [iPhone] add touches to MKAnnotationView

2010-08-18 Thread Philip Vallone
Never mind... I got it. Thanks, Phil On Aug 18, 2010, at 8:42 PM, Philip Vallone wrote: > Hi, > > I have a subclass of MKAnnotationView,in which I create a custom pin > (customPin, which is a UIImageView). I want to be able to move that custom > Pin but I am having trouble. The touch ev

Modifying the Window Menu

2010-08-18 Thread Peter Zegelin
My app allows the user to create a number of sub windows for each document. Unfortunately they are added to the Window Menu above the existing document entry: MyDoc becomes: SubWindow 2 SubWindow 1 MyDoc I would prefer the layout to be more like Xcode where the sub windows of a

CGEvent with double click

2010-08-18 Thread Joe Turner
Hello, I'm trying to post an event (using CGEventRef) that at least behaves like a double click (even if it's not officially one). What I do now is immediately have a down click, then .01 second later have an up click, then .1 second later have a down click, and then .01 second later have an up

Core Data Bindings Issue

2010-08-18 Thread Frank D. Engel, Jr.
Hi, Hoping this is something simple that I'm missing... I have a controller class which is represented as a simple object (cube icon) in Interface Builder. This class has an "id" field to which I assign various instances of core data entities (represented by a subclass of NSManagedObject

Re: Core Data Bindings Issue

2010-08-18 Thread Gideon King
Is it just a case of making your controls continuous, or setting your bindings to continuously update values? On 19/08/2010, at 11:00 AM, Frank D. Engel, Jr. wrote: > Then the "value" bindings of the NSSlider and NSCheckbox are both > "selectedWhatever.someField". > > > The problem I am havin

Re: CGEvent with double click

2010-08-18 Thread Quincey Morris
On Aug 18, 2010, at 17:56, Joe Turner wrote: > I'm trying to post an event (using CGEventRef) that at least behaves like a > double click (even if it's not officially one). What I do now is immediately > have a down click, then .01 second later have an up click, then .1 second > later have a d

Re: Core Data Bindings Issue

2010-08-18 Thread Quincey Morris
On Aug 18, 2010, at 18:00, Frank D. Engel, Jr. wrote: > I have a controller class which is represented as a simple object (cube icon) > in Interface Builder. This class has an "id" field to which I assign various > instances of core data entities (represented by a subclass of NSManagedObject >

Re: Is it possible to set UISlider intervals?

2010-08-18 Thread Bill Garrison
On Aug 10, 2010, at 8:43 PM, Devraj Mukherjee wrote: > Hi all, > > I am using UISliders in my iOS app. > > I can't see a way of setting the slide value interval. Is this > possible? Or do I have to calculate the change based on the 0.1 > increases? > > Minimum value set to -20 and Max to 20 an

UIMenuController not showing up

2010-08-18 Thread Ignacio Enriquez
Hi, I am implementing my own TextView using CoreText and would like it to resemble to the original UITextView Specially when long-pressing it. When my view is firstResponder, the keyboard is shown and the UIMenuController shows up as expected When is not firstResponder is not shown. As suggested