Re: ARC issue

2012-11-07 Thread Ken Thomases
On Nov 7, 2012, at 8:33 AM, Andreas Grosam wrote: > On 07.11.2012, at 14:50, Ken Thomases wrote: > >> This seems like a problem with ARC. Ideally, the compiler would understand >> not just that "error" is __autoreleasing but would understand something >> about its "autorelease scope". That is

Re: ARC issue

2012-11-07 Thread Andreas Grosam
Thank you all for the answers, and your pointers to additional info (@Bob: very useful article )! On 07.11.2012, at 14:50, Ken Thomases wrote: > > I'm guessing that won't change anything. The problem, I think, is that for > parameters like "error" which are returned indirectly via parameter

Re: ARC issue

2012-11-07 Thread Ken Thomases
On Nov 7, 2012, at 7:18 AM, Marco Tabini wrote: > On 2012-11-07, at 8:05 AM, Andreas Grosam wrote: > >> NSDictionary* fetchUser(NSNumber* ID, NSError** error) >> { >> id user = nil; >> //@autoreleasepool // crashes when @autoreleasepool is enabled >> { >> id data = ...; // response

Re: ARC issue

2012-11-07 Thread Bob Cromwell
According to ARC documentation, out parameter will be changed to auto release one: NSError ** error will be auto changed to NSError * __autorelease * error. So It's expected behavior that crash happens. An article about this here http://blog.pioneeringsoftware.co.uk/2012/03/06/out-parameter

Re: ARC issue

2012-11-07 Thread Marco Tabini
I wonder if the problem might be that data is an autoreleased object, which automatically gets dealloc'ed at the end of the autorelease pool (as explained in the docs). Have you tried replacing *error = data with *error = [data copy] and seeing what happens? On 2012-11-07, at 8:05 AM, Andrea

ARC issue

2012-11-07 Thread Andreas Grosam
Xcode 4.5.1, ARC enabled. I've this C++ member function, for a testing environment (gtest): NSDictionary* fetchUser(NSNumber* ID, NSError** error) { id user = nil; //@autoreleasepool // crashes when @autoreleasepool is enabled { id data = ...; // response body of a HTTP Res

RE: ARC Issue in new Sketch Sample Code

2012-08-29 Thread Gordon Apple
Well, I didnĀ¹t get any response as to how to make that beast ARC compliant, so I did something else. Keeping the same basic undo architecture as used in Sketch, I created my own version of NSMutableDictionary, albeit much simplified, containing only what I needed. Sometimes the standard classes d

ARC Issue in new Sketch Sample Code

2012-08-27 Thread Gordon Apple
- (void)setGraphicProperties:(SKTMapTableOwner *)propertiesPerGraphic { NSMapEnumerator propertiesPerGraphicEnumerator = NSEnumerateMapTable([propertiesPerGraphic mapTable]); Shape *graphic; NSDictionary *graphicProperties; while (NSNextMapEnumeratorPair(&propertiesPerGraphicEn