Reset/fix Xcode 4.5 code completion

One of the new “features” in Xcode 4.5 was supposed to be vastly improved code completion. It was supposed to learn what you type regularly and provide these more frequently as options for code completion.

However, for me this isn’t working at all.

  • Correct way to create button in Sprite Kit?
  • Create a for loop to add 39 buttons to an array
  • How do I get first x elements of an NSArray in Cocoa?
  • What should I do to adapt my app to iOS 5.0 keeping compatibility with iOS 4
  • CABasicAnimation current elapsed time
  • How do I check if a string contains another string in Objective-C?
  • One of the famously bad code completion words is NSString.

    When I type it I get…

    NS - NSAddedPersistentStoresKey
    NSS - NSSaveChangesRequest
    NSSt - NSStoreModelVersionHashesKey
    NSStr - NSStream
    NSStri - NSStrikethroughStyleAttributeName
    NSStrin - NSString
    

    I have never used any of the other suggestions given and most of them I’m not actually sure what they are. I use NSString many times a day, why wasn’t it suggested first? In fact, apart from NSSet I don’t think I’ve ever used another class that begins with NSS.

    Also, when looking for NSLog() which used to get suggested when I typed NSL I now get…

    NS - NSAddedPersistentStoresKey
    NSL - NSLayoutAttribute
    NSLo - NSLoadedClasses
    NSLog - NSLog(<#id, ...#>)
    

    Again, never heard of the others.

    Is there any way to fix this so that I get the functionality that Apple says I should be getting?

    Thanks for any help.

    Solutions Collect From Internet About “Reset/fix Xcode 4.5 code completion”

    OK, I deleted the UserInfo folder from ~/Library/Developer/Xcode/ and it seems to have fixed it.