does assistant editor in xcode 3.4.3 has an alternative? - objective-c

First, I have xcode 3.4.3 installed on my hackintosh(10.6.5). When I started using xcode , I follow apple's steps from "Your First Mac App" tutorial. When I walked through creating actions for controls, it ask me to use the assistant editor to create connections between control and logic code, but I can't find anything called assistant editor is this because I am using xcode 3.4.3?
Could somebody please tell me some alternatives.

//edit: The assistant editor seems only present at xcode 4 and higher, so the tutorial you are using is newer than you current xcode version. Thanks #popeye for the hint.
The alternative is simply add the connections by yourself. You have to add the outlets in the interface-file (h-file) and the implemenations in the implementation-file (m-file).
There is a good tutorial video fromon how to achieve this:
Xcode 3 Recipes - Connecting an Outlet
Old Post:
The mentioned "assistant editor" is just a neat way to connect your outlets with your code. It connects the GUI with the code. For example if you have a button on your screen and you want to register a touch event on that than you can simply use the assistent editor to do that.
It is on the upper right corner of xcode. See the screenshot:
It shows you a split view with the code on one side and the Storyboard on the other. If you have that view open you can simply hold the control-key and drag a connection from the gui element to the code.
From the apple website: Assistant (): presents a separate editor pane with content logically related to that in the standard editor pane. Use the split controls in the Assistant pane to split the pane. Use View > Assistant Layout to set your preferred assistant pane and split configuration.
Apple iOS Developer Library - xCode Basics

I think you might be out of luck. I do not remember having an assistant editor in XCode 3, not like the version in XCode 4 anyway. Apple tends to keep it docs relevant to the newest release. The link provided by #palme is only relevant for XCode 4.
You might have be resigned to opening multiple windows to compare header and implementation files. In XCode 3, you will have to get used to mutiple windows at times, even seperate applciations (i.e. Interface Builder is completely seperate application from XCode 3).

Related

Open Text in App

I am looking for a way to right click selected text and open it in my app. Eg. via OS X's third party share menu. But I can not find any references at Apple's.
Have a look at the apple docs SysServices for creating a service for you app.
The Docs take you through an example of how to set one up.
Once done you will need to go into System Preferences and Enable the service. Your users will also need to do that.
Here is a quick project that shows an adaption of the apple code.
Update:
Although I think the services work good enough. Creating a Share or Action Extension is possible.
This example uses the same Project as above. But I have added an App Action extension (Target) to it.
The template for the Action is not too hard to understand and it took me 5 minutes to do this quick example.
(So I am not saying everything is as it should be but it works)
For the Action Extension:
Follow the instructions here
Which basically is:
After you choose the extension point that makes sense for your app
extension, add a new target to your containing app. The easiest way to
add an app extension target is to use an Xcode template that provides
a target preconfigured for your extension point.
To add a new target to your Xcode app project, choose File > New >
Target. In the sidebar on the left side of the new target dialog,
choose Application Extension for iOS or OS X. In the pane on the right
side of the dialog, Xcode displays the templates you can choose
Do read the above docs to understand better of what you need to do.
Once you have added the Extension. You can actually run it straight away.
Xcode provides you an option to choose a test app to test it in i.e TextEdit.app and takes you through the whole process of temporarily enabling the Extension.
In this example, remember I chose an Action Extension which suited the App.
The App's function in life is to do a basic encryption of selected text and then display the result.
The App's Action Extension will do the same but instead of displaying it, it will replace the selected text with the encryption text.
All that was needed for me to do, was copy the encryption method from the main app, over to the Extension.
I did have to adjust a couple of things though. Namely the original code deals with a NSString, where as the Extension deals with a NSAttributedString.
The conversion I did works but styling attributes are lost. For this example that does not really matter.
An Action Extension does not use the Share contextual menu. It uses an Action menu.
To see the menu, select some text and the hover the cursor over the selected text. You then should see a discloser button on the left of the text.
Like this:
Click it and choose the Extension.
If you do not see it, go to the 'more' option. This will take you to the system preferences where you can grant access to the extension.
The documentation is mainly concerned about distributing the extension and App via the App store.
But you can code sign your App and extension and do a normal archive export.
From there, all should work ok with gatekeeper.
But again refer to the Docs for a fuller understanding.
Here is a link for the code signed app and also the new Project.
Encrypto2

Short cut in Xcode to switch between help and IDE

I'm new to the XCode IDE, Mac and IOS programming. Means that I'll swap a lot between help and editor. However when using Cmd+Tab I'll not swap between help and IDE but between other open apps.
Does anyone know a short cut to switch between IDE and help?
OPT+Cmd+? will bring the help in XCode (the shortcut is mentioned if you go to the help section)
use 1. in combination with CMD+' to scroll through all open projects / windows within XCode.
You can have a look to this page: it refers all XCode shortcuts and gesture.
The default shortcut to open the Organizer is Cmd+Shift+2, which you can edit in the Preferences of Xcode if you want.
There is also a shortcut which will directly bring you to the Documentation tab: Cmd+Alt+?.
Additionally, you can set a shortcut to switch between the windows of the active app in System Preferences → Keyboard → Keyboard Shortcuts. The default is Cmd+< but I prefer Alt+Tab.
Command-Option-Shift-/ (a.k.a. Command-Option-?) will bring up the documentation window.
Also, you can cycle between windows within an application with Command-` (works in any application). You can use that to switch easily between a project window and other open windows, including the documentation window.
Command-Tab cycles between applications, not windows.
Note that the keyboard shortcut for a given menu command will be displayed in the menu along with the command (this is true for any application):
If you are on Mountain Lion (not sure if it works on earlier versions), you can also use the 4 finger scroll (Mission Control shortcut) if you prefer. With the Organizer (help) open, use 4 fingers and swipe upwards to reveal mission control. On top you'll see virtual desktops. Drag and drop your Organizer/help window onto the second desktop. Now you can flick right or left with 4 fingers on your trackpad to switch between code view and help. I know this sounds complicated but once you get used to it, it becomes second nature. But yeah Cmd + ~ is good too.

How do I add an action or outlet to a class in Xcode 4.3.1?

I'm following a slightly outdated the guide from cocoalab.com (Become An Xcoder) to learn the basics of cocoa, but I'm stuck on one of the instructions.
On page 45 (section 08:9) in the section titled "Creating connections", it tells me to select the instance of my new class, and from the identity inspector, to add two actions and an outlet.
I'm using Xcode 4.3.1 which is obviously a bit different to the version that this tutorial was written for, but I can't figure out how to do the equivalent in this newer version.
Can anyone please help by giving me step by step instructions of how to add these to my object.
Open the Assistant Editor (red rectangle in the screenshot). Then, from Interface Builder, press the ctrl key and drag the mouse from the button (or an other control in you view) to the .h file.
You will be prompted to choose the type of the connection to create as in the screenshot below:
I would suggest to follow the nice and easy tutorial on developer.apple.com - search for "Your First iOS App".
This explains how to add an outlet, and an action - all using the latest version of XCode. Won't take you long to do, but will get you up to speed with all the features you need.
Hope this helps :)

How do I implement a static library from libPusher in Objective-C (Xcode 4.2)?

Please show me how I can add and implement the libPusher library to my Objective-C iOS project
This is my first post on StackOverflow
I've just started working in Objective-C iOS app development for a company that I co-founded with a couple of colleagues. Our first app needs to have the libPusher library implemented in its porject. Right now, I'm at a crossroads completing the following task of adding and implementing it on Xcode 4.2:
Simply copy libPusher-combined.a and the contents of the headers directory into your Xcode project..
Source: http://github.com/lukeredpath/libPusher/wiki/Adding-libPusher-to-your-project
What does it mean by "copy"ing those files, and where should it be copied to? Can anybody who has experience with libPusher give me specific details as a list and source code on how to execute this so I can understand it better? I would truly appreciated any help, it will get our company up and running for us getting our app functioning and ready for reviewing submission to Apple Developer staff. The link I've provided will tell you more on what I'm talking about, if I need to specify anything I'll create a new post. Thanks!
What "copy" means in this context is that you want to drag and drop the .a (library) file and the header files (all the .h files) into your new Xcode project (to be precise: the file inspector is the list of files along the left side of the workspace window).
To copy anything to an Xcode project, find it in the finder, highlight all of the files you want to copy over (or just take the folder it comes in), then drag everything over the Xcode icon in the dock.
If Xcode is full screen (lion), the icon will kind of blink, then enter Mission Control mode, you then hold the files over the correct project and drop them into the Xcode file tree.
Make sure that your application is checked as a target for those files!!
If Xcode is not full screen, just drag the files or folder into the Xcode file tree and they will be added.
To link to a static library, just navigate to the name of your project>Info>Framworks. Click the plus, then select your framework if it isn't already there.

how can i add a right click menu to finder

how can i add a custom view to the right click menu of every file in os x finder?
e.g. i want to display the image if it is an image type and do some custom action etc.
is this possible with c or objective-c? if yes how? (without using any available tool)
You need to write a Menu Manager plugin based on CFPlugin. Unfortunately, this involves some really dated Carbon stuff. There is a tutorial from a few years ago at mactech
Note that this stuff may be obsolete with Snow Leopard, though whatever they come up with is probably going to be much easier to deal with than Menu Manager/CFPlugin cruft.