Your problem is this line:
UIImageView *errorIcon =
[[UIImageView alloc] initWithFrame:CGRectMake(-10,-10,23,23)];
That means the top left of the superview. If that isn't where you want to put it, don't put it there!
The top right is here:
UIImageView *errorIcon =
[[UIImageView alloc] initWithFrame:
CGRectMake(superview.bounds.size.width-10,-10,23,23)];
(For superview
substitute a reference to the view that will be the superview.)