Xcode/iPhone Development 6 months in - Annoyances - iphone

I've been iPhone programming for 6 months and come from a PC/Java/Eclipse background and still have a few annoyances with Xcode/iPhone programming I wonder are there any shortcuts to.
Is there any way to prevent multiple windows opening all the time in XCode?
a) When you click on the Errors/Warnings in the bottom right of the status bar build errors are shown in separate window. Any way to get these to show in the main editor?
b) Anyway to get debugger to appear in main editor.
I have a big screen iMac and it's still window hell on Macs.
When you come from Alt-Tab the Mac is a nightmare.
2) Anyway to get a toolbar item on the main editor to:
a) Open Console (I know CMD-thingy-R)
b) Open Break points (you have to open Debugger first then breakpoints)
I know there's keyboard shortcuts but I have only left hand free others on the trackball so any keys on right hand side of keyboard are too far.
I know you can add Finder toolbar scripts (just wondering if anyway to extend Xcode).
Are there utilities to extend Xcode? Scripts/Automator/Any Services I can setup to help.
Can you automate Xcode like you can with Windows/ActiveX/VBA
3) Limit lookups using CMD + double click.
If I double click on a variable to find its definition using CMD + double click it shows every occurrence of all variables with that name. (annoying it you name all you maps mapView)
Anyway to get it to limit to the current class or at least order so current class is first.
4) Find doesn't seem to loop backwards if result all above cursor position
I'm in a class and I hit CMD + F for find.
Find box appears.
I enter some text hit return.
It says I have x matches but only back arrow is highlight in Find
But when I hit < it does nothing.
I need to scroll to the top and redo the search.
If the text is both forwards and backwards then both < > are highlighted and it works.
is this a bug or a 'feature'
Missing Eclipse features
I have been looking at the User Script menu but was wondering how powerful they are?
5) any scripts around to generate source from members such as description: #property #synthesize
if I add a new member, run a script will generate #property/#syntesize and release in dealloc
7) any good sites for scripts?
SCM
Im having problems with SCM and Folders on HD under project Classes directory.
You get a library e.g. JSON. It usually comes as a folder. You copy it to the /Classes for your project. /Classes/JSON
I create a Group for the Library in Xcode under Classes group.
Classes
JSON
I drag the files from the folder into xcode into the JSON Group.
I add them to the SCM and icon changes from ? to A
but if I try and commit them it say folder /JSON is not under SCM.
Can you drag a folder into Xcode so that it AND its files get included in SCM?
Anyway to stop Xcode Help from being on top all the time.
I keep feeling like punching it and telling it to get out of the way! :)
I dont mind it open just not in the way once I've finished.
Yes I know I can Ctrl-W
Sites: the main site I use to learn Obj-C are :
stackoverflow.com
Google code Search - tonnes of full apps on here
http://www.iphonedevsdk.com/forum/iphone-sdk-development/
Apple Developers Forums (anyway to get RSS feed to these or is that blasphemy :) )
Safari - 100s of IT book though prob too many to keep up :)
any others?
Any site that gives simple examples for Obj-C/ UIKit
The docs just show the methods but actual examples (Google code search has helped a lot here)

--> 1):
In Xcode -> Preferences -> General, select "All-In-One" for the Layout.
I was used to have only one window and found this mode much better than the default.

Generating #property and #synthesize code.

Related

Visual Studio Code - Tabs (editors) of the same project in multiple screens

