Author Archives: Neha Gupta

Codesign Installer package for distribution outside the Mac App Store

Developers Area

Sometimes you need to distribute your application installers outside Mac App Store. You can code sign it so that it will be recognized by Gatekeeper as identified developer product. Once you code sign the installer with your Apple Developer Id certificate, gatekeeper will allow to open the installer, otherwise it will show a dialog saying “The app cannot be opened because it is from an unidentified developer” (if gatekeeper settings are set to ‘Mac App store and identified developers’).

To know more about Gatekeeper options click here.

Here we will see how to sign the installer package so that gatekeeper won’t block it.

The installers created by PackageMaker with minimum target set to 10.5 and above are flat package while the installers created with minimum target set to 10.4 will create a bundle package.

Bundle type installers cannot be signed using Developer Id Installer certificate. These can be signed using Developer Id Application 

View original post 155 more words

Advertisements

Memory management in Objective C

Developers Area

How memory management is done in objective C?

The latest OS X and IOS versions (IOS 5, OSX 10.7 and above) supports Automatic Reference Counting (ARC), a memory management enhancement in Objective C. Before that programmers have to follow the Manual Retain Release procedure. Go through the slides below to understand Memory Management in Objective C with reference to IOS and Cocoa. Also learn about the introduction of ARC and how it works.

Topics Covered:

– About Memory Management and IOS, OSX versions

– Reference Counting

– Taking ownership of an Object

– Relinquishing ownership of an Object

– Memory Leak and Dangling pointer

– Strong, Retain and Copy

– Autorelease method

– Autorelease pools

– Dealloc

– Automatic Reference Counting

– Zeroing Weak References

– Garbage Collector

Written By: Neha Gupta

View original post

Access/control scriptable application using scripting bridge and Cocoa

ScriptingBridge framework in Cocoa can be used to access features from any scriptable application. In this article I will discuss how to access the features of iTunes such as current playing track, duration of the track, playlists etc by using ScriptingBridge.framework in a Cocoa Application. However you can follow the same steps to allow your application to interact with any other scriptable application.

Read the rest of this entry

How to get selected text and its coordinates from any system wide application using Accessibility API?

In my previous post, I had discussed about accessing the text value from any system wide application by using Accessibility API. Now going further,  you may want to access only the selected text or the position of selected text, we will discuss about it in this article.

Read the rest of this entry

Accessing text value from any System wide Application via Accessibility API

Suppose, I want to create a application which will monitor the typing and say if “macdevelopers” is typed anywhere be it in TextEdit or Mail etc. the application will perform a operation for example automatically opening the website in a browser.

The text value from any System wide Application can be accessed using the Accessibility API. In this article I will discuss about accessing the text value from any application like Text Edit or other applications if its current focused element is some text field or text view in it. Thus using this you can implement the functionality to access the active application’s text field value. Read the rest of this entry

Undo/Redo in a Cocoa Application (Example to Undo/Redo addition & deletion of rows in a table view)

Undo/Redo functionality in a Cocoa application – NSUndoManager

This article will give you an overview of adding undo and redo functionality to a cocoa application by an example that undo/redo addition and deletion of rows in a TableView.

Lets start with How Undo Manager works?
As per Apple’s Reference Guide “You register an undo operation by specifying the object that’s changing (or the owner of that object), along with a method to invoke to revert its state, and the arguments for that method. When performing undo an NSUndoManager saves the operations reverted so that you can redo the undos.” Read the rest of this entry

Protocol Buffers with Objective-C

What are Protocol Buffers? Protocol Buffers are a way of encoding structured data. Protocol buffers are a flexible, efficient, automated mechanism for serializing structured data like XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages. You can even update your data structure without breaking deployed programs that are compiled against the “old” format.

How to use Protocol Buffers with Objective C?

Read the rest of this entry

Circular Progress Bar

Circular progress indicator We  all are familiar with native progress bar but a circular progress bar might be required in a project. In circular progress bar, progress of process will be shown by a bar filling in clockwise or anti-clockwise direction. Here I am providing the code to create a circular progress bar as shown in the image below: Read the rest of this entry

Round Cornered Views

Custom NSView with rounded corner:

To draw a custom view with its one or more corners round, all you need to do is draw a bezier path of the required shape in the view’s drawRect: method.
Also, this can be used to customize any NSView subclassed objects as  NSTextView, NSTextField etc.
Here I present the code to create a text field with any one round corner as shown in the image below. The code can be easily changed to create more than one round corners of a view. Read the rest of this entry

%d bloggers like this: