{"id":16170724,"url":"https://github.com/holtwick/xobjc","last_synced_at":"2025-03-19T00:30:32.786Z","repository":{"id":637802,"uuid":"279170","full_name":"holtwick/xobjc","owner":"holtwick","description":"XCode automated property and method code generator for smart Objective-C developers who want to save time and reduce typing errors","archived":false,"fork":false,"pushed_at":"2012-03-30T13:33:57.000Z","size":1193,"stargazers_count":74,"open_issues_count":8,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-28T13:18:23.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://github.com/holtwick/xobjc","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":"Unmaintained","scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/holtwick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-08-16T10:49:11.000Z","updated_at":"2019-08-13T14:27:32.000Z","dependencies_parsed_at":"2022-08-16T10:35:06.172Z","dependency_job_id":null,"html_url":"https://github.com/holtwick/xobjc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holtwick%2Fxobjc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holtwick%2Fxobjc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holtwick%2Fxobjc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holtwick%2Fxobjc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holtwick","download_url":"https://codeload.github.com/holtwick/xobjc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955755,"owners_count":20374373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T03:19:26.153Z","updated_at":"2025-03-19T00:30:32.466Z","avatar_url":"https://github.com/holtwick.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\n\n**Deprecated, this code should not be used any more! Better use Xcode 4 with ARC!**\n\n---\n\n\nxobjc\n=====\n\n[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=holtwick\u0026url=https://github.com/holtwick/xobjc\u0026title=xobjc\u0026language=en_GB\u0026tags=github\u0026category=software)\n\n**FULL XCODE4 COMPATIBILITY***\n\n**Xcode4 Demo on YouTube [youtube.com/watch?v=Mzfv-ANydW4](http://www.youtube.com/watch?v=Mzfv-ANydW4).**\n\n**XCode3 Demo on mov.io [mov.io/fE](http://mov.io/fE).**\n\n\u003cdiv\u003e\n\t\u003ciframe src='http://mov.io/go/showvideo/player/fE?autoplay=false' width='430' height='391' scrolling='no' frameborder='0'\u003e\u003c/iframe\u003e\n\u003c/div\u003e\n\t\nA tool for making annoying every day tasks for Objective-C developers, especially\niPhone developers, easier. Therefore this tool will help you writing semi-automatically\nthe ``@property`` and ``@synthesize`` stuff. It also updates the ``dealloc`` method to release\nyour objects. And you can define the attributes according to the \n[Google Objective-C Styleguide](http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml#Variable_Name) \nusing a trailing underscore, i.e. your public attribute is then defined \nwithout this underscore. But also a leading underscore is ok. Public method can easily be defined by\nprepending XPUBLIC in the implementation part.\n\nNo more redundancies and nonsense typing orgies! You'll save a lot of time!\n\nPreparations\n------------\n\nYou have to define some helpers in your code that will indicate your properties \n(you can alternatively use ``xobjc.h`` from this package):\n\n    #define XRETAIN \n    #define XIBOUTLET\n    #define XASSIGN\n    #define XCOPY \n    #define XPROPERTY(...)\n    #define XNIL nil\n    #define XPUBLIC \n\nYour code\n---------\n\nIn your header file mark you properties like this:\n\n\t#import \u003cUIKit/UIKit.h\u003e\n\t#import \"xobjc.h\"\n\n\t@interface DemoViewController : UIViewController {\n\t    XIBOUTLET UILabel *header_;\n\t    XIBOUTLET UITextView *message_;    \n\t    XASSIGN id delegate_;    \n\t    XASSIGN int counter;    \n\t    XRETAIN NSArray *listOfUsers_;    \n\t    XCOPY NSString *secretKey_;\n        XPROPERTY(readonly) BOOL isPublic_; \n\t    int age;\n\t}\n\n\t@end\n\nIn your module file you can mark public methods like this:\n\n\tXPUBLIC\n\t- (void)somePubMethod { /* ... */ }\n    \n(IBAction, class initializers and class methods are always considered public)\n\nUsage\n-----\n\n``$ python xobjc.py sample.h``\n\nAfter that your ``.h`` and ``.m`` files are updated. XCode should reload your code in the editor\nautomatically. The command also creates a new subfolder which contains a backup of your \noriginal code, hope you never will need it ;)\n\nExample\n-------\n\nSome pictures say more than thousand words. Here is a before/after diff showing the magic:\n\n![Header](https://github.com/holtwick/xobjc/raw/master/website/demo-h.png \"Header\")\n\n![Module](https://github.com/holtwick/xobjc/raw/master/website/demo-m.png \"Module\")\n\nXCode4 Integration\n------------------\n\nEdit your projects 'Scheme' and add a new 'Run Script Action' to your 'Build / Pre-actions'. \nFill in the full path of your xobjc4.py. Now each time you build your project this script\nwill be run. This is super handy.\n\n![Header](https://github.com/holtwick/xobjc/raw/master/website/xcode4scheme.png \"Xcode4 Scheme Modifications\")\n\nIf Growl is installed it will also issue a notification.\n\n\nXCode3 Integration\n------------------\n\nIn Xcode in the menu choose the script symbol and there ``Edit User Scripts``. Create a new\nentry and copy and paste the contents of the file ``xobjc.py`` into the text field. That's all, \nyou are done. Just call the script form the menu or via the key shortcut you defined while you\nare in the header or implementation file you like to become updated.\n\nRelated\n-------\n\nMacro extensions for XCode\n\n * [xcode-text-macros](http://github.com/liyanage/xcode-text-macros) \n\nSimilar approaches and discussions\n\n * \u003chttp://cocoawithlove.com/2008/12/instance-variable-to-synthesized.html\u003e\n * \u003chttp://allancraig.net/blog/?p=315\u003e \n * \u003chttp://github.com/wookay/da/blob/b1190cd83df5700b0b6035eef2959c7968bde488/ruby/xcode/property_automation.rb\u003e\n\nKnown Bugs and Problems\n-----------------------\n\n * With Snow Leopard MacOS X 10.6 the 'osascript' helper, which is used for XCode integration, threw some\n   errors. I used a workaround I found here to circumvent the problem: http://kb2.adobe.com/cps/516/cpsid_51615.html\n   If you are using non Intel architecture or other OS you might need to modify this portion of code in xobjc.py\n\nLicense (MIT License)\n---------------------\n\nCopyright (c) 2011 Dirk Holtwick\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholtwick%2Fxobjc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholtwick%2Fxobjc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholtwick%2Fxobjc/lists"}