Re: Core Data migration: how to delete some managed objects?

2013-03-04 Thread Jerry Krinock
Correcting the message I just sent, wherever I mentioned subclassing NSMigrationManager, I meant subclassing NSMigrationPolicy. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Re: Core Data migration: how to delete some managed objects?

2013-03-04 Thread Jerry Krinock
On 2013 Mar 04, at 14:38, Sean McBride wrote: > What's a good way to delete some managed objects from a store when migrating > the store from version x to version y? Basically, for entity 'Foo', I'd like > for instances that match predicate 'bar' to not exist in the new store. This is easy t

Re: getting ivar of fundamental types with object_getInstanceValue

2013-03-04 Thread Ignacio Enriquez
> > > It might help the rest of us if you state your goals here, because I can't > see any reason to use object_setInstanceVariable() unless you are doing > something very low-level or non-standard. > > I found this code in some test cases where the property of the testing class was not exposed. I

Re: getting ivar of fundamental types with object_getInstanceValue

2013-03-04 Thread Ignacio Enriquez
> What would be the best way to set the value of a ivar? > > Is there a reason that properties, a setter method, or KVC won't work? If > you absolutely need direct access, can you make the ivar public? > Originally I found that code in some tests where the testing class does not expose some prope

Re: getting ivar of fundamental types with object_getInstanceValue

2013-03-04 Thread Ignacio Enriquez
Greg, Thanks! that was pretty fast and efective. Now I got it right On Tue, Mar 5, 2013 at 11:37 AM, Greg Parker wrote: > On Mar 4, 2013, at 6:23 PM, Ignacio Enriquez wrote: > > I am trying to understand the correct usage and caveats, of > > object_setInstanceValue function from objc/objc-run

Re: Focus ring and layer-backed views

2013-03-04 Thread Oleg Krupnov
Thanks Kyle, This is almost perfectly what I need! However, one problem I've found is with custom layer-hosting controls. Suppose my control consists of two segments. Each segment is represented with a child CALayer. Now I want the focus ring to contour only one segment. In this case, the ring ap

Re: getting ivar of fundamental types with object_getInstanceValue

2013-03-04 Thread Graham Cox
On 05/03/2013, at 1:23 PM, Ignacio Enriquez wrote: > What would be the best way to set the value of a ivar? Make it a property and simply assign to it? Or, within the class itself, just assign to it. It might help the rest of us if you state your goals here, because I can't see any reason t

Re: getting ivar of fundamental types with object_getInstanceValue