Using multiple screens I normally place multiple classes (files) in different screens, this helps me a lot while refactoring, checking tests and comparing changes.
Visual Studio Code does not allow me to drag a tab outside the window and view it in (for example) another monitor.
I checked the documentation and plugins, but the only way I found, is to open two windows, pointing to the same project (folder) and put those in different screens.
I don't like this solution, that causes also some problem when I watch code changes using TypeScript.
Any suggestion?
I use Windows 10, latest version of VSCode.
A solution is to press CTRL+K and after releasing CTRL, press O.
This will open the current file in a new window.
There are few things I don't like about this solution:
- Drag and Drop does not work
- Create a new instance of VS Code resulting in (for me) 180MB of ram used
- To open the file it takes to me few seconds (quite slow)
- The file remains open in the original window as well
Update 20/03/2019:
There is a feature request you can track here:
https://github.com/Microsoft/vscode/issues/10121
And an explanation about why this is difficult to implement here:
https://github.com/Microsoft/vscode/issues/10121#issuecomment-345770248
Update 20/03/2019:
Another important side effect highlighted by #Mär is that:
the IntelliSense fails to establish references it had when the file
was opened in the window, where the entire project is opened
The easy way but with the same drawbacks. More ram and resources will be used. Is to wrap your project in a folder.
It's the best possible thing. As by now!
=> Duplicate the workspace.
Open the command pannel ctrl+shift+p or F1.
Then write dupl
You'll get that
That's it.
More
If you want to add more folder to the working space.
=> go to File then Add Folder To Workspace
You can add as many as you like.
 Also better more
You can open a new window (ex: ctrl+n)
And then go File > Add Folder To Workspace.
And start adding folders to your new Workspace. You can add any folder, that is already open or not. That's too way great. You can have all the needed folders for example in the second screen.
A little hack I used is to just stretch the editor window to fill both screens and split the view pane between the monitors such that both screens show just one open file.
This is a cheap hack that works without opening multiple instances of VSC.
It may not be the proper solution, but it works without eating up all my system memory.
I found the following way to work on multiple monitors (important: they must be the same size and resolution):
open a visual studio in windowed mode on the 1st monitor (in my case it is a left monitor)
move the window to the (left) top corner
stretch window to the 2nd monitor (right) bottom corner
split screen by clicking “split editor” several times
move the code sections separator to the edge between the monitors
This is old qestion, but such way can be useful for someone. It is not very convenient, but it works. The solution may have already appeared in the VS itself, but I didn't find it.
Visual Studio Code does not allow me to drag a tab outside the window and view it in (for example) another monitor
Actually, VSCode 1.57 (May 2021, 4 years later) will propose something close:
Improved editor drag and drop across windows
Support for dragging editors to other windows was improved in this release. You can now drag diff editors, custom editors and the entire editor group to another window to open the editors there.
My solution was to use Remote-ssh to connect to self and open in another window. This does take extra resources. But I find this comfortable as I don't need to create additional workspace.
For me on Ubuntu the solution was to create a project folder symlink and ope it in a new window (as it won't open the same folder in another window)

Configuring IntelliJ workspace views

Newb alert: moving from Eclipse to IntelliJ
I think what I want is "simple", but looking at menus, help and doc hasn't found it. (I did visit their help and website links; I'm probably not looking for the right thing.)
For my main code editing experience, I like to have 3 main window panes:
Right side, large main area: source code editor
Left, upper part: project files in a browsable outline
Left, lower part: structural view of the current class I'm editing (method names, member fields, etc)
For IntelliJ, I can get the Project Structure on the left, OR the Structure of the individual class, but I'm having trouble getting the left half of the screen to show both the Project and Class hierarchy.
I've tried to dragging and dropping, like from Eclipse, but that doesn't seem to work the say it did in that other IDE. (not arguing that it should, just something to try)
I think there are some general concepts that I might be missing. And when I use IntelliJ help or Google for things "view", etc, I'm getting some other meaning of the word.
General questions:
How do it (or CAN I?) generally arrange the IntelliJ IDE to look the
way I like? I'm happy to do some reading, but haven't seen this in
the table of contents.
Is it done by clicking and dragging?
Or maybe it's that IntelliJ just uses different verbiage to describe these IDE elements, and if you now the correct language, then maybe Google
promptly brings up the answer?
Any other Eclipse -> IntelliJ IDE config advice would also be welcome.
This is really easy to achieve. Instead of dragging the title bar of your panel, drag the button that opens the panel (see my screenshot). You can fully customize your view but dragging those buttons to either of the 4 panels (right, down, left up and left down).
Since you're asking for more advice on migrating, here's my approach to learn IntelliJ shortcuts as an Eclipse user. It's my blog, so if it is seen as advertising, I will remove it.

