Re: NSMutableDictionary or Custom Object when adding properties?

2013-05-16 Thread Graham Cox
On 17/05/2013, at 3:43 PM, Trygve Inda wrote: > But for the objects I don't see a nice way to do this > > There is setValue:forUndefinedKey: and then each object could keep a local > dictionary of these "defined at runtime" keys. There are low-level runtime methods that allow you to add prope

Re: NSMutableDictionary or Custom Object when adding properties?

2013-05-16 Thread Ken Thomases
On May 17, 2013, at 1:18 AM, Trygve Inda wrote: >> On May 17, 2013, at 12:43 AM, Trygve Inda wrote: >> >>> The trouble comes in the fact that I need to be able to add properties at >>> runtime. For the dictionary option, it is easy - just make sure the key >>> names don't collide and I can add mo

Re: NSMutableDictionary or Custom Object when adding properties?

2013-05-16 Thread Trygve Inda
> On May 17, 2013, at 12:43 AM, Trygve Inda wrote: > >> I need to keep a small (few thousand) record database of sorts. Each record >> has some pre-detertermined fields, but the user can add there own fields to >> to a limited extent. … >> >> This will be simple objects in an NSMutableArray. >>

Re: NSDocument custom file Package or URL override?

2013-05-16 Thread Trygve Inda
> On 5/15/13 5:14 PM, Trygve Inda wrote: >> My document format needs to look like: >> >> File (actually a directory marked as a package) >> -- MyData.plist >> -> Images (directory) >> > Image1.png >> > Image2.png >> -> Data (directory) >> > Data1.dat >> > Data2.dat >> -> Icons (dir

Re: NSMutableDictionary or Custom Object when adding properties?

2013-05-16 Thread Ken Thomases
On May 17, 2013, at 12:43 AM, Trygve Inda wrote: > I need to keep a small (few thousand) record database of sorts. Each record > has some pre-detertermined fields, but the user can add there own fields to > to a limited extent. … > > This will be simple objects in an NSMutableArray. > > I can us

NSMutableDictionary or Custom Object when adding properties?

2013-05-16 Thread Trygve Inda
I need to keep a small (few thousand) record database of sorts. Each record has some pre-detertermined fields, but the user can add there own fields to to a limited extent. It is a pretty light use so CoreData isn't what I really want, plus migrating to future structures is an issue with CoreData.

Re: SecTrustEvaluate() failing with kSecTrustResultRecoverableTrustFailure

2013-05-16 Thread Rick Mann
On May 16, 2013, at 12:46 , Jens Alfke wrote: > Ugh, yeah, I’ve had trouble with this too, but it was long enough ago that I > don’t remember the details. > One thing that might help is calling SecTrustGetResult to get detailed info > on the results of trust evaluation. The returned structure

Re: disable beginSheet animation

2013-05-16 Thread Peng Gu
It seems that once you changed the speed value, you can't restore it. Other sheets including the open, save panels will use the new value. So in the end, I decided not to do it. > A question: Why do you want a sheet to pop into view instead of acting as users expect? I am willing to trust you hav

Re: disable beginSheet animation

2013-05-16 Thread Fritz Anderson
The documentation says that the default resize period is subject to change between OS releases, and it's possible others will have changed it on their own. (I've run into people who are at war with animations, and would be furious if their settings were undone.) You should collect the value befo

Re: disable beginSheet animation

2013-05-16 Thread Peng Gu
Found the answer. By setting the animation speed to a low value (not 0, otherwise 0.2 is used by default) [[NSUserDefaults standardUserDefaults] setFloat:0.1 forKey: @"NSWindowResizeTime"]; [NSApp beginSheet:] [[NSUserDefaults standardUserDefaults] setFloat:0.2 forKey: @"NSWindowResizeT

disable beginSheet animation

2013-05-16 Thread Peng Gu
How do I disable the animation of [NSApp beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo]. Apple document says that "Other sheet behavior, such as the animation when it appears and is dismissed, is handled automatically by the Application Kit." Thanks, Peng

Re: SecTrustEvaluate() failing with kSecTrustResultRecoverableTrustFailure

2013-05-16 Thread Jens Alfke
On May 15, 2013, at 9:13 PM, Rick Mann wrote: > I'm trying to validate our self-signed certificate in > NSURLConnectionDelegate's > -connection:willSendRequestForAuthenticationChallenge: using itself as the > root cert. I'm not 100% sure I'm doing it right, but looking at the > ridiculously,

Re: sandboxing and filename extensions

2013-05-16 Thread Charles Srstka
On May 15, 2013, at 10:31 AM, Scott Ribe wrote: > Using @"com.adobe.pdf" makes no difference. This doesn't relate to your problem, but technically, the best thing to use is probably the constant (__bridge NSString *)kUTTypePDF, rather than hard-coding either the extension or the UTI directly i

Re: UIView drawRect will update whole bounds

2013-05-16 Thread David Duncan
On May 15, 2013, at 11:50 PM, li shunnian wrote: > I found even in a very simple painter app, view will refresh whole bounds > when switching from another app. This is expected, when your application is placed in the background, all of the backing stores for its views are discarded to save me