How to toggle between .h and .m in Xcode 4 - objective-c

Just installed Xcode 4 so far so good, except that Apple changed all the keyboard shortcuts! Anyone know how to toggle between .h and .m?

Apple changed all sorts of shortcuts, but to switch between header and implementation, the new shortcut is,
⌃ + ⌘ + ↑/↓
You can change it back to the previous ⌥ + ⌘ + ↑/↓ in Preferences > Key Bindings.
Look for the Jump to Next Counterpart and Jump to Previous Counterpart commands.
If you are working on a big screen, you could use the Assistant layout's split view, and have the .h and .m files side by side.

Hither be the Grand Unified Gigantic Sheet of Xcode 4 Keybindings.
Download it.
Preview it.
Print it.
Read it.
Know it.
Use it.
Be it.

You can also use the 3 finger swipe up or down gesture on a trackpad.

The commands we're looking for are in the Navigate menu bar item.
Jump to Next Counterpart
and
Jump to Previous Counterpart
Once you have the menu item names, these can be assigned to any keyboard shortcut.

Related

Custom Menu for Mac Catalyst App in Obj-C

Can anyone help with an example on how to configure the menu for a catalyst app in Objective-C. The main intend is to get rid of most of the menu items.
Select your Main.storyboard for your project. Near the upper right hand corner, there is a + button to add objects from library, click that button and search for Main Menu then add it to your Main.storyboard. From there you should be able to select items and delete the unwanted ones. I believe you won't be able to remove the Application menu.

Adding a toolbar button to Finder.app programmatically (macOS)

I am looking for a way to add several toolbar buttons to Finder, which, when clicked, perform certain actions.
My research shows that injecting code into Finder process is impossible on latest versions of macOS due to SIP, yet this would be the most seamless way for the user.
There is a possibility to add a toolbar item by creating a Finder Sync extension. However there are 2 problems:
There can be only one toolbar button per extension (I need several buttons)
The toolbar button will have a dropdown arrow (see an image below). I do not need to show a menu, however, and therefore this arrow makes the button misleading. It must be a simple plain button that matches the current system theme and performs an action upon click.
So this is what I don't need (because of the drop down arrow):
Update:
One of the ways to add a button, is drag and drop an .app bundle, holding Command key.
This approach has the following problems:
This button wouldn't match the other toolbar buttons look&feel, as the icon for such button is taken from the .app bundle (so it wouldn't switch based on macOS light/dark theme, for example)
It is impossible to add several toolbar buttons like that (as there needs to be one .app per 1 button). However, I need multiple buttons.
I am wondering if FinderSync allows creating "normal" (non menu) buttons
Is there a way to add a regular button to Finder's toolbar?
Please check out my Finder buttons:
https://github.com/lexrus/LTFinderButtons
Basically, I made every task a button app.
I'm trying Finder Sync Extension to do the same thing. All issues you found are true. Furthermore, there's problem #3:
You can not submit an app with Finder Sync Extension to the App Store.

Docked view of breakpoints in IntelliJ IDEA

I am trying to get a permanent view of breakpoints (or at least lasting until I remove it) docked next to the Debugger panel. E.g. I would like it to take place of Watches, since I do not use watches much. Currently, viewing breakpoints is done by clicking the small double circle icon in the Debugger but that pops a new large window that occupies most of the screen. I would like a small and permanent view of breakpoints (just like the one in Eclipse).
If you open up the Favorites tool window (Alt+2) you will see the breakpoints.
You cannot put this window inside the Debug tool window but you can have it docked above or beneath (or anywhere you want).
Like this:
Or like this:
The last image shows the Debug window docked with the Split Mode Off while the Favorites window has Split Mode On
CTRL + SHIFT + F8 works for me
IDEA 2017.1.3 allows breakpoints to be edited (e.g enabled/disabled) from the Favourites window (right click, Edit breakpoint).

Xcode 4.1 multi-touch gestures changed

Just upgraded to Xcode 4.1 (and Lion).
Does anyone know what the gesture is for 'Jump to Next Counterpart' (or a reference for the gestures)? It switches between the header and implementation file.
It was the 3-finger swipe up / down, but now the OS is using that gesture.
The accelerator keys are Control+Command + up arrow (from the Navigate menu).
It's 2-finger swipe left and right. In your .h file, swipe 2 FINGERS LEFT to go to the .m. In your .m file, swipe 2 FINGERS RIGHT to go to the .h.
(Really strange update indeed)
Swapping to counterpart is now performed using a four-finger swipe either upwards or downwards. As before it seems to just oscillate between the two files. Hope this helps...
It seems that the four finger gesture to change between the header and implementation file only works on a Magic trackpad

Animating Tab Bar page switching

I'm quite confused with the whole animation stuff in iPhone SDK. I tried to study throught the SDK documentation, this website or tried googling it out without success.
I'm unable to get my scenario work.
I have single XIB file, with tab bar and a 4 tabs.
In a special event i want to switch from one page to another "in code", so I call eg: [tabController selectedIndex: 0].
I need this transition to be animated. Is there a way?
If user switches tabs manually, no animated transitions are needed
Also I have one subquestion:
In one of the tabs I have a UITableView with set of items. When user clicks any of these items, another set of items are beign shown (sort of hierarchy browser)
I tried to animate this transition using -deleteRowsAtIndexPaths:withRowAnimation: and -insertRowsAtIndexPaths:withRowAnimation:, but without luck.
Desired transition is shifting the old items set to the left side and the new items from the right side.
This is first time of my iPhone development, when I got lost even with all the forums and documentation. :)
Thanks in advance to anyone trying to help me!
As for your first question: Yes you can.
Try this link for some answer:
transition on tab bar sample code.
In short words: you should add a delegate object to handle the tab bar switching by setting the tabBarController.delegate = self.
Yet, what this forum post won't tell you is that you need to "import" some framework to do it.
First - right-click on the framework folder on the left hand list in Xcode and add an existing framework named: "QuartzCore.framework".
Than - add these lines to your tab bar holder (on .h file):
#import <QuartzCore/CAAnimation.h>
#import <QuartzCore/CAMediaTimingFunction.h>
As for your second question, try to replace the datasource (array or what ever) or create login function on the cell to replace its content.
Enjoy!
First Question: No, you can't animate tab switching. Please read Apple's Human Interface Guidelines on this. Tabs are meant to switch instantly. An animated transition would break the "tab" paradigm.
Second Question: When you tap on a row, the user does not expect other rows to disappear and new ones to appear. Instead, this sounds like a case for a UINavigationController. Please refer to Apple's sample code, specifically the UICatalog for sample code on how to implement this.