Keep Xcode top on Mac-Screen than press "command" and "comma key btn" a xcode preferences popbox will open given below: than click on "Text Editing" menu below given window will open here you on top written "show" with "Line numbers" just check it and thats it.