Xcode strange behaviour eliminated