(Xcode 6) - Code completion not work (UIKit, Foundation...)

I need help with Xcode 6.
It only happens with the project I'm working with. For the other one, code suggestion works.
What's wrong with my project?
The answer was to delete ~/Library/Developer/Xcode/DerivedData/ModuleCache (while Xcode is closed)
I have been researching the same issue on StackOverflow and here are what most threads suggest: delete Derived Data folder files (or maybe just the files relevant to your troublesome project!). It worked for me hence this answer. Details below:
Fix manually by deleting all the files in ~/Library/Developer/Xcode/DerivedData
Note: If Library folder is new to you, follow this CultOfMac article:
Library access on.
Open a Finder window and then navigate to the Home folder. That’s the one represented by the cute little house icon over in the sidebar. If you don’t see it, click on something like the Desktop or Documents folder, and then Command-click on the title bar of the window. You’ll get a drop-down menu that shows the file path of the current folder, which–if you’ve picked a folder from your Home directory–will show the Home folder somewhere in the list. Click on it to go to the Home folder.
Now, once you’re there, hit Command-J to bring up the View Options panel. You’ll see a checkbox to “Show Library Folder” somewhere in that panel, depending on the view your Finder window is in. Simply check it to show your User account’s Library folder. Now you can go in there and mess around to your heart’s content.
Note: Some StackOverflow members suggested pressing 'Escape' key or Command and + keys after the dot (.), others suggested typing a white space (control+space bar). However, your post seems to suggest it's project-specific (works for the other project) so it may prove useful to try different approaches. Hope this helps.
Swift files will NOT have code completion for UI classes (e.g. UIImage, UIDevice) unless there is an "import UIKit" at the top of the file.

how to remove google sign in button in eclipse

