Re: Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread Peter C
Vincent, I meant changing to write to ~/Library/Preferences, user directory. Peter C On 21 Jul 2011, at 12:35 PM, vincent habchi wrote: >> I have think of authorization code but it seems now Apple does not want >> others to write into this directory. Better to change code to adapt to new >> se

Re: CFMutableDictionary Capacity

2011-07-20 Thread Andreas Grosam
On Jul 21, 2011, at 12:30 AM, Jens Alfke wrote: > > On Jul 20, 2011, at 2:34 PM, Andreas Grosam wrote: > >> According the doc, the parameter "capacity" in function >> CFDictionaryCreateMutable() sets the *maximum number* of key-value pairs >> which can be inserted into the container. That is,

Re: Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread vincent habchi
> I have think of authorization code but it seems now Apple does not want > others to write into this directory. Better to change code to adapt to new > settings. You will have to. Sandboxing, if you adopt it, won’t let you write in there anyway. Vincent ___

Re: Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread Dave Fernandes
I've never tried it, but doesn't CFPreferencesSetValue (with the kCFPreferencesCurrentHost domain) do what you need? Or am I misunderstanding "host" in this context? On 2011-07-20, at 10:58 PM, Peter C wrote: > Graham, I used to store serial number codes for all users, in this directory. > > L

Re: Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread Peter C
I have think of authorization code but it seems now Apple does not want others to write into this directory. Better to change code to adapt to new settings. Peter C On 21 Jul 2011, at 10:30 AM, Stephen J. Butler wrote: > On Wed, Jul 20, 2011 at 8:31 PM, Peter C wrote: >> Some of the programs

Re: Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread Peter C
Graham, I used to store serial number codes for all users, in this directory. Looks like I have change it to save it user library directory. Peter C. On 21 Jul 2011, at 10:25 AM, Graham Cox wrote: > Check the release notes - a number of system folders have different > permissions: > >> Folde

Re: Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread Stephen J. Butler
On Wed, Jul 20, 2011 at 8:31 PM, Peter C wrote: > Some of the programs I wrote save a preference file into /Library/Preferences > via NSDictionary. This serves as a general settings for all users. Many other > 3rd party software (Skype, Microsoft and etc) saves preferences file into > this dire

Re: Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread Graham Cox
Check the release notes - a number of system folders have different permissions: > Folder Permissions and Ownership > A number of folders in the System and Local file system domains now have > different ownership and permissions. Specifically: > • Many folders in the System domain that were

Re: Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread Laurent Daudelin
Peter, /Library/Preferences is indeed set only to root. Applications don't typically save their settings in there. Applications usually save their settings in ~/Library/Preferences (note the "~" meaning the user's home folder). -Laurent. -- Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin

Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-20 Thread Peter C
Hello all, This is a question that involves 10.7 (Lion). I believe it is allow to discuss about 10.7 at this moment, as 10.7 is release (on sale) to public. List administrator please remove this email if you think it is not allow to discuss this. Some of the programs I wrote save a preference

Re: Smooth resizing of a text field

2011-07-20 Thread Gabriel Roth
On Wed, Jul 20, 2011 at 4:12 PM, Fritz Anderson wrote: > > A couple of minutes' search turned up drawCenteredShrinkingToFitInRect: in > NSAttributedString-OAExtensions. I don't think it's on-point for what you're > looking for, but you may be able to derive a technique. To report back: With som

Re: CFMutableDictionary Capacity

2011-07-20 Thread Jean-Daniel Dupas
Le 21 juil. 2011 à 01:48, Jean-Daniel Dupas a écrit : > > Le 21 juil. 2011 à 00:30, Jens Alfke a écrit : > >> >> On Jul 20, 2011, at 2:34 PM, Andreas Grosam wrote: >> >>> According the doc, the parameter "capacity" in function >>> CFDictionaryCreateMutable() sets the *maximum number* of key-

Re: CFMutableDictionary Capacity

2011-07-20 Thread Jean-Daniel Dupas
Le 21 juil. 2011 à 00:30, Jens Alfke a écrit : > > On Jul 20, 2011, at 2:34 PM, Andreas Grosam wrote: > >> According the doc, the parameter "capacity" in function >> CFDictionaryCreateMutable() sets the *maximum number* of key-value pairs >> which can be inserted into the container. That is,

Re: [Q] Directory & File enumeration order?

2011-07-20 Thread JongAm Park
I understood what you said. For the performance, well.. it depends on what kind of S/W it is and how often it needs to sort internally. In my case, I don't think it will be too slow, but I always consider fast performance. Without testing, I can think that it is slow. But whether it is practical

Re: CFMutableDictionary Capacity

2011-07-20 Thread Jens Alfke
On Jul 20, 2011, at 2:34 PM, Andreas Grosam wrote: > According the doc, the parameter "capacity" in function > CFDictionaryCreateMutable() sets the *maximum number* of key-value pairs > which can be inserted into the container. That is, it's not an *initial* > capacity. I think that was a mis

