When I am trying to print using println() function it is not showing autocomplete parameter list in swift. Is there any problem in my Xcode?
            Asked
            
        
        
            Active
            
        
            Viewed 9,512 times
        
    5
            
            
         
    
    
        Cœur
        
- 37,241
- 25
- 195
- 267
 
    
    
        Nirmal Choudhari
        
- 559
- 5
- 17
- 
                    just restart xcode and check – m0bi5 Feb 10 '15 at 10:44
- 
                    1I restarted xcode as well as my mac, but still not working. I am using xcode6.1 – Nirmal Choudhari Feb 10 '15 at 10:47
- 
                    Possible duplicate of [Xcode 6 Swift code completion not working](http://stackoverflow.com/q/25883905/456814). – Bob Oct 24 '15 at 09:32
- 
                    1Bob Thanks for marking duplicate so early – Nirmal Choudhari Oct 26 '15 at 10:11
3 Answers
37
            
            
        Delete user/Library/Developer/Xcode/DerivedData and delete the data of folder(Derive data) and restart Xcode. Should work. If doesn't, restart mac after doing this.
Note: for Xcode 11.7 and maybe later, use the
~/Library/Developer/Xcode/DerivedData/path.
 
    
    
        shim
        
- 9,289
- 12
- 69
- 108
 
    
    
        Dhruv Ramani
        
- 2,633
- 2
- 22
- 29
- 
                    1Then, reinstall xcode. I always keep a installer file with me for such emergency purposes. Good luck :) – Dhruv Ramani Feb 10 '15 at 11:12
- 
                    Here's a link I found that might help you : http://stackoverflow.com/questions/26783478/xcode-autocomplete-stopped-working – Dhruv Ramani Feb 10 '15 at 11:18
- 
                    Then you are experiencing NO PROBLEM! There is no autocomplete for println(). Congrats! – Dhruv Ramani Feb 12 '15 at 10:41
- 
                    Because I think it's just too obvious. println() just takes a string. Any other datatype have to be converted to string in order to use them or otherwise are automatically converted. – Dhruv Ramani Feb 12 '15 at 11:31
- 
                    Then according to your above comment , var which is of string type should be available in autocomplete list. isn't so? – Nirmal Choudhari Feb 12 '15 at 12:59
- 
                    
- 
                    
- 
                    
3
            Hi I found the reason for this.... As Dhruv mentioned, it only accepts string argument. So we need to convert object to string inline println() function.
For example:
we have integer defined as var age:Int = 24
then we can print this as
println("\(age)")
In this case we will get autocomplete option. On other hand println(age) will print same result as above.
 
    
    
        Nirmal Choudhari
        
- 559
- 5
- 17
2
            
            
        - Press cmd + K in your Xcode;
- Do context-click on Xcode -> Quit, and the same for Simulator.
- Open the project again;
- If still doesn't work, you don't need to restart your mac. Write "Int." or some other system type, but not yours that you have issue with and voila!
 
    
    
        Vladimir Kuzomenskyi
        
- 434
- 7
- 9