DeclareMaker - Easily Create iOS/Cocoa Declares from Apple Docs

Ok, I put it up on Github. Here is the link:
https://github.com/kingj5/DeclareMaker
I’ll be honest that I am very new to Github so I’m not sure how I would put a tag on the repository. If you can explain how I will gladly tag it Xojo, but I have no idea how to do so.

Never mind the tagging. I thought I’ve done that before, but maybe only on bitbucket. At least one service does allow you to specify the programming language, that’s what I had in mind.

I released an update to Declare Maker today. There are now 3 new windows which can be accessed from the File menu.
The first window allows the manual creation of classes for the cases when parsing the documentation fails. The second window allows for the creation of objects which implement Apple protocols (and therefore delegate objects) and provide Xojo events for when the related protocol function is called. The final window will probably be the most useful and it allows you to copy a selector into a textfield and it will then put the corresponding declare into the clipboard to be pasted into your project.
https://github.com/kingj5/DeclareMaker

As always if you come across any problems please let me know here or in a PM.

Thanks,
Jason

With the introduction of EC and iOS 9, Apple has changed the formatting of many portions of the docs, causing DeclareMaker to encounter a lot of trouble and flat out not work in some cases. I know what is causing this and hope to fix it this weekend, but for now assume that most features are broken :frowning:
Have to love Apple for constant changing everything…

Sorry for any inconvenience,
Jason

PS. The problem is the introduction of “nullable” and “nonnull” into the docs which DeclareMaker thinks is a keyword and “trips” on. If you want to continue using DeclareMaker in Manual, Clipboard, or Delegate mode, just go through the selector you paste and remove the nullable and nonnull keywords before asking DeclareMaker to process it and everything will work as normal.

Hey Jason - I look forward to your update. (I am just learning about this the whole area of declares, and thi looks like a great tool.)

Cheers!

Before Declare Maker, it took me full days to build declares. That product is positively brilliant.

Thank you Jason !

You’re welcome, I’m glad this is helping people with declares!

DeclareMaker has been updated once again and the bug where it would not process the new docs properly should now be fixed. As always if you find any problems or have any questions please let me know here or by PM.

https://github.com/kingj5/DeclareMaker

Thanks,
Jason

Hi Jason,

Thank you so much for sharing. A great idea and awesome tool.
And as previous posters mentioned, if .h files can be dropped in, that theoretically should cause less headaches when the page layouts change.
Just so you know, the NSTask Class currently breaks on an outOfBounds.

Hi Marco,
You’re welcome. Indeed I agree with you that being able to drag and drop .h files should be better and more consistent when the layouts change. With the manual mode I have most of the code written that would be necessary to parse the .h files (it can now parse complete method selectors) and only a little more code would have to be written in order to properly parse a property. If you or anyone else would like to attempt to make some changes so it can parse .h files please go ahead and I will merge the changes - that is why I made it open source. Unfortunately I don’t have the free time to finish that right now - maybe in several weeks.

I’ll look into the NSTask error later today to see where it goes wrong, thanks for the tip.

Jason

PS. If someone wants to try to make it parse .h files please let me know and I can try to point out some of the more important code that will help you in your endeavor.

New version of Declare Maker posted to fix the OutOfBoundsException Marco identified. It was caused by not all documentation being updated to the new version by Apple yet.

https://github.com/kingj5/DeclareMaker

Jason

Not sure how to submit this properly through GitHub, but I tried converting MPMusicPlayerController Class Reference.html and it did not like the file.

Found the problem being an OOBE and update the code in OBJCClass process method where the code was expecting at least a ubound of 1. Seems to have worked around the problem, but I haven’t thoroughly checked for any unintended consequences.

	    [code]//collect leading symbol (+/-) for class/intance method
	    dim tmp() as String = tmpStr.Split("<code class=""code-voice"">")
	    //added here a test fix for problem file
	    if ubound(tmp) < 1 then return
	    dim methodType as String = tmp(1).Left(1)[/code]