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
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
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
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
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
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
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
- (void)setGraphicProperties:(SKTMapTableOwner *)propertiesPerGraphic {
NSMapEnumerator propertiesPerGraphicEnumerator =
NSEnumerateMapTable([propertiesPerGraphic mapTable]);
Shape *graphic;
NSDictionary *graphicProperties;
while (NSNextMapEnumeratorPair(&propertiesPerGraphicEn