specta / expecta

A Matcher Framework for Objective-C/Cocoa
MIT License
1.59k stars 158 forks source link

Method Invocation With Indirect Pointer Inside expect() Triggers compiler error #34

Closed segiddins closed 9 years ago

segiddins commented 11 years ago
NSString *input = @"http://google.com/";
    NSURL *output;
    NSError *error;
expect([transformer transformValue:input toValue:&output error:&error]).to.beTruthy();

Yields the compiler error Sending 'NSURL *const __strong *' to parameter of type '__autoreleasing id *' changes retain/release properties of pointer. Likely related to http://developer.apple.com/library/mac/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011226-CH1-SW4.

robb commented 10 years ago

You have probably figured this out already but adding __block_ to the output and error pointers helps.

orta commented 9 years ago

@segiddins think this is closable?