I'm trying to set up an NSinvocation to upload a picture to a website. I'm doing this:
- Set up the nsinvocation object
- Add a UIImage* to the nsinvocation object as an argument, along with some other arguments
- invoke the nsinvocation when needed
- the function called when I invoke nsinvocation can't access the UIImage- I get NSInvalidArgumentException.
After digging for a little while, It looks like if I add a UIImage as an argument to my NSInvocation object, then try to get it back out... I am returned a different memory address! Is this normal?
//First I have a valid UIImage "imgHolder" which has a memory address of "A"...
NSInvocation *myInvocation = [NSInvocation invocationWithMethodSignature:...
[myInvocation setArgument:imgHolder atIndex:5];
//Now, the weird part...
UIImage *checkImg;
[myInvocation getArgument:&checkImg atIndex:12];
//checkImg has a memory address of "B"!
if I try to work with checkImg, I get various exceptions which leads me to believe it's not a valid UIImage.
Any ideas what's going on? Shouldn't the memory address of checkImg be identical to that of imgHolder?