Re: NSRegularExpression only finds a single occurrence of my match

2010-10-17 Thread Roland King
Several things here. Firstly your regular expression matches the whole string because you have a '*' after the capture group. Putting a '*' after a capture group doesn't make the RE match multiple times and make multiple captures, it just makes that group repeat and the capture group will end up

Store NSPredicate in Core Data

2010-10-17 Thread Ivan C Myrvold
I am building an application where I am using an NSPredicateEditor. Now I would like to store the resulting NSPredicate from the NSPredicateEditor in Core Data. I am not sure how to accomplish that. I was thinking about using NSCoder, but not sure how to use NSCoder for this as it usually is use

Re: Store NSPredicate in Core Data

2010-10-17 Thread Ivan C Myrvold
After some thought I found out that I can use NSkeyedArchiver and NSKeyedUnarchiver to make an NSData and back to NSPredicate instance. Then it is possible to store NSData into Core Data. Den 17. okt. 2010 kl. 12.48 skrev Ivan C Myrvold: > I am building an application where I am using an NSPre

Codesign additional items within an app bundle

2010-10-17 Thread Michael Diehr
Taking my first stab at codesigning an OS X App, and I'm noticing that only some items within the app bundle get signed, e.g.: codesign -s 'My Company' /path/to/my/MyApp.app seems to only sign some of the files in a bundle: MyApp.app/ Contents/MacOS/MyApp (the executable) Contents/Resources

Re: Store NSPredicate in Core Data

2010-10-17 Thread Martin Stanley
You may have already figured this out, but just to be complete, here is what I did to save NSPredicates in a Core Data store: I created a transformable attribute to hold the predicate. When I selected this in the model editor, the transformer defaulted to: NSKeyedUnarchiveFromData. That's it, a

Re: NSRegularExpression only finds a single occurrence of my match

2010-10-17 Thread Keary Suska
On Oct 17, 2010, at 12:38 AM, Devraj Mukherjee wrote: > Hi all, > > I am trying to use Regular Expressions to match uppercase letters in > strings like "numberOfNames" which I want to replace with > number_of_names. Code sample > > > NSError *error = NULL; > NSRegularExpression *r

Re: Store NSPredicate in Core Data

2010-10-17 Thread Martin Hewitson
If it's still of use, I did this with predicateWithFormat: and -description wrapped up in a NSValueTransformer subclass. In other words I store a string representation in the core-data model. I don't know if this is always valid, but it works well for the predicates in my app. Martin -

How to create secondary Thread that listens to event taps?

2010-10-17 Thread eveningnick eveningnick
I have an application that has to perform a long action and while performing it, be able to react to pressing "Esc" and cancel that long operation. That "long action" is a series of Applescript calls. If i perform these calls in NSOperation's -main function the speed significantly decreases - i gue

Re: Store NSPredicate in Core Data

2010-10-17 Thread Dave DeLong
I would recommend against this approach (saving the predicateFormat string) if you care about the internal structure of the predicate (and I think in this case, you might). If you have a predicate editor, with the outermost (topmost) predicate being the compound predicate row (any/all/none of t

Re: inline function problems

2010-10-17 Thread Kyle Sluder
On Oct 16, 2010, at 8:31 PM, Ken Tozier wrote: > Hi > > I want to create some inline functions that are universally available within > my app, but can't seem to get them working. If I define a set of inlines > within a specific class, they compile, but If I take the same functions and > move

Re: inline function problems

2010-10-17 Thread Ken Tozier
On Oct 17, 2010, at 3:05 PM, Kyle Sluder wrote: > Think about this for a second: "static" means file scope, so obviously you > can't reference the symbol from another file. And non-static inlines can't > actually be inlined because they may be called from elsewhere or have their > addresses ta

Re: How to create secondary Thread that listens to event taps?

2010-10-17 Thread Rainer Brockerhoff
At 12:01 -0700 17/10/10, cocoa-dev-requ...@lists.apple.com wrote: >From: eveningnick eveningnick >Date: Sun, 17 Oct 2010 20:25:02 +0300 >Message-ID: > >So, i decided to do the following - i will execute the "long action" >in a main thread, and create an "Esc-listening thread" that will >install a

Re: inline function problems

2010-10-17 Thread Greg Parker
On Oct 17, 2010, at 12:05 PM, Kyle Sluder wrote: > On Oct 16, 2010, at 8:31 PM, Ken Tozier wrote: >> >> I want to create some inline functions that are universally available within >> my app, but can't seem to get them working. If I define a set of inlines >> within a specific class, they compi

Re: inline function problems

2010-10-17 Thread Velocityboy
On Oct 17, 2010, at 12:05 PM, Kyle Sluder wrote: > On Oct 16, 2010, at 8:31 PM, Ken Tozier wrote: > >> Hi >> >> I want to create some inline functions that are universally available within >> my app, but can't seem to get them working. If I define a set of inlines >> within a specific class,

Re: inline function problems

2010-10-17 Thread Kyle Sluder
On Sun, Oct 17, 2010 at 1:29 PM, Velocityboy wrote: > This is actually not always true. If you have an non-static inline in a > header file, the compiler is pretty smart about it. You can see this in > action if you generate the assembly and look it it. This: IIRC there's no guarantee that a tw

Re: inline function problems

2010-10-17 Thread Velocityboy
On Oct 17, 2010, at 2:07 PM, Kyle Sluder wrote: > On Sun, Oct 17, 2010 at 1:29 PM, Velocityboy wrote: >> This is actually not always true. If you have an non-static inline in a >> header file, the compiler is pretty smart about it. You can see this in >> action if you generate the assembly and

[Q] Using NSInvocation vs. selector with NSTimer

2010-10-17 Thread JongAm Park
Hello, I have used scheduledTimerWithTimeInterval:target:selector:userInfo:repeats: or timerWithTimeInterval:target:selector:userInfo:repeats: Although I know that NSInvocation was added (from Leopard?), I didn't use it much. Is there any benefit in using it? My guess is that an NSInvocation i

Re: [Q] Using NSInvocation vs. selector with NSTimer

2010-10-17 Thread Joar Wingfors
On 17 okt 2010, at 15.51, JongAm Park wrote: > Although I know that NSInvocation was added (from Leopard?), I didn't use it > much. NSInvocation predates Mac OS X... > Is there any benefit in using it? My guess is that an NSInvocation instance > is used repeatedly, but using the "selector"

Heapshot Analysis to find Memory Accretion (Leaks)

2010-10-17 Thread Bill Bumgarner
Folks-- I wrote up an article on how to use the "Mark Heap" / "Heapshot Analysis" tools in Instruments to detect, analyze, and fix memory leaks, including those that leaks can't find. http://www.friday.com/bbum/2010/10/17/when-is-a-leak-not-a-leak-using-heapshot-analysis-to-fin