Changing the folder name in Xcode - ios

Is it possible to change the name of target ? For example, as shown in image, "Wonder Cars" to "Anything Else"?

Yeah you can change the name of the Target by doing the following Steps...
Select the new target in the TARGETS list. Press Enter to edit the text and put a more appropriate name.
Next, go to “Manage Schemes…”, select the new scheme you created in step 1 and press “Enter”. Make the scheme name the same as the new target name (which is the one you choose for the new target.)

Click on your project (in your image, the "AccessBox" entry in the list). You might need to open the left sidebar in the project settings: you have a kind of "tab bar" with entries like "General", "Capabilities", "Info", etc. On the the left side of this bar is an icon that like a square with a thick line at the left side. If you click that, a list of your targets appears.
In that list, simply click on a target, then click it a second time like you do in Finder to rename a file.

Please try with below step -
Click on your target and create new scheme from old one .
Or
You may go to Manage Scheme and create duplicate one from old target

Select the folder you want to rename
Right click on it to show a quick menu, and select "Show in Finder"
Rename the folder name as you want (select the folder, press return).
After renaming, the reference in Xcode will looks like deleted in red color. Select that folder again, CmdDelete to remove the reference ("Remove Reference", not "Move to Trash"). Then press OptCmda to add back your renamed folder there again.
Btw, #shruti's solution below
You mean to say you want to change the name of the group. click it once then click it again but not too fast give a little gap between two clicks or click it once then in the file inspector you can change the name
will only rename it in Xcode, but the real folder name won't be changed.

Related

red group name color

Xcode shows group name with red color.
How to remove this or make it normal
I am using Xcode 9
Basically this problem occurs when folder miss match with original path
Step 1 Select red folder/group
Step 2 Select file inspector from right panel of Xcode and click Folder icon
Step 3 Choose correct path and enjoy...
Use Below Steps:-
In Xcode Right click on Feed -> Show in Finder -> Copy all content
In Xcode Right click on Feed -> Delete -> Move to Trash
Go in Show in Finder where you have to create folder -> Create folder with name Feed -> Paste copied content -> Drag Feed folder to Xcode.

What to do if you accidentally remove the reference to a file in Xcode?

In the middle of coding an app, I wanted to delete a button. What I did not realize was that I was actually selected main.storyboard. When I pressed backspace to delete main.storyboard I pressed "Remove reference". At this point I tried command + z, but ,unfortunately, main.storyboard did not come back.I tried to run the app but I kept getting signal SIGABRT.
My question here is if you accidentally remove the reference to a file is there any way of recovering it?
Only "Remove reference", the file is disappearing only from Xcode and remaining in your real folder. Try to add Main.storyboard again from Xcode file navigator like this.
If you have accidentally removed the reference of a file in your Xcode project (such as main.storyboard or app.delegate) go find the file you removed the reference of in finder. Then drag and drop the file into where all of your files are located in xcode (on the left).
Similarly, if you have trash a file, go into your trash and just drag and drop the project back into xcode.
Hopefully this helps

How to change the Build name in Xcode? (Image to show what I mean is down below)

So I downloaded a open source Xcode project and now I am modifying it a lot and want it to be in my name but in Xcode I see these two names how do I change these 2 names?
Here is an image to show clear view what I mean:
https://imgur.com/30TjFw1
On the Xcode, where is the your app hierarchy, make a long double click just like you rename a folder, and rename!
Hope this helps!

Copy image in to xcode

I had an image in my project which I removed (remove references) due to not needing it.
It transpires that I actually do need it, however now when I try to copy it back I get the following error - even though the image is not in my images folder any more - how is this fixed?
Thanks
Open the folder (in Finder) that your app is contained in. A shortcut is to right click on an object and choose "Show in finder". Once you're in the folder, hunt around for an image named "962-puzzle-piece#2x.png". When you find it, delete it (drag it to the trash).
When you 'remove references', Xcode leaves the image in the project folder, and simply doesn't show it to you. Then when you try to add an image of the same name, it fails because there's already an image by that name in the folder Xcode tries to add it to.
You can avoid this entirely by selecting "Move to Trash" in this dialog when you delete things:
Right click on the folder -> Show in finder.
Then drag the real file to the trash.

Images not showing on iPhone device

(Xcode6, Build for iOS7.1, iPhone 4S, Swift)
Images are showing in the simulator, but not on the device. I've been fiddling and hacking away, trying to find the magic formula, but no luck. Here are my efforts to date:
Filename: abc#2x.png, abc.png.
Dragging an imageview onto storyboard and specifying file name via "image" drop-down menu in "Attributes Inspector."
All characters in file names are lower case.
Dragged and dropped files into images.xcassets folder
Verified that images.xcassets the "Copy Bundle Resources" section in "Build Settings"
No luck. Deleted files. Re-added using the "+" button at the lower left, and selected "Add files to myProject"
Checked "Copy items if needed."
Checked "Create Groups"
Verified that files were in the "Copy Bundle Resources" section in "Build Settings"
No luck. Deleted files
Re-added using the "+" button at the lower left, and selected "Add files to myProject"
Checked "Copy items if needed."
Selected "Create Folder References" radio button
Verified that files were in the "Copy Bundle Resources" section in "Build Settings"
No luck. Deleted files
Went into the GIMP and changed file format to .jpg
Repeated steps above with the .jpg file.
Dragged new imageview into the view controller, and set the image for this container using the drop-down menu.
Still no luck
Deleted app from phone several times to allow for a clean install.
Still no luck.
Project -> "Clean"
Project -> "Build"
Restarted Xcode
Still no luck.
Any ideas?
If anyone needs me, just look for the guy banging his head on his desk. :/
Your image is taking some other image reference also, Change the image name with any another name then you try with latest one.
abc.png to a.png
abc#2x.png to a#2x.png
I am sure it will solve your problem.
I got it working, albeit not the way that I wanted it to. I dispensed with the storyboard approach, and just set the background with code.
For posterity:
I. In storyBoard, delete the reference to the image in the Attributes Inspector. There must be some bug in there. It's not working, and it will break the code below.
II. Create an IBOutlet from the Image View to your controller. You have to do that wire ctrl+drag and hold thing. You should end up with something like this:
#IBOutlet var cheese : UIImageView = nil
III. In your viewDidLoad() routine, set the image programmatically, like so:
override func viewDidLoad() {
super.viewDidLoad()
self.cheese.image = UIImage(named: "cabotClothbound.jpg")
}
Of course, you have to make sure that all the stuff in the original question is done: make sure that your case is consistent, be certain that the files are added to your build, etc.
The .jpg file which was dragged n' dropped into the Images.xcassets is the one that worked.
I had the same issue but solved it. The image (in fact, icon) shouldn't be in the Reosurces.bundle, but in the Assets.xcassets.

Resources