In Xcode 3 I used the menu at the top of my editing window to navigate between methods (and other things), which was useful because it was alphabetized. In XCode 4 (the jump bar, I think it's called) is no longer alphabetized.
I didn't see a preference to make it so... is there one?
I suppose the thinking is that you don't need it, since there is a class navigator at the left (left for me, anyway) that shows the methods alphabetized.
Except that only classes in my Classes group show up here. I have lots of classes in a dozen or so other groups, and I don't want to just toss everything into one group.
Any way to get classes in my other groups to show up?
I did notice that when I show ALL classes, they do show up under NSObject, but that navigator is much too cluttered to be useful.
The answer, from the Jump Bar help page:
"Tip: Hold down the Command key when selecting a level in the path menu to view its items alphabetically."
Related
Is there any way to get back Object groups in library of Xcode 5 just like it was in Xcode 4.
I don’t think so. However, you can click the little grid/list button at the bottom left to show the library as a grid. If you can recognize the icons, and don’t need the text labels, it makes it much quicker to scroll through the list. (This does not work well for snippets, because they all have the same icon.)
I've been frustrated lately with the fact that when stopped at a breakpoint in XCode 5's debugger, the list of variables for a class does not show all the ones in the class. For instance, SplitViewController only shows UIViewController as its only contents.
I've noticed however if in the console I type "po self.myVariable." (notice the . it ends with) then an autocomplete dialog pops up with a complete listing of all variables, including ones inherited from parent classes... exactly what I'm looking for, but hard to read since you can only see about 5 of these at a time in the tiny non-resizable pop-up window.
Is there a setting somewhere that I can enable to make all these values show up in the class list XCode shows on the left? (The ones where you expand classes by clicking the triangle.)
In the lower left corner of the debug panel there is a multi-choice selector that controls the variables displayed when stopped. The default state is "Auto", which I think tends to mean recently modified, and probably what yours would be set to. You can change it to "Local Variables" or "All Variables, Globals, Registers, and Statics".
Does Xcode have a way to show the caller function of a method? I want to know all of the calling functions of a method in a class. A solution would be to find the method in the project, but sometimes different classes have methods with the same name - That could find us a method we're not looking for..
Many other IDEs have this capability, such as Visual C++ 2003/2005/2008,Eclipse ...
Can you do this in XCode?
Xcode 4.4 intrudced this functionality:
New Features in Xcode 4.4 (Scroll down to 'Find and Search Additions')
Move your cursor on top of the function you are interested in
Open the Assistant editor(⌃ +⌘+Enter)
On the top of the assistant editor, Select 'Callers'
You will see a list of all the function that's calling your function
Not the as effective as other IDEs, but does the job.
Yes. Set a breakpoint inside your method, then when it breaks, there are two spots to see a stack. First is in Xcode's "console" area (usually the bottom middle), there is a top-bar which may not immediately appear to be navigable, but it is a select-style UI control which has the entire stack in it. Selecting a different level shows you that scope's variables, etc. and pops your editor to that exact file (where you can mouse-over variables to see their in-memory real-time values). Second is in the left-hand area (where you normally browse files). There is another tab there (besides the file browser) for exactly this purpose. There is a slider at the bottom which controls how many "steps" in the stack you see; clicking on one has a similar affect.
For simple refactoring such as method re-naming, you can use the contextual-menu when you right-click a selected method-name, and Xcode will replace all identical selectors in your project. However, this does not address what you mentioned about different classes having methods with the same signature. It does, however, give you a very nice interface for reviewing the changes in-context and easily accepting or rejecting them one at a time.
It might be noted, however, that changing method signatures often may be a sign of poor design, and particularly if you have to do it with methods which have the same signature on different classes (which are not "siblings" and therefore should both get the rename)
Every once in a while I try to add a new data model version, and the menu item is missing. It seems the Editor menu is supposed to change depending on the file selected, and this sometimes doesn't happen. It the past I've randomly clicked, cleaned, built, etc. and eventually it showed up again with me not knowing what happened. Today it seems restarting Xcode fixed it, but I don't know if that will always work. Below are two screen shots, the first showing the wrong menu, and the second showing the correct menu. My data model is selected in both cases. Has anyone else seen this? Is it a bug, or is there some setting or selection I'm missing?
From the color of that file navigator bar I can see that you did not select the datamodel file. You probably were in "Assistant Editor"-Mode and had a .h or .m file on the right side. The active cursor was in the right file too.
The selected file shows a darker shade of gray:
The not selected file uses a lighter shade of gray:
It's important to know that the file selection highlight in the left side bar does not change when you select a different file without using the side bar. Don't trust the sidebar when you are editing files.
Click into the data model file first and your menu will be like you expect it.
Unless your are selecting the menu super fast after selecting the file (possibly not giving Xcode time to swap it out) then I say file a bug report http://bugreporter.apple.com
You should give Xcode a few moments to swap the menu out though to determine what kind of bug it is, if it doesn't swap out after 60 seconds or so then it likely isn't just a performance issue). Make sure to include a system profile as I just checked on my and every time I switched to a data model it changed the menu accordingly.
Does the same thing ever happen with xib files? Any other file types you use that sometimes have different menus?
Doing some restructuring on the my applications menu bar. When looking at other applications, there seems to be two different ways of structure.
Either the "old school" most common way, the verb/command followed by the subject. I.e. what do you want to do and what do you want to do that on. Like so:
File
New
Foo
Bar
Open
Foo
Bar
Quit
Or the one that new applications sometimes try, probably since Microsoft introduced its ribbon structure. I.e. what do you want to work with and what operation do you want to execute on that. Like so:
File
Quit
Foo
New
Open
Bar
New
Open
Are these two paradigms established? Do they have a name? Would help me in referring to them and their differences.
Yes, menus at the top level may be organized by the class of object they act on (e.g., Foos or Bars), or the type of action they carry out (e.g., filing actions). As a general rule, the menu bar or Ribbon at the top of the window should be organized by action type in order to provide the user with an alternative way to find a command to the context (right-click) menus that are necessarily organized by object class.
That said, many menu hierarchies, including the “old school” one, would benefit from being “flattened” –from being made broader at each level and less deep. Deep hierarchies mean cascade menus, which are slow and awkward to use. Few options at the top level mean general vague labels that provide very little information scent (what does File really mean anyway?).
There are several ways to fix this while still organizing the menu bar by action type. First, there’s the simple flattening of the old school File menu, much like Firefox does:
File
New Foo
New Bar
Open Foo
Open Bar
Quit
The problem is that the traditional File menu was intended for “document” applications that operate on only one principal object class. For example word processors operate on papers, spreadsheet programs operate on worksheets, image editors work on pictures, and so on. File becomes unwieldy when there are multiple principal classes. Two classes isn’t a problem, but three or more is.
In some cases, it’s best to take the “suite” approach and make it look like you’ve a separate program for each object class. Take object class selection out of your menu bar and put it in the Start menu, where you’ve installed shortcuts corresponding to each object class that open a primary window for that class. Each of these “applications” only has New and Open acting on only its class:
File
New
Open
Quit
In a sense, you’ve made broader the menu above your menu bar in the hierarchy. This is entirely consistent with other desktop apps. It’s an attractive option if users tend to work with only one class for a session. Frequent trips to the Start menu gets old.
If you need to keep everything in your menu bar, you can spread the File menu out along the menu bar.
File
Save
Print
Quit
New
Foo
Bar
Open
Foo
Bar
Many apps with multiple principal classes are database apps where each window shows multiple objects (database records). What the user is “opening” is not a single file but a query result. Typically, the user almost never has use for a blank window. Even for data entry, it’s often helpful and rarely hurtful to show the results of a default query in order to provide some context (e.g., records entered last time). If the user wants to add a new record to those already shown, it’s an action under Edit, not File. So we can eliminate New.
Program
Foos
Bars
Quit
File
Query
Close
I suggest you take a cue from Mac OSX and have a Program menu for Quit (in OSX the name of the application is the menu caption). The Program menu has menu items labeled by their object class, but they’re actions –they open the Foo and Bar windows respectively. You either fill these windows with a default query result (which could be empty), or automatically show the query dialog for the user to select one. The Query menu item under File pops up this dialog to allow the user to change the query for the window at any time. This dialog may include an Empty option for edge cases where users need an empty window.
I think it's more personal preference. What do you think would go best? If you're not implementing the ribbon GUI into your app then there's no need to copy their structure.
Personally I'd go with the first option - "old school", I find it more straightforward and the most pragmatic approach toward the problem.