Xcode Changing My Capitalization - cocoa

Sometimes, when I type something in Xcode, it changes the capitalization. For example, I type psSimpBox, and it changes to psSimpbox. That's OK since it's just a variable, but it is annoying. However, here's a real problem: When I type stringValue(), it changes to StringValue(). And, so I get a unrecognized selector error.
Also, Xcode has been recently doing a weird thing where my code starts appearing to run into itself. This is annoying, but has never actually broken things before. I don't think these two problems are related, but it seemed worth mentioning. Photo here.
Any ideas for how to fix this? The main problem is the capitalization, but the others would be nice to fix too...
Not sure if this is worth mentioning, but the app is mostly in ASObjC.

I would guess that you probably have another symbol in your code, e.g. a constant or a global variable, which is spelled psSimpbox, and Xcode's code completion is inserting this symbol after you've typed psSimp.

Regarding the symbol renaming, have you attempted to rebuild the code sense index? Click the project (blue icon) in your project list and press Cmd-I. Click the Rebuild CodeSense Index (or similarly-named) button.
I'm not sure what to tell you about the text running together. I've never seen that before, but I'd suggest selecting a different font (perhaps it's not the default font?) and checking your tab stop settings.

Related

Xcode 14.2 - Annoying source control shadow changes

Hi All not sure if anyone is having this but when making changes it adds the blue box on the left-hand side which is fine as before this was just showing what had changed. Now though, it's added this discard change and gives you a kind of before and after within your code. It's really really annoying and difficult to make changes. I've added a screenshot here where I was just removing so spacing. The code doesn't appear to do anything until you commit. Turning off Source Control completely doesn't even get rid of it.
Does anyone have any solutions for just turning this silly feature off completely? I've always used git fine with no issues within Xcode, I don't need to see the old change just what I'm actually updating the code to be.

Disable Sublime Text Minimap for a specific syntax

I'm trying to find a way to disable Sublime Text 3's minimap for a single syntax (Markdown) only and I'm not having much luck.
I've found a lot of references to adding "show_minimap": false, to your preferences both here and elsewhere but it doesn't seem to do anything regardless of whether I put it in Markdown.sublime-settings or Preferences.sublime-settings (I am restarting Sublime Text after changing the setting just to be safe).
The View/Hide Minimap menu item works globally but I can't set it for a specific syntax.
In most of the threads I've found I see some people saying that the setting doesn't work for them with other people saying it does but none of them seem to have an answer why and how you might fix it.
Has the syntax for that setting changed or has it simply been removed? I don't see it mentioned in the unofficial documentation.
If it does (still) exist is it something you can apply to a specific syntax or does it have to be a global setting?
Thanks!
I've tried both "hide_minimap": true and "show_minimap": false (alone and in combination) with ST2 2.0.2 and ST3 Build 3056 on XP, and nothing seems to work. I don't know the versions/platforms the answerers/commenters on your linked questions were using, but it seems that either the behavior was somehow removed recently, or it's platform-specific (maybe a little of both). I went back through the changelogs for ST2, ST3 Public Beta, and the ST3 dev builds and found a number of references to the minimap, but nothing to indicate that the functionality you're looking for had been removed intentionally.
We don't know if it makes a difference to the developer, but the community maintains an issue tracker on GitHub for things like this. Feel free to submit a new issue, with as much information as possible about what you've tried and the platform(s) and version(s) used, and we'll see where it goes.
If you're the plugin-writing type, there theoretically is a way around this, though. You could write an event listener that checks the scope of any newly-opened files, and if it matches text.html.markdown (or whichever type(s) of file for which you'd like to have the minimap hidden), it could execute the toggle_minimap command, which is what is fired when you select View -> Hide Minimap.
I'm working on that plugin, but it's not coming along very quickly. I'll report back if I can get it to work.
In OS X, Sublime text 3 try:
CMD+`
In Windows perhaps:
CTRL+`

Why would Xcode stop drawing tabs when indent level is greater than three?

For some reason Xcode 4.5 and 4.4.1 have both stopped displaying indented text at the proper level if there are more than three Tab characters of leading whitespace on the lines.
Easier to show than describe:
There are five leading tabs on the line the arrow is pointing to, but Xcode is drawing it as if there were only three. Using the left and right arrow keys confirms the Tabs are there.
I have deleted the derived data associated with my projects, deleted the project.xcworkspace file and xcuserdata directories within the project package, mucked around with various combinations of Indentation settings in Xcode's Preferences, all to no avail.
Newly created projects exhibit the same behavior. Changing the Source Editor font preferences have no effect either. This is in OS X 10.8.1.
Help -- my brain can't understand the code when it doesn't "look right"! What else can I try?
So, I filed a Radar, then heard back from a friend of mine who was having the same problem. Are you using the new SourceCode Pro font from Adobe? Your screenshot makes it look like you might be. Try switching back to a different theme and restarting Xcode? That's what I did, and it seems to be fine.
Eventually I removed (after quitting Xcode) the entire UserData folder in ~/Library/Developer/Xcode and that seems to have fixed the problem.
Hopefully it won't take more than another half hour to restore all the key equivalents and syntax coloring that I am accustomed to.
Leaving the question 'alive' in case it happens to someone else.

Xcode Code Completion "flicker"

I've recently upgraded from Xcode 4.3 to 4.4 and I'm about to bash my screen in with frustration.
The problem I'm having is with the code completion. As I type a variable or method name, the completion window pops up with the suggestions like it's supposed to. But if I attempt to use the cursor keys to scroll between the suggestions, the suggestions disappear and the cursor moves in the code, not between the suggestions. If I press enter to accept the default suggestion, it again dismisses the suggestions and inserts a return into the code taking the cursor to the next line.
This doesn't happen every time I attempt code completion, but it does occur more often than not. For a given name I'm trying to complete, it either works or it doesn't (e.g. if I press escape to get the suggestions back, it will disappear just as quickly as the first time it disappeared for that line/name I was trying to complete). When I get to the next line of code, it's a whole new bet whether it will work or not. It seems that the closer to the actual completion of the name I am, the more likely it is to actually work and accept the suggestion or move between the suggestions. Sometimes, if I act quickly enough, I can move the highlighted suggestion one or two lines before the suggestions disappear. I'm aware that if you don't select a suggestion quickly enough that it's supposed to eventually remove the suggestions (on the order of several seconds), but this behavior is not what I'm describing. I'd be VERY happy at this point if I had a single second to actually respond and select a suggestion from the pop-up.
So far I've tried a clean of the project, deleting all of the project's derived data, and restarting xcode. All of which don't seem to affect the behavior. Any ideas? I've searched stackoverflow and google and haven't found any other people reporting this problem ...
Thanks for any ideas,
Will
UPDATE:
After upgrading to the XCode 4.6 release version (and 4.5 somewhere in the middle there), this problem is still present ... and making edits in the left/main editor window is still a work-around.
I am seeing the same with Xcode 4.4.1. It seems to be related to where the completion window pops up. Debugger pane open or closed does not change anything here.
When in the Assistant Editor trying in the right pane the completion windows flickers. Same line of code in the left window works fine. Single editor works, too.
Try upgrading to Xcode 4.4.1. I used to have this problem, but I don't seem to have it after upgrading.
If this doesn't solve the problem, a crude workaround seems to be to put a lot of blank lines at the bottom of each file - the problem seems to occur from frequently when the file is scrolled all the way to the bottom.
There is a fix (at least Xcode 4.6.3): re-create the affected file by deleting it. Now create a new file and copy the content to it and drag it into the project - done. Fixes the issue here. It seems to be tied to certain files.

How can you go forward/backward at the file level with Xcode 3.2?

Xcode 3.2 has implemented cursor-level history for the "Go Forward", "Go Backward" commands. Previously these worked at the file level, so you could navigate back and forth through recent files you've been editing. Now they navigate at a more fine-grained level, through the places within files where you have been editing.
The downside to this is if you navigate backwards through the files and make a minor edit, all of your forward history is wiped out, whereas in the past it used to be easy to return to the file you were working on. It also means issuing a lot more commands if you just want to move through files, since you have to skip through all the edit points within each file.
I can't find anything in the release notes or documentation about this new behavior, so does anyone know if it's possible to get the old 'go back/forward by file' commands in 3.2? If not, does anyone have any tips on other ways of easily navigating recent files in Xcode?
Hold down the option key while you click the forward/backward arrows at the top of the code view, this will use the Xcode 3.0 behavior and go back a file at a time.
I had the same question as well and and Rob's answer on holding Option while clicking the forward/backward arrows works well.
I needed a keyboard shortcut though and I've found that Shift-Option-Cmd-left/right works.
From the comments on this blog entry:
Hold down the Option key to get the old file-based Go Forward/Go Back behavior. We rarely change established behavior like this when adding new options, but in this case, the majority of users considered file-level navigation Broken and location-based navigation Correct, based on their experience in browsers and other IDEs. We chose to give what more people considered the “obvious” behavior the pride of place on the keyboard shortcut, but the old way is still there.
-- Chris Espinosa
But like you guys have said, after every keyboard edit, the forward file history is lost. This is incredibly frustrating to me, as this is a feature I have heavily relied on for years, which is now broken. Is there still no fix?
There are Next File and Previous File commands, however their history is also wiped out after an edit. That seems like a bug to me.
This is plain stupid! What's the reason for suddenly change this ? Shift-Option-Cmd-left/right... great, more stupid shortcuts from Apple. I guess I soon have to use Shift-Option-Cmd-Left-Alt-Enter-N for something I use all the time. Can't they just implement a recent file list on ctrl-tab or something, like the Cmd-tab and the app switcher. Why would I want to grab for the mouse when I'm coding ? Still I have to use it lots in Xcode.
Sorry for my rant :)

Resources