V(transitional verb)+고 싶다 is very special pattern.
With focusing on the verb, It is preceded by 을/를
With focusing on 고 싶다, It is preceded by 이/가
In this case,
You can regard it as an adjective like 좋다, 싫다, 없다, 있다 where it has meaning of "wanting to do something".
나는 사과가 좋다 : For me, there is an apple that I like = I like an apple.
나는 사과가 먹고 싶다 : For me, there is an apple that I'm wanting to eat => I want to eat an apple.
Following both have same meaning.
너는 내가 보고 싶었다 : For you, there is me whom you were wanting to see. => You wanted to see me.
너는 나를 보고 싶었다 : You wanted to see me.