I can create snapshot in Xcode 6 this way as shown in below image:
But in Xcode 7 its not available and you can see that in below Image:
And control-command-S also doesn't work.
Can anybody tell me now how can I create a snapshot using Xcode 7?
I opened a bug regarding this. According to Apple, "Snapshots have been removed in Xcode 7. You can export existing snapshots in Xcode 7 but not create or restore them."
Hopefully they'll restore them in a future release, but for now I recommend using git from the Source Control menu as suggested by Tim.
there isn't snapshot in xcode 7, to resolve this problem, use xcode 6 and 7, xcode 6 to create and restore snapshot and after you can open your project with xcode 7.
For posterity - in the menu at the top select "SourceControl" then "Commit...", add a comment and "Commit X Files" then after you make additional changes and want to see the changes select "SourceControl" and "Commit" and select the file on the left.
All explained nicely in :
http://www.raywenderlich.com/51351/how-to-use-git-source-control-with-xcode-in-ios-7
Related
I am learning Objective-C and using this tutorial. It says I am supposed to create a Command Line Tool. However, the XCode version in the tutorial is rather old. Pressing CMD + N does not reveal a Command Line Tool option. How can I write Objective-C and compile and run it in XCode 9.2?
Have a look #Stophface
If you are on mac then it says you should press cmd+shift+N
try it
You have chosen the iOS category at the top, click on macOS and it should be there.
this question is several months old, but for other people here is an answer :
You need to download an additional element : "Command line tools for Xcode"
link : https://developer.apple.com/download/more/
You need to create a free account, just with your email.
There are several versions, check which version of Xcode you have. Once it's installed if you click on "new project" you will have access to "command line" options
Using Xcode 6 GM seed my code completion has stopped working. It was working the other day. I was trying to get the unwind segue work around to work. I had made an Objc header file and assigned it as a header for a Swift class.
At this point I get code completion with an Objective-c project. But, not with a Swift project.
I have tried restarting Xcode, making a new empty project.
Just go in user->Library->Developer->Xcode->DerivedData and delete the Data of folder(Derived data) and restart Xcode.
This fix from apple dev forums works for me. I have had autocomplete issues with Xcode 6.1/Yosemite.
Quit Xcode.
Restart the computer (this is to clear any in-memory caches).
Delete the contents of the DerivedData folder (~/Library/Developer/Xcode/DerivedData), precisely run, a) cd ~/Library/Developer/Xcode/DerivedData/
b) rm -rf *
(Try this if Steps 1-3 dont really work as it rebuilds the cache later on restart which takes time) Delete the contents of folder ~/Library/Caches/com.apple.dt.Xcode, i.e., a) cd ~/Library/Caches/com.apple.dt.Xcode b) rm -rf *
Now launch Xcode once more…
I experienced a serious breakdown of code completion because I had some 'notes' after the #end statement of my .m file which were as follows:
/*
NSAlertFirstButtonReturn, NSAlertSecondButtonReturn, NSAlertThirdButtonReturn
*/
These lines can appear before the #end statement without destroying code completion.
There's an easier way to delete the Derived Data from within Xcode (no need to open finder or restart):
Xcode Organizer -> Projects -> (Your Project) -> Delete Derived Data
I just recently had this problem. Autocomplete did not work ...and when i typed for example tableView.... it did not give me the different functions available.
I tried the following and it worked for me.
Xcode Organizer -> Projects -> (Your Project) -> Delete Derived Data
delete the file ~/Library/Developer/Xcode/DerivedData/ModuleCache
Restart xcode
Hope this works
Another possible reason why it isn't working is because it's not part of the target membership. To fix this, select the file you're working on. Then, go to the File Inspector and in the Target Membership section, make sure your project is checked.
Try the following - as silly as it may sound:
Change Device to iPhone 6, close Xcode, Reopen Xcode and wait for the indexing to finish.
Go to Xcode menu, then Window -> Organizer, then select Projects. Pick your project and press on delete button beside dervied data
Then restart Xcode
That solution worked with me on Xcode 6.1
If your code completion problem is only with UI classes (e.g. UIImage, UIDevice), then you just need to add "import UIKit".
Swift files will NOT have code completion for UI classes unless there is an "import UIKit".
I had the same issue but under different circumstances,
I have 2 projects in my workspace
Swift framework for iOS and OSX
iOS Project (which uses the swift framework)
My code completion works fine in iOS but it keeps failing in the swift framework. I tried all the about solution and had no luck and was killing my productivity.
Finally i figured out the solution to this problem.
Select the file you are editing (in the framework )
Select the 'utilities' tab on the right
uncheck the Mac target (just keep the target you are working for
currently)
Thats it, this solved my problem.
hope it helps someone who is in this kinda situation.
user/Library/Developer/Xcode/DerivedData Delete all the files shown in this folder. after that go to your project name and clean project then come back to the file where you wanna see suggestions. Type any word and its done.
So all you have to do is make sure, in the file inspector view on the right side, under Target Membership, the first box is checked. I'm not sure why this changes things but I'm sure someone can come along and give a more complete answer.
In my case Some File(s) were deleted in File System but were still referenced in the Project i.e. in Red Color. Just delete those from Project and everything was fine. Code Completion started working.
Also Like to point that all the above answers about Clearing/Deleting Derived Data folder seems to work momentarily but whenever there was a new pull or update the problem started again, so the root cause was the unreferenced/moved/deleted files which show up as RED in the project, they needs to be manually cleared.
Initially I thought it was Apple's fault. My Xcode 5 dp crashes every time when I tried to type any code.
Launch Terminal
cd ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/
cd ~/Library/Developer/Xcode/Third-Party\ Plug-ins/
Rename/Delete your Plug-ins one by one until XCode 5 works.
In Xcode 5 go to Preferences > Source Control > Uncheck the Enable Source control
This problem has something to do with auto completion. I remembered I installed a plugin KSImageNamed. It will auto complete your image name when typing -[UIImage imageNamed:]. And most importantly, I saw its name in crash report.
Solution: Go to ~/Library/Application Support/Developer/Shared/Xcode and delete KSImageNamed.xcplugin.
Great Post. For my case, it is another type of xcode plugin name called "lin" which will do the similar thing. After the plugin is moved to trash, works fine.
Additionally you should also remove any plug-ins that are located at ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/
If all fails, you might have to uninstall Xcode
I had same problem. If you go to XCode -> Preferences -> Source Control and turn OFF Source Control everything works like a charm and there are no more crashes!!! :) Hope this help ;)
In my case the problem was in user defined code snippets, located at ~/Library/Developer/Xcode/UserData/CodeSnippets. Two different snippets had same Completion Shortcut.
First, I have xcode 3.4.3 installed on my hackintosh(10.6.5). When I started using xcode , I follow apple's steps from "Your First Mac App" tutorial. When I walked through creating actions for controls, it ask me to use the assistant editor to create connections between control and logic code, but I can't find anything called assistant editor is this because I am using xcode 3.4.3?
Could somebody please tell me some alternatives.
//edit: The assistant editor seems only present at xcode 4 and higher, so the tutorial you are using is newer than you current xcode version. Thanks #popeye for the hint.
The alternative is simply add the connections by yourself. You have to add the outlets in the interface-file (h-file) and the implemenations in the implementation-file (m-file).
There is a good tutorial video fromon how to achieve this:
Xcode 3 Recipes - Connecting an Outlet
Old Post:
The mentioned "assistant editor" is just a neat way to connect your outlets with your code. It connects the GUI with the code. For example if you have a button on your screen and you want to register a touch event on that than you can simply use the assistent editor to do that.
It is on the upper right corner of xcode. See the screenshot:
It shows you a split view with the code on one side and the Storyboard on the other. If you have that view open you can simply hold the control-key and drag a connection from the gui element to the code.
From the apple website: Assistant (): presents a separate editor pane with content logically related to that in the standard editor pane. Use the split controls in the Assistant pane to split the pane. Use View > Assistant Layout to set your preferred assistant pane and split configuration.
Apple iOS Developer Library - xCode Basics
I think you might be out of luck. I do not remember having an assistant editor in XCode 3, not like the version in XCode 4 anyway. Apple tends to keep it docs relevant to the newest release. The link provided by #palme is only relevant for XCode 4.
You might have be resigned to opening multiple windows to compare header and implementation files. In XCode 3, you will have to get used to mutiple windows at times, even seperate applciations (i.e. Interface Builder is completely seperate application from XCode 3).
I installed Xcode 4 and now cannot run one of my iPhone projects.
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all
Waiting for process 'AppName' to launch.
On the top status bar I see 'Attaching to AppName'.
The only weird thing about the project is it has a dependency on ZXingWidget for QR code scans.
Weirder that it works on a co-workers computer, but not mine.
Tried removing my build directory, no dice.
I can run other iPhone projects from source in Xcode 4 with no problem.
Has anyone else seen this?
I ran into the same issue. Go to Product -> Edit Scheme and select the Run scheme on the lefthand side. Go to the info tab, and next to launch there will be two options (neither of them selected): 'Automatically' and 'Wait for XXXX.app to Launch'. Select the Automatically one and it should clear up your issue.
I had actually built and used my projects using xcode 4 for a few days with no issues, and then this popped up randomly. Hope the this helps.
A tip I found at the Apple Developer Forums:
Go into your ProjectName.xcodeproj/
directory and delete anything named
with your userid. Re-open the
project in xcode and all that will get
recreated and it should work. At least
it did for me.
Another tip is to manually delete the build directory.
Yet another tip is to navigate to the Organizer (Shift ⇧ Command ⌘ 2 in xcode 4), select Projects, select you application in the left hand side and then the Delete...-button to the right of Derived Data.
And never forget the universally useful tip: restart your computer and try again.
Good luck!
Yes, you need to set it to automatic but doing that alone won't be enough. Like Chris says, you will need to exit your simulator manually and then run.
for me it was already set on automatic and still had this problem.
The problem solved after I changed the build configuration to Distribution in the product -> scheme
Quit Xcode. Find the App_Name.xcodeproj, "Show Package Contents" and remove the folder "xcuserdata".
This will clean the "cache" of breakpoints. Start Xcode, compile and done :)
You may be click the bottom of Product>scheme>edit scheme >Waitting for executable to be launched.And you should click the Automatically choose.