Re: [Q] Directory & File enumeration order?

2011-07-20 Thread Jens Alfke
On Jul 20, 2011, at 2:09 PM, JongAm Park wrote: > How can I make it retrieve in this order? > > Clip_0016_00.dpx, > Clip_0016_01.dpx, > Clip_0016_02.dpx, I don’t think you can. In general, file systems do not have to store directory contents sorted by name. It happens that HFS+ doe

CFMutableDictionary Capacity

2011-07-20 Thread Andreas Grosam
Is it possible to set the initial capacity (preparing for an initial number of key-value pairs) of a CFMutableDictionary? According the doc, the parameter "capacity" in function CFDictionaryCreateMutable() sets the *maximum number* of key-value pairs which can be inserted into the container. Th

Re: [Q] Directory & File enumeration order?

2011-07-20 Thread JongAm Park
Yeah.. that was what I thought, but I thought "nextObject" is too vague and doing that additional step is too time-consuming, because I need to work on contents in directories in my current project very frequently. If the NSDirectoryEnumerator supports how the "next" object is to be chosen, it

Re: [Q] Directory & File enumeration order?

2011-07-20 Thread Evadne Wu
Maybe instead of using the directory enumerator, fetch all the contents as an NSArray and sort that? -ev On Jul 21, 2011, at 05:09, JongAm Park wrote: > Hello, I wrote lines of code to enumerate files & folders under a given > folder. > > NSFileManager *fileManager = [[[NSFileManager alloc] i

[Q] Directory & File enumeration order?

2011-07-20 Thread JongAm Park
Hello, I wrote lines of code to enumerate files & folders under a given folder. NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease]; NSDirectoryEnumerator *directoryEnumerator; NSURL *candidateURL = nil; for( theURL in m_URLs_folders ) { directoryEnumerator = [fileManager

Re: Smooth resizing of a text field

2011-07-20 Thread Fritz Anderson
On 20 Jul 2011, at 2:30 PM, Gabriel Roth wrote: > My next thought was to convert the text field into an image (at some large > font size) and then scale the image up and down as the slider moves. But I > can't figure out how to create an image from a text field (or otherwise > generate an image of

Number Strings to NSDecimalNumber

2011-07-20 Thread Andreas Grosam
I would like to parse a number string using NSDecimalNumber's decimalNumberWithString:locale: method. All number strings are in the "C" POSIX locale, e.g.: "-1.002e-10" What should I set for the locale parameter (which is a NSDictionary) if I want to use the "C" Posix locale (aka "en_US_POSIX"

Smooth resizing of a text field

2011-07-20 Thread Gabriel Roth
My application displays a non-editable text string in an NSTextField. When the user adjusts a slider, the entire window and all its subviews—including this text field—should resize smoothly. My first thought was to bind the font size of the text field to a property and have that property set to a

Re: Dismissing a Popover Internally

2011-07-20 Thread Matt Neuburg
On Wed, 20 Jul 2011 12:32:07 -0500, Gordon Apple said: >UIPopoverController has a UINavigationController. Is there any decent way >to access the UIPopoverController inside a popover view to dismiss it? If I understand the question, then basically, no - and it's maddening. On the one hand you're

Re: Stupid (virtual) keyboard mistake... I think

2011-07-20 Thread Matt Neuburg
On Tue, 19 Jul 2011 18:57:37 -0500, William Squires said: > What's the proper way to detect if the "Enter" key on the virtual > (on-screen) keyboard in iOS is touched? > Is this part of the UITextField delegate protocol? Or is it supposed to be > the "Editing Did End" event you see when you ri

Re: Dismissing a Popover Internally

2011-07-20 Thread Chris Parker
Hi Gordon, On Jul 20, 2011, at 10:32 AM, Gordon Apple wrote: > UIPopoverController has a UINavigationController. Is there any decent way > to access the UIPopoverController inside a popover view to dismiss it? The > only way I have come up with is to either pass the reference down the chain, T

Dismissing a Popover Internally

2011-07-20 Thread Gordon Apple
UIPopoverController has a UINavigationController. Is there any decent way to access the UIPopoverController inside a popover view to dismiss it? The only way I have come up with is to either pass the reference down the chain, or at least put it into in the root view. In the latter case you can g

Re: core data, binary objects and efficiency

2011-07-20 Thread Evadne Wu
I think it actually works quite well for very small things (that is, < 10KB). I used this approach for small-ish user avatars as a UIImagePNGRepresentation()-backed transformable attribute on an original iPad. -ev On Jul 21, 2011, at 00:29, Roland King wrote: > Oh I see what you mean. I've al

Re: core data, binary objects and efficiency

2011-07-20 Thread Roland King
Oh I see what you mean. I've already done that as I said in the original message, the audio piece is on a separate entity with a 1-1 relationship to the actual entity which means I can keep it faulted out until I actually need the audio (as opposed to needing the other various properties of the

Re: Automatic warnings for NSLocalizedString?

2011-07-20 Thread Frédéric Testuz
It's not at compile time, but you can have messages log at runtime. See the documentation for [NSBundle localizedStringForKey:value:table:]. This is the method called by NSLocalizedString. F. Testuz Le 20 juil. 2011 à 13:10, Oleg Krupnov a écrit : > Hi, > > Is there a way, at compile time, t

Re: core data, binary objects and efficiency

2011-07-20 Thread Evadne Wu
Good to know; keep in mind that FileBlob and Audio are entity names I conjured out of thin air and you will have to implement them. :) -ev On Jul 20, 2011, at 23:58, Roland King wrote: > Thanks - I'll look up FileBlob when I re-download all my tools .. I upgraded > to Lion and didn't think abo

Re: NSBeep() blocks for some users

2011-07-20 Thread Jens Alfke
On Jul 20, 2011, at 8:13 AM, Glenn L. Austin wrote: >> I've had a few users complain that if my app calls NSBeep() many times in >> quick succession the program blocks until each of the beeps has played >> sequentially. I can't reproduce this: on my system, NSBeep() returns >> immediately and a s

Re: Opening a file read-only?

2011-07-20 Thread Jens Alfke
On Jul 19, 2011, at 6:55 PM, Graham Cox wrote: > Because we just got rejected on the App Store for opening a file with > read/write access in a place that's not allowed. I've checked the code that > we're not writing or creating files to these locations - we're not - so the > only other possib

Re: NSBeep() blocks for some users

2011-07-20 Thread Glenn L. Austin
On Jul 18, 2011, at 11:41 PM, George Nachman wrote: > I've had a few users complain that if my app calls NSBeep() many times in > quick succession the program blocks until each of the beeps has played > sequentially. I can't reproduce this: on my system, NSBeep() returns > immediately and a subseq

Re: Best way to do static overlay over scrolling content?

2011-07-20 Thread Gary L. Wade
You may be better served to consider doing something like the way rulers are used in relation to a scroll view. If you choose an overlay that needs to keep synchronized with another view, look at how WebKit does this for its Inspect Element feature. - Gary L. Wade (Sent from my iPhone) On Jul

core data, binary objects and efficiency

2011-07-20 Thread Roland King
In my iOS app, using core data, one of my model objects is short audio clips, 2-10 seconds worth of reasonably low quality mono audio. Not huge, but not tiny either. Currently I'm using a binary property in my core data model to store them. I've read the documentation and made sure the audio cli

Automatic warnings for NSLocalizedString?

2011-07-20 Thread Oleg Krupnov
Hi, Is there a way, at compile time, to automatically check that all strings referenced anywhere in my project via NSLocalizedString have their localized counterparts in *.strings files for all localizations I have included into the project? So that if a string is missing in a localization, I woul

Re: Modal panel and -initialFirstResponder

2011-07-20 Thread Vincent Habchi
Hi Quincey, > What does "shows (modally)" mean? It's a modal panel, displayed though a -[NSApp runModalForWindow:]. > The initial first responder is the view that's *going to be* the first > responder, when it's window becomes key. Panels don't become key at the same > times as regular windows

Re: Best way to do static overlay over scrolling content?

2011-07-20 Thread Quincey Morris
On Jul 20, 2011, at 00:55, Daniel Vollmer wrote: > When you scroll sideways, the "title" of each graph stays in place, whereas > the rest of the content scrolls as usual. Currently, I simply redraw the > whole graph (well, the visible bit). This strikes me as rather inefficient, > because I ess

Re: Best way to do static overlay over scrolling content?

2011-07-20 Thread Lee Ann Rucker
NSScrollViews aren't terribly happy with having extra subviews that aren't children of the contentView, but a separate view that's a sibling of the scrollview should work. But actually the first thing I'd do is profile it to see if the drawing really is that inefficient. I've got an app that dr

Re: Modal panel and -initialFirstResponder

2011-07-20 Thread Quincey Morris
On Jul 19, 2011, at 23:28, Vincent wrote: > More specifically, I have a NSPanel, with some NSTextField inside, and would > like the editing to begin immediately in the first text field when the panel > appears. I thus set the initialFirstResponder outlet to the field I’d like > the edition to s

Best way to do static overlay over scrolling content?

2011-07-20 Thread Daniel Vollmer
Hello, I have a visualisation application that displays multiple graphs (currently using NSCollectionView, but possibly switching to an NSView-based NSTableView in the future) that looks like this: http://www.maven.de/code/wowplot/example_chains.png When you scroll sideways, the "title" of eac