My code is something like this:
[request setPostValue:employee.empId forKey:@"empId"];
where employee is a “POCO” object that has a property empId which is int, but the method is waiting an identifier.
I’ve tried already sending setPostValue:&employee.empId and setPostValue:[employee.empId] but still getting errors.
Can I get the (id) in any way? or must I create another object from the property?
Yeah, you need to create another object from the integer before you can hand it off to a method that’s expecting an
id.Alternatively, with more recent versions of the SDK (post-iOS 6, I think?), you can use Objective-C’s new boxing literals: