Socket
Book a DemoInstallSign in
Socket

property_synthesize_dealloc

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

property_synthesize_dealloc

0.2.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

Description

One of the things we do a lot of in Objective-C is outlet and variable declaration, synthesize and dealloc. Since this is a repeatable recurring event I thought I would add a little automation to the process.

Update March 19, 2011

Xcode 4 no longer supports user scripts but instead uses Services.
You can create a Service with Automator.
Do the same as below except put the code in a Run Shell Script.
Set the Application to Xcode and the input as Text.
Or, use the one provided in the AutomatorService folder.

Instructions

Install the gem.
I have only been able to get this working in Xcode by installing the gem in system ruby.

sudo gem install property_synthesize_dealloc
sudo gem install rb-appscript

Make a user script in Xcode with the following:

#!/usr/bin/ruby  

require 'rubygems'  
require "property_synthesize_dealloc"  

property = PropertySynthesizeDealloc.new  
property.selection = STDIN.read  
property.psd!   

Then select the ivars you wish to make property, synthesize and dealloc declarations and execute using either a user script or
if using Xcode 4, a Service (as described in the Update above and provide in the AutomatorService folder).

Overriding defaults

You can provide an optional parameter to a custom config.yml file.
Just add the path as a parameter to PropertySynthesizeDealloc.new.

PropertySynthesizeDealloc.new("/path/to/custom/config.yml")

Here is the skeleton. Make sure to use this as a starting point.
Supported options.

settings:
  sleep_time: 0.1
  xcode_app_path: '/Developer/Applications/Xcode.app'
  use_nonatomic: true
  position_prop_after_closing_bracket:  false
  outlet: true

types:
  copy: ['NSString', 'NSMutableString', 'NSArray', 'NSNumber']
  assign: ['int', 'integer', 'BOOL', 'float', 'NSUInteger', 'NSInteger', 
             'double', 'uint8_t', 'uint16_t', 'uint32_t', 'int8_t', 'int16_t', 
             'int32_t', 'int64_t', 'uint64_t', 'GLuint', 'GLushort', 'GLubyte', 
             'GLfloat', 'size_t', 'GLenum']
  retain: []
  
  

Copyright (c) 2011 Craig Williams. See LICENSE.txt for further details.

FAQs

Package last updated on 20 Mar 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.