I'm trying to cascade a promise through some classes which add functionality at each level.
+ (AnyPromise *) method {
return [SomeClass whichReturnsPromise]
.then(^(id obj){
// do stuff
return obj;
});
}
Unfortunately this code is throwing an error on the second line:
exc_bad_access (code=1 address=0x10)
(Note: just calling return [SomeClass whichReturnsPromise]
works fine)
I've scoured stackoverflow answers and tried many variations of the above code (which would work in javascript), but I keep getting the same error. How do I fix this?