2013-03-04 Thread Wim Lewis
On 4 Mar 2013, at 6:23 PM, Ignacio Enriquez wrote: > I am trying to understand the correct usage and caveats, of > object_setInstanceValue function from objc/objc-runtime.h. > [] > An old post in this list (Re: ivars and fundamental types - > http://lists.apple.com/archives/cocoa-dev/2010/Oc

Re: getting ivar of fundamental types with object_getInstanceValue

2013-03-04 Thread Greg Parker
On Mar 4, 2013, at 6:23 PM, Ignacio Enriquez wrote: > I am trying to understand the correct usage and caveats, of > object_setInstanceValue function from objc/objc-runtime.h. > > Recently I found this code: > >object_setInstanceVariable(foo, "_isRevealed", (void*)YES); > > where foo is: >

Re: Finding out what's incorrectly calling an Obj-C method

2013-03-04 Thread Andy Lee
Here's where I saw it: Nice blog. Not the first place I've seen this tip but somehow I'd forgotten about it and was delighted to be reminded. --Andy On Mar 4, 2013, at 5:44 PM,

Re: Finding out what's incorrectly calling an Obj-C method

2013-03-04 Thread Andy Lee
Try breaking on -[NSObject doesNotRecognizeSelector:]. I saw this on a blog somewhere which I will find and credit in a moment. --Andy On Mar 4, 2013, at 4:30 PM, Steve Mills wrote: > On Mar 4, 2013, at 15:17:42, Jens Alfke wrote: > >> IMHO everyone should enable exception breakpoints in all

Core Data migration: how to delete some managed objects?

2013-03-04 Thread Sean McBride
Hi all, What's a good way to delete some managed objects from a store when migrating the store from version x to version y? Basically, for entity 'Foo', I'd like for instances that match predicate 'bar' to not exist in the new store. In the headers, I see a "NSRemoveEntityMappingType", which s

Re: File Path String From Save Panel

2013-03-04 Thread Sean McBride
On Mon, 4 Mar 2013 13:22:39 -0800, Jens Alfke said: >It’s also worth noting that if you want to display path components in a >UI, you shouldn’t be working with filesystem-level methods like - >pathComponents, because the user view of the file system isn’t identical >to what’s ‘really’ there. The u

Re: Finding out what's incorrectly calling an Obj-C method

2013-03-04 Thread Steve Mills
On Mar 4, 2013, at 15:17:42, Jens Alfke wrote: > IMHO everyone should enable exception breakpoints in all their projects. They > are a life-saver for debugging. Yeah, I usually do, but at times they get in the way because the OS is throwing exception on things I don't care about (usually readi

Re: File Path String From Save Panel

2013-03-04 Thread Jens Alfke
On Mar 4, 2013, at 12:38 PM, Lee Ann Rucker wrote: > The last time I cared about pathComponents wasn't for file IO, it was for a > "Recent Items" -style name disambiguator - you know, how it'll show just the > lastPathComponent until there are two that match, and then it finds the first > non

Re: Finding out what's incorrectly calling an Obj-C method

2013-03-04 Thread Jens Alfke
On Mar 4, 2013, at 1:06 PM, Steve Mills wrote: > It'd really help if I could set a breakpoint on the part of the Obj-C runtime > that spits out the "unrecognized selector" error. None of the usual suspects > handle that. It’s an exception, so use the Xcode breakpoints panel to add an all-exce

Re: File Path String From Save Panel

2013-03-04 Thread Peter Hudson
Thanks Iain and Lee Ann path was the method I needed. Peter On 4 Mar 2013, at 20:38, Lee Ann Rucker wrote: > > On Mar 4, 2013, at 8:25 AM, Peter Hudson wrote: > >> I recover the path string from a Save Panel like so :- >> >> NSArray *pathComponents = [[sp URL] pathComponents]; >> >> Whe

Re: Finding out what's incorrectly calling an Obj-C method

2013-03-04 Thread Steve Mills
On Mar 4, 2013, at 14:58:04, Rick Mann wrote: > This sometimes happens to me when something gets released unexpectedly. Try > turning on zombies. If that's the case, you'll get a "message sent to > deallocated instance" instead. The object is still very much valid, and zombie detection is on.

Re: Finding out what's incorrectly calling an Obj-C method

2013-03-04 Thread Rick Mann
On Mar 4, 2013, at 12:40 , Steve Mills wrote: > I'm seeing some output in Xcode's log: > > 2013-03-04 14:35:34.696 Finale 18[15558:303] -[MusicWindowController count]: > unrecognized selector sent to instance 0x1bbcd170 > > I can't find where this is being called from. I've tried implementing

Re: File Path String From Save Panel

2013-03-04 Thread Lee Ann Rucker
On Mar 4, 2013, at 8:25 AM, Peter Hudson wrote: > I recover the path string from a Save Panel like so :- > > NSArray *pathComponents = [[sp URL] pathComponents]; > > When I put them together again to use to write a file, any spaces in the file > name are turned in %20 symbols. > > Any sugge

Re: File Path String From Save Panel

2013-03-04 Thread iain
On 04/03/13 16:25, Peter Hudson wrote: I recover the path string from a Save Panel like so :- NSArray *pathComponents = [[sp URL] pathComponents]; When I put them together again to use to write a file, any spaces in the file name are turned in %20 symbols. Any suggestions what I am doing wr

File Path String From Save Panel

2013-03-04 Thread Peter Hudson
I recover the path string from a Save Panel like so :- NSArray *pathComponents = [[sp URL] pathComponents]; When I put them together again to use to write a file, any spaces in the file name are turned in %20 symbols. Any suggestions what I am doing wrong ? Peter __

[MEET] Toronto Cocoaheads / tacow - Mar. 12

2013-03-04 Thread Karl Moskowski
tacow's next meeting is scheduled for 6:30 PM on Tuesday, March 12, 2013 in meeting room 302 of Metro Hall. Anluan O'Brien will be talking about NSURLProtocol. Additional details can be found at . All are welcome, and we look forwa