Can I set the Utilities panel in Xcode 4 to open by default on all new projects? - ios

I'm currently learning iOS development from scratch, and as such, I'm making lots of new projects. Every time I do so, I have to resize the Xcode window (I don't want it maximised, but I don't want it as tiny as it makes it), and I also have to pop open the Utilies and Debug areas, as well as dragging the Objects library up to make it larger. Can I set some defaults in Xcode to do this for every new project?

No, Xcode doesn't include all these options, but you can get part way there. You can setup a behavior that shows or hides the parts of an Xcode window such as the utilities, the toolbar, the debugger, etc. Then it's one menu selection or key command to show the parts, and a little dragging to resize things.
To make a behavior select Behaviors>Edit Behaviors... from the "Xcode" menu in Xcode. Create a new behavior by clicking the "+" symbol near the lower left corner. Give your behavior a name and optionally a key command. Set the options in the behavior to show or hide the parts you want shown or hidden, and maybe even take some of the other available actions.
To run the behavior just select it from the "Behaviors" submenu of the "Xcode" menu, or press the appropriate key command combination.

Related

How to edit storyboard in Xcode

Every now and then, I see tutorials allowing to add components to a storyboard by clicking a plus sign on the right up corner of the editor:
Bu I do not have this button. And it seems that there is no menu available.
I have to say that I'm trying to modify the storyboard outside of any project by opening the file alone.
Any help appreciated.
The plus button should be available on the right side of Project Header Section[Tool Bar] as Shown in the image
Based on the selected file different screens will be opened when we click on the + button.
We can also use the keyboard shortcut cmd+shift+L
Verified on Xcode Version 14.1 (14B47b)
Update:
As this option is available on the Toolbar, it may not be available if the toolbar itself is hidden. To toggle the visibility of toolbar we can use the shortcut cmd+option+T

Assistant editor(Xcode 7.3) always showing interface file in storyboard , even when I choose manually

Even after deleting derived data many times, and trying other things, I am still facing this problem. Can you help me?
You can try using the shortcut key instead, to open up the assistant editor.
Shortcut key: -
option + click on the file which you want to open up in the assistant editor
Guys I just stop dealing with this problem by changing the settings in xcode 9.2. And now i use Navigation Pane.
Here is how it works :
Ok now if you go to xcode -> preferences -> navigation
and Choose the "Uses Focused Editor" as in the picture below.
Now you can manually select inside the Navigation Pane.
Just click whichever page you would like to change and select in the Navigation Pane.
Here is a few screenshots :
Pictures shows code files but it works with everything you can click in the Navigation Pane.
Try to drag and drop file from the Project Navigator into the path of the Assistant Editor as temporary fix.
You also can click on this icon to bring recent files.
Try to clean your project, clean Build Folder, restart Xcode.
Make sure the view controller in your Storyboard has correct custom class name.
I think I know the problem you're having. I experience it too, but it's intermittent. Sometimes clicking Manual shows me the entire project folder and I can select the editable classes, but other times it only shows the interface versions of them, which aren't editable and cannot have IBOutlets dragged to them (you can tell b/c it'll say internal class and has less code). I have noticed that if I toggle back and forth between Automatic and Manual, I can usually get the editable class to appear. I also will toggle the assistant editor off, select a different View Controller or two on the storyboard, then go back to my original one, turn the Assistant Editor back on, and it starts working again.
There are other discussions of it here, here, and here. This suggestion of turning off indexing sounds intriguing and worth a try if the problem keeps reappearing. UPDATE: This trick with hitting the + and opening a 2nd file, then closing the interface file, worked great when I tried it just now.
Here are pics of how the Automatic side shows the actual file when the Manual side only shows the interface, which says internal next to class:

How to restore/clear form position after multi-monitor setup change

Within the IDE, when F12 toggles between code and form,
the forms are displayed outside the monitor borders,
and therefore not visible.
This happens after a multi monitor setup has changed,
and the forms no longer open within the available new monitor screen areas.
One way to resolve this is to use the property inspector and
set the Top/Left properties to 4 to make the forms visible.
This is however a lot of work,
especially if many forms and possibly many projects are involved.
Is there a better way to reset the form locations once and for all,
so they are all visible with the new monitor setup?
There is nothing (AFAIK) in Delphi 6 IDE that would help. But assuming you are using Windows, the help is near, (tested on Windows 7):
Right-click on taskbar and select 'Cascade windows', this affects all windows in one go.
or
Alt-Tab to the window, press Alt-Space and then M (for move). Move the window with the arrow keys. This you would have to do seperately for each window.
Close your Delphi IDE. Then, if your current project group file is xyz.groupproj, open the file xyz.dsk with an text editor. Look for section [UndockedDesigner] entry "Count" and change its value to zero.
[UndockedDesigner]
Count=0
That will force all design window positions to 0,0 on your main monitor.

How to localize images in iOS if they are set up in a storyboard?

I know how to localize storyboard elements like label, buttons etc. However, I faced a problem where I need to localize the images that were setup in a storyboard in the attribute inspector for the Image View.
Is there a way to localize those without setting those images up in the code, in the viewDidLoad method and calling setImage:[UIImage imageNamed: NSLocalizedString(...)]; ?
Any kind of help is highly appreciated!
I guess I figured it out...maybe not the ideal way of doing it but works for me...
Open image folder in your Project Navigator (panel).
When you click one of the images, on the right (Inspector panel) you'll see the button "Localize".
Clicking on that button gives you a pop-up asking if you want it to be the base (in my case I say yes).
So now in the inspector there're check boxes: Base, language 1, language 2 etc (language n - is the languages you added to your project in the localization settings).
So now if you put a check mark into one of the language check boxes, your image file will have a drop down arrow showing that it has some content inside. If you click that, you'll see how it expands showing the localized files with the name of the language in the () brackets.
However, at this point those files are all the same as the base. So now you need to substitute the base files with the localized ones.
If you right click on the file that needs to be localized, say myImage.png(German), open it in Finder, and replace that file with the right one. Important! The name of the file should stay the same!
I'll post the screenshots later, so it's all clear how to do it.
Using Xcode 9.2
you can achieve it easily like the following
1- From Assets
2- Then you will need to change the Direction option AND CHOOSE BOTH
xcode will allow you to add 3 more image for other language resource
3- add your needed image and use it in story board or from code as well

how to find references to a method in xcode 5

I am reading through a very large and complex ios app project, I want to find the places in the code when a certain function (or method) is called.
I've seen some answers for older xcodes where you can filter your search results to only show you references. But I dont see this option in xcode 5.
so possibly 2 questions:
1- is there a way to enable these search options?
2- are there any other ways to search for all references to a method (or any symbol).
If you click the search icon and the click where it says "In workspace". It should bring across a menu that will allow you to select specific groups and folders. You can also create a "new scope" to use for searching more complex rules.
In Xcode 6, you can open the Find Navigator (⌘-3) then where it says Find > Text > Containing, these items are clickable and you can change it to Find > References > Containing.
Alternatively, with your cursor inside a method you can click the icon in the top left corner of the editor (it looks like four squares) and choose Callers.

Resources