Skip to content

emil-palm/im-very-lazy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Im-Very-Lazy

A simple python script to generate objective-c properties and other Obj-C / Xcode related things. It all started with i had a project where i needed have 40-45 different ivars with correseponding property statements, so i wrote this little script.

It looks like crap, its almost certainly crap but it works for my usage.

Installation

git clone git://github.com/mrevilme/im-very-lazy.git
chmod +x im-very-lazy/genproperties
sudo ln -s $PWD/im-very-lazy/genproperties /usr/local/bin/genproperties

Usage

genproperties both HEADER.h

Arguments

The arguments are not synced with the amount of commands. I usally only use "both" which produces the output above.

Info

It reads a header file like the following:

@interface TestObject : NSObject {
   NSObject *m_testObject;
}

and prints this:

//----- TestObject properties -------
@property(nonatomic,retain) NSObject *testObject;
//----- TestObject synthesize -------
@synthesize testObject = m_testObject;
//----- TestObject init -------
- (id) init {
    if( self = [super init] ) {
	    m_testObject = nil;
    }
    return self;
}

//----- TestObject dealloc -------
- (void) dealloc {
    [m_testObject release]; m_testObject = nil;
    [super dealloc];
}

//----- TestObject initWithCoder -------
- (id) initWithCoder:(NSCoder *)aCoder {
    self = [[TestObject alloc] init];
    if( self != nil ) {
	    m_testObject = [aCoder decodeObjectForKey:@"m_testObject"];
    } 
    return self;
}

//----- TestObject encodeWithCoder -------
- (void) encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:m_testObject forKey:@"m_testObject"];
}

Enjoy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published