I'm facing a wierd problem. My eclipse, has a google signin button which is occupying some of the space which I do not want to happen. Initially it had "Sign-in to Google" text along with it. I've followed some blog post and set accordingly to show just the icon (I don't remember that blog post link).
But now, the icon is getting replicating .. it is being shown 12 times. It is actually creating childs :P
I've gone through all the options present in Customize Perspective menu, none of them had this button listed. Can someone help me in removing that google sign button from my perspective? One possible suspect is- my eclipse crashes when I suspend and wakeup my machine.
You can use the Window > Reset Perspective... menu command to reset the perspective to its default state, which might eliminate that toolbar and buttons. If that fails, I would create a new workspace and import the projects into it using File > Import > Existing Projects into Workspace.
If you want to try to salvage your existing workspace, it's possible to do so my manually editing Eclipse's internal file that stores your Workbench layout, but it's a bit tricky. Here are the steps I've followed to eliminate a similar repeated toolbar item:
Exit Eclipse.
Find the Workbench layout file, it's path is <workbench>\.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi. Make a backup of this file before you touch it - this is essential because it's easy to corrupt the file if you change the wrong things.
Open the file in your favorite XML-aware editor - most packages of Eclipse include the XML editor that works just fine1, but be aware that if you use Eclipse to edit the file you can't have Eclipse open on the workspace that contains the workbench.xmi you want to edit.
Find the section of <trimBars> nodes in the XML; from there you have to determine which <trimBars> node you need to edit. In your case it looks like a vertical one, probably with a side="Right" attribute.
Under the correct <trimBars> node you'll find multiple <chlidren> nodes, each with an elementId attribute that should help you identify it; you're looking for <children> nodes that are identified as something related to the Google plugin.
Delete the <children> nodes that seem related to the unwanted toolbar buttons. In your case, it appears that there is an entire toolbar that you might want to eliminate, so you might want to delete the entire containing <trimBars> node.
Save the file and start Eclipse on that workspace.
1Some packages of Eclipse include EMF tools that will open it in a special XMI editor that does not provide a view of the source, only a structural tree view. Depending on how you like to work with XML, this might be easier than editing raw XML.
This is not a perspective but a view. You can hover over that bar with the buttons and click Alt+Shift+F1 to check where this View comes from. Then you can either disable/uninstall the contributing feature (Help -> Installation Details) or check where the feature came from.
If it comes from the IDE, you can open a bug for it. If it is contributed from a third party plugin, contact the developers of that plugin.
There is an eclipse bug concerning duplicate view toolbar buttons in Luna that has recently closed as well. Maybe this solves your problem as well.
Edit: Taken from this bug:
root cause is that in Luna 4.4M5 WorkbenchWindowControlContribution.createControl is called twice, the
first time with a null value for
WorkbenchWindowControlContribution.getWorkbenchWindow() while it is
still being created. This is related to what has been reported here
https://bugs.eclipse.org/bugs/show_bug.cgi?id=427452
second cause is that my createControl(Composite parent) method was calling PlatformUI.getWorkbench().getActiveWorkbenchWindow() instead
of WorkbenchWindowControlContribution.getWorkbenchWindow(). This
resulted in an attempt to create a new Workbench Window, which
recursively calls createControl() again. This has already been
reported here https://bugs.eclipse.org/bugs/show_bug.cgi?id=366708

How can I close an empty pane in Eclipse

I often end up with lots of empty panes in Eclipse that can only be minimized but not destroyed. How do I close these?
Update:
In this screenshot you can see two minimized on the upper left and several on the right hand side. In the center are four more. They only seem to be restorable in the Debug mode.
http://img406.imageshack.us/img406/9900/eclipse1.png
this happened to me, too. What worked for me (based on FilmJ and douncon's comments) was to open a class file, then drag that tab over the top of the empty pane.
Select Window -> Reset Perspective. That should reset the current perspective (what you call "mode") to its' initial state, (hopefully) closing all irrelevant views.
Something seems terribly wrong with your Eclipse. Maybe you should reinstall it. It is possible that you installed a buggy plugin.
First of all, what do you mean by pane? Eclipse has:
Windows (Eclipse itself, e.g. instance)
Documents (tabs)
Views (properties, tasks, explorer, etc)
If by 'pane' you mean document editors, you have problems either with your Eclipse version or most likely one of the installed plugins.
Each View also can be closed (except maybe some project types (perspectives) of which I'm not aware). For CDT (C/C++) you can close practically everything.
I'll recommend you download latest Eclipse version with no plugins, extract it to different folder, and check if that happens again. If yes, please explain more in details (like Eclipse version, perspective you are using, any side plugins, etc).
Also a good places are Eclipse community forum, mailing list and bugz :-)
I had the same problem. For me it helped to go into the right perspective and activate the functionality that caused the window in the first place. Once I reactivated the functionality, in my case "QNX Memory Analysis perspective", I was able to close all the windows one by one.
The conclusion is you have to refill the empty windows with content and then you will be able to close them properly.
So, it's really very easy for this to happen, if you open an editor that's incompatible with the existing editor, you can often end up having to place it outside of the tab list in one of your editor panes, then you might clear or copy that, typically while trying to add that view to a tab list.
In any case, what it's done is create a new editor, and all you need to do is drag some file to that empty editor window giving it some form of context, then close it.
I had the same issue. I followed #zvikico, but instead of just resetting, I first reset and then closed all the perspectives. Please follow the following to fix the problem. It worked for me:
Window -> Perspective -> Reset perspective..
After resetting follow below:
Window -> Perspective -> Close All Perspectives