XCode 4 Running the Leaks Instrument - instruments

This might be a silly question.
How do I run an application with an Instrument in XCode 4 such as Leaks?
I do not see the option like I have in the past, and I have looked around, and either I missed it somewhere, or it is right in front of my face.
Thanks

Click and hold on the run button, and choose the profile option.
You can also edit the profile scheme to make it use debug builds when profiling. To do this, go to edit scheme by click on the dropdown next to the stop button:
Then select profile item on the sidebar, then make sure 'Build configuration' is set to debug.

as jeff said, that is 1 way you could do it.. other way with keyboard shortcuts is press cmd + I and this runs the profiler and after that you can choose leaks...

Related

Xcode 8.3.2 keeps on building after every keystroke

Whenever I try to change anything in my source files, the Xcode builds the entire project.
And since, I am in between writing the code, its obvious that there are errors (like "NSLog(#"ABC")") will throw an error if written halfway like this "NSL").
If I leave it idle, it fails for 5 to 10 times more and finally I see build succeeded. And again, when I try to change anything, it rebuilds on every keystroke and fails.
I have tried unchecking, "show live issues", "continue building after errors". Even a deep clean (command+shift+alt+k). After cleaning, its ok, but when I rebuild again, the same nut job building process continues.
This issue is not related to IBDesignables also. I have tried to uncheck "Automatically refresh views" in the storyboard and it did not work.
Any help?
Looks like, I can't open my storyboard as a different window, not even in a new tab. I used to have one of my windows for the source code and one for storyboard only. This made the switch between storyboard and source code much faster. But may be because of IBDesignables, its not possible anymore.
The problem is partially solved. Even if I open my storyboard now, it shows the same behavior of rebuilding again and again. But atleast, I can write my code in peace now with only source code files open in different tabs/windows.

Xcode 6 Code Sense stops working after build

So this same problem exists for a long time apparently. I checked all the xcode 4 code sense problems and used their solution and it works. Right up untill I build the file to run and then code sense stops working. I Really dont want to keep deleting the file in organizer and restarting xcode everytime. Is there a simpler method to fix this.
The first thing I always do when I lose Code Sense is to clean the project. If that doesn't work I use Watchdog to clean it. Watchdog deletes the derived data for the project like you can do in Organizer but it allows you to set up a handy keyboard shortcut which saves a ton of time now that Organizer doesn't have a keyboard shortcut.

xcode 6 assistant editor Automatic results will not display

I can not drag anything to the code from the storyboard. Files were in assistant editor under automatic but now there gone how do i get them back other then deleting and recreating them? Opening them up under manual it will come up but Xcode can't find the referance when dragging to the code and i get the error when naming it.
I don't know if anyone else is still having this issue, but I get it a few times a week on Xcode 6.1.1 and I usually do the following to fix it (once I have checked that there are no class name mismatches):
Clean build
Delete Derived Data (using Organiser)
Force Quit Xcode
Re-open and Build
I know this is crazy, but it continues to work for me o_O
The most common cause is a mismatch between your class name and the name registered in the identity tab of the view controller. This will happen if you for example rename your class but don't update the classname in the storyboard.
To set/check the class name, open the storyboard and click on the leftmost icon in the titlebar of your UIViewController. Then open the identity inspector in the utility pane (right side) and double check the name given as the custom class.
The issue is due to not completion of indexing - so there are few alternatives, that you can try for-
Way 01 : Check if indexing is showing in processes - then let it complete. Then, close the editor and reopen it
Way 02 : Just perform the clean action. It will start showing appropriate Viewcontrollers.
Way 03 : This is the most effective way - Just perform "Build" and then restart editor - it will surely going to work.
I had the same problem, and I managed to solve it by selecting the correct Target on the File Inspector of both files (Swift and XIB in my case, you can check the file inspector in the storyboard).
It can happen if your project has a lot of targets (mine had a few, the file was checked on the wrong one).
You'll want to turn XCode indexing 'on' and set the Assistant editor to “Automatic”. This helped in my situation when the other suggested answers didn't. Details on turning on indexing at Stopping xcode from indexing
I just deleted build folder completely.And it works for me!

Text cursor in xcode isn't typing. blinking rectangle instead of a blinking line

I'm using Xcode on a system that belonged to a former employe and I can't type. There's a weird rectangle text cursor blinking and a blank line at the bottom that responds to my key types in a weird manner. If I press a key the text cursor will just get smaller. There's also the location path of the file I'm currently on, I'd also like that to be removed. Thanks
added numbers in red next to each problem.
I suspect your former employee might have customized Xcode or, more possibly, customized the Macintosh to be non-vanilla (maybe it's a Text Input Entry setting or some internationalization or some third party extension or preference pane).
Try doing this: go to the "Text Editing" preferences within Xcode and toggle a few things to see if you have better luck. If that doesn't work, create a new user on the Macintosh and then launch and run Xcode from that new user account.
XVim.xcplugin <-- that was the file causing all of this. After deletion and relunch everything is back to normal. You can find more information about it here: https://github.com/WarWithinMe/xVim
This issue is composed by XVim.xcpluginxc. By deleting this we get free from this issue. For this issue. Please follow these steps.
1.Open the terminal.
2.Type "find ~/ XVim.xcpluginxc". This will list your entire system with this particular file/folder name.
3.From that list copy that particular path having this folder.
4.Type "rm -Rf path that you copied earlier".
5.Press "Enter".
6.type "exit".
Finally close the Terminal & Restart the Xcode.

Cannot set the compiler flags in Xcode 4.3.3

I am trying to set compiler flags to disable arc for some of the files and i am not getting the dialog box when i double click or press enter on one of the files. It happens in a new project and old where i already set the compiler flags before. All it does just becomes gray after i press enter and looses focus. Is any one else having same issue or could i be doing something wrong.
Thanks!
I figured it out. I think its because i am using Macbook Pro with retina with resolution set to more text. When i enabled assistant editor in Xcode and pressed enter to change the compiler flag the dialog box came out on the other side top right corner almost not seen. Hopefully the next version of Xcode will support retina display.
I still couldn't see the dialog box but did it blind-fully.
Copied "-fno-objc-arc" and then in Xcode, Enter -> CMD+V -> Enter... the magic was done. :)
Thanks all!
I'm posting this in case someone stumbles across this answer when having the same problem on XCode 5 and none of the above solutions work, as happened with me.
In my case the problem was some kind of corruption of the workspace data. The problem was solved by deleting the xcshareddata/ xcuserdata/ and project.xcworkspace/ directories inside the project directory.
From a terminal:
cd <project_name>.xcodeproj
rm -rf xcshareddata/ xcuserdata/ project.xcworkspace/
Then restart XCode and the problem should go away.
And additionally if you're on a macbook pro without an enter key (the return key wont bring up the compiler flag box) and desperately are trying to flag multiple files at once... you just have to hit shift + fn + return. Just fn + return wont work - at least for me.

Resources