xcode 8 delete old objects - core-data

for a few minutes i had an second version of my core data:
this entry isn't available and i would like to delete it.
but i didn't find a way to do this? how can i delete this old unavailable object?

I suspect the reason your have the scenario is that you have 'Add a Model Version' in Editor and some how hit cmd+delete on the model in the master folder in Finder. You still have original version 'CoreData.xcdatamodel' in your master folder. Here is the how you can clean up the Project Navigation.
1) In Xcode Project Navigator, Right click *.xcdatamodeld and hit 'Delete'.
2) Still in Xcode, put mouse over either project name or group name ( first create a new group under your project. e.g 'model'), then right click and select 'Add Files to "ProjectName"...
3) A Finder window will open. Navigate to your *.xcdatamodeld, select and click 'Add'
4) Now you should get back *.xcdatamodeld file in Xcode Project Navigator clean without red V2 model.

Related

No Android facet found, issues compiling with Android Studio 0.2

So, following the advice on this SO post (sorry, I would comment there expect I don't have enough reputation)
Gradle: FAILURE: Could not determine which tasks to execute
I removed the tags from my .iml files, which allows me to compile. But when I go to run the .apk on a device, I get the error
"Error running TestProject: No Android facet found for TestProject"
Can someone help please, just want to get back to writing Android apps!
Add an android facet to your module by following below steps.
1) Go To File Menu -> Project Structure, or press (Ctrl+Alt+Shift+S) shortcut to open "Project Structure".
2) Select "Facets" which is under the "Project Settings" tab. (First column)
3) Click on "+" button which is at the top of the Second Column to add new facets.
4) Select "Android" facet from that "Add "menu which will prompt another dialog box to select a module. (Select a module to which you want to apply this facet).
5) Select your module and that's it. :)
Hope this will solve your problem.
At the toolbar left of the run and debug button there is a drop down. Select your project main activiy.
In my case, it helped to just go to "Edit Configurations..." and delete the current configuration. Then I just created a new one with the default options.

How to create new res folder in Android Studio

I want to add localized strings for my android app. Therefore I need a values-xx folder in my Res folder.
The original values folder has a blue dot, so I tried creating a new Package, but a package can't contain a hyphen so this must be wrong. Instead I tried right-clicking res and choosing New -> Android resource directory, but this time nothing happens. No dialog or reaction of any sort as I can see.
How do I create a values-xx folder?
Edit: I can create the folder from file explorer and it all works good. It is just irritating to not be able to do it from inside Android Studio.
Edit2: This bug is fixed in newer versions of Android Studio.
When you are in the Android view (rather than Project or Packages) in Android studio, you just need to right click the "values" directory and choose New > "Values resource file".
That gives you a chose of different resources you can add. For example, if you want to add a different language to your app you can choose the Language option and press the ">>" button. If you want Swahili then select that from the list, type "strings" for the file name, and press OK.
Android Studio will automatically create a values-sw directory with the new strings.xml file in it. And in your Android file view you conveniently see both strings files together.
And it is a similar process for adding other types of resources (see my other example). You no longer have to manually add the directories (but you can do that too by right clicking the res directory and choosing New > Android resource directory).
I had the same problem, what I did was create a values-xx folder inside the main directory (main>>right click>>new>>directory) and then moved that folder to res/ directory.
It's not beautiful but it is a workaround to create a folder with Android studio.
This bug is fixed in newer versions of Android Studio.
The values-xx folder we created is not showing, but when we create a file its asking
=>I have created values-21 folder and then tried with creating an xml and it asks for choosing a directory
=>I have updated to Android 1.02
Check the values-21
Lets assume i Want to create a folder named "Daylight" under res.
Step 1:
Right click on res.
Step 2:
Then go to New.
Step 3:
Then go to Folder.
Step 4:
Then go to Res Folder Option and select.
A window will be open.
Step 5:
At that window check the unchecked box "Change Folder Location"
and as assumed we have to create folder "Daylight"
Step 6:
SO name the newly created folder as daylight, in this format. src/main/res/Daylight
Step 7:
Then, Finally Click finish.
If you have already created a new directory but just don't see it in the Project Tools window. Do this
Click on Project Tools window >> Android(Drop Down) >> Click Project.
Now you'll see all your Directories in res. See the picture:
Its very simple. I too had trouble initially.
Lets break it stepwise:-
1) Open your project
2) Right click the res folder
3) Choose New
4) Chose Directory
5) Name the directory.
Thats it!! It works for a fresh project everytime!
For those finding this answer when trying to add a new res folder to a library.
Right-click java/kotlin folder > New > Folder > Res Folder

How to create new project in Android Studio?

I want to create new project in Android Studio.
But There is error message.
There must not already be a project at this location
But There is empty folder at 'this location'
You have to delete the empty folder.
What the error message should say is "There must not already be a folder at this location". The location you specify for the new project must not already exist, because the new project wizard wants to create the folder itself. This makes the whole idea of selecting a folder using the "..." button pointless, you can't select an already-existing folder for the project. It must be a non-existing folder in the "Project location".
I've just spent quite a long and frustrating time figuring this out.
EDIT: Disregard that, it made a project in the default dir, not the place I specified :(
I had the same problem.
The only way I could do it, is to delete projects at the default location (so when I go into Create new Project dialog it won't show me this crap right away). Then enter all the settings for my project and at the very end just paste the path to new project location right into the path field (not select it with their folder picker) and then hit Next.
It's very important to paste path and hit next at very end, so studio won't have time to validate entered path (it will, if you'll try to change some other fields)

Completely Delete Xcode project and all references?

Every time I try to delete my project, and create a new one under the previous name that i deleted, the icons and references are still there. I can't seem to fully delete it then start again with the same name. Any help is appreciated.
Using: Xcode 4
Close the project then delete it with Finder. Open Xcode's Organizer window (Cmd-Shift-2) and click the Projects tab. Find and delete the project from that list. Close the organizer than try creating your project again.
Also, file a bug report at http://bugreport.apple.com - this shouldn't be necessary but I have seen it before (in 4.0 betas).
A solution for Xcode 6:
(You can skip steps 2 and 4 if you just want Xcode to forget the project, but don't want to remove the actual project files.)
Go to Window ▸ Projects.
In the list on the left, secondary-click on the project you want to delete, and select "Reveal in Finder".
Go back to Xcode and secondary-click again on the project in the Projects sub-window, and this time select "Remove from Projects...". This will remove the project from Xcode, but won't delete the actual project files.
Go to the Finder window that opened in step 2 and move the project folder to trash.
Also, to get rid of the unwanted projects when you control-select on Xcode in docks:
1) Follow Joshua's instructions above
2) Quit xCode
3) Control-click on "show recents"
Now only the projects you have left will show up.
In Xcode 4.3, close the project, close Xcode, then use finder to delete the project folder. Next time you launch Xcode the project should be gone.

How to add an external project to Xcode 4?

I am stuck with an issue of including an project in Xcode 4. I have all the document but it works with Xcode 3 and not Xcode 4.
How to add ZXingWidget.xcodeproj to my project in Xcode 4?
In Xcode 4, you're mostly meant to create a new Workspace to which you can add multiple projects. From the main menu: File > New... > New Workspace...
Once you create your new workspace, drag the Xcode project files into the project navigator of the newly-created workspace. Drop the first one anywhere in the project navigator pane but be careful to note the insertion pointer when you drop the second one. Advice: Drop it beneath the entire first project but with your pointer as close to the left edge of the project navigator panel as you can get. This makes sure you're not inserting a project into another project.
In this way, you get all the benefits of a workspace (automatic dependencies, etc.) without changing the structure of the projects themselves. Then you simply open the workspace rather than the individual projects within it.
Despite that this question had been asked months ago, here is a great resource directly answering it. It worked flawlessly for me (even though I had ARC turned on for the main project I was importing it into).

Resources