Link to external URL documentation from doxygen-style Objective-C comments - ios

I want to write something similar to this:
/**
Post a review. (For every place belongs only one review. If it was already written, the previous one will be overwritten.)
#param placeId Place identifier
#param rating Rating 0-5 for the place
#param review The text the user entered for review
#param callback Gets called either when the network request succeeds or when fails for some reason. The `success` parameter indicates this. If success is true, the contents of the `data` parameter of the response is given back as the `response` parameter. If the request fails, then only the `error` parameter is filled. You can find the details in this object.
#see http://example.com/api/v1/doc/service/review/saveReview?pkey=t75jg-5uGse-qIo
*/
- (void)saveReviewFor:(NSNumber *)placeId rating:(NSUInteger)rating review:(NSString *)review callback:(VMNetworkCallback)callback;
The problem is, that the link at the #see tag is not clickable in Xcode help bubbles:
Is it possible to have a clickable documentation link in this view? What syntax shall I use?

Yes it is possible to do so,
Change your #see tag to be as follow:
#see <http://example.com/api/v1/doc/service/review/saveReview?pkey=t75jg-5uGse-qIo>
For more information you can read the relevant section at Doxygen Documentation
Markdown support -> Automatic Linking

Related

How to update value in angular ui typeahead directive if no matching option is found

I've an array of objects containing title and salary which is used in typeahead directive.
I display department name and get entire object as value.
If none of the options match, I want user entered string to be converted to object still. Is there any way to update that?
This answer is pretty late, but I would just use ng-blur (to trap the end of the users input) along with a variable bound to typeahead-no-results. Then test if the variable is true in the method bound to ng-blur, and, if so, make an object out of the String supplied by the user and push it to your data source. Simple example found here.

Does Flow support the unique annotation from Doctrine?

Is something like this supported by Flow?
/**
* #ORM\Entity
* #UniqueEntity(
* fields={"host", "port"},
* errorPath="port",
* message="This port is already in use on that host."
* )
*/
class Service
{
I need to validate that one title isn't used twice for one user.
Edit: Added model validator to check for uniqueness, but now it's checked in all actions: loading, updated etc.
Edit 2: "Solved" by checking in validator if object is new (not yet persisted). Still problem when updating already existent entity.
You can use the UniqueEntityValidator and only annotate the validator in the actions where you need to check the uniqueness.
http://flowframework.readthedocs.org/en/latest/TheDefinitiveGuide/PartV/ValidatorReference.html#uniqueentityvalidator
Alternatively, you could maybe use ValidationGroups to only validate with your existing model validator in the places you want it to happen.
http://flowframework.readthedocs.org/en/latest/TheDefinitiveGuide/PartIII/Validation.html?highlight=validationgroups#advanced-feature-partial-validation

Functional document preparation for xcode

I have to prepare functional documentation for objective-c class methods like below example.
/*!
#function getEmployeeDetails
#abstract getEmployeeDetails
#discussion This function will fetch employee details based on employee id
#param strEmpId
employee unique id
#result an Array of Employee
*/
-(void)getEmployeeDetails :(nsstring *)strEmpId{
}
I referred to HeaderDoc User Guide in the below link and got idea how to prepare manually
Is there any short cut keys for functional documents?
You can use VVDocumenter :
Writing document is so important for developing, but it is really
painful with Xcode. Think about how much time you are wasting in
pressing '*' or '/', and typing the parameters again and again. Now,
you can find the method (or any code) you want to document to, and
type in ///, the document will be generated for you and all params and
return will be extracted into a Javadoc style, which is compatible
with appledoc, Doxygen and HeaderDoc. You can just fill the inline
placeholder tokens to finish your document.
After running the project with Xcode, in any project, you can generate the documentation by typing "///" (you can change this string in the settings) :

SWFAddress used to change INDIVIDUAL params in the url

I am using SWFAddress in actionscript 3 to control urls for navigation and controls, and while I am able to target and change specific parameters, I feel like I am missing a cleaner and more consistent way of handling it, perhaps even a feature or method I am not aware of.
Say I have a url and I want to change just the second param of def to xyz.
http://localhost/some-page/#/?param1=abc&param2=def&param3=ghi changed to
http://localhost/some-page/#/?param1=abc&param2=xyz&param3=ghi
I currently am doing:
if (SWFAddress.getParameterNames().indexOf("param2") >= 0) {
SWFAddress.setValue(SWFAddress.getPath() + "?"
+ SWFAddress.getQueryString().replace("param2=" + SWFAddress.getParameter("param2"), "param2=xyz"))
Essentially, checking if the param exists, checking what its current value is, then recreating the whole url using base, '?", and query, making sure I replace the the parameter and the parameter's value, making sure I don't miss the equal sign. This get's sloppy, and is error prone if the param exists but is not set to anything, or whether or not there is an equal sign, and a host of other pitfalls.
So, I can not just tell SWFAddress to update that one parameter in the url? A theoretical function of SWFAddress.setParam("param2, "xyz").
Has anyone coded their own method to micro-manipulate SWFAddress and the url, beyond the single function they supply you with of setValue(val:String)?
I think the short answer is no. According to the documentation there is no setParameter to go with the getParameter method. Looking at the code, it seems that the URL is not cached as a property in the class and therefore cannot be manipulated other than via the setValue method which, of course, updates the URL in the browser.
Presumably you're already parsing the URL in your onChange event so you can use the values to set your application state? If so, you shouldn't need to do so again when you come to rebuild the URL prior to updating it from Flash. If you store the deep-link properties on a Model class somewhere you can handle the defaulting, updating, and error checking without needing to resort to String manipulation. You would then rebuild the URL using those properties, a process you could abstract into a method in your Model class if required.
You should also note that the following line is not particularly robust since it will return true for properties such as param22 and sparam2:
if (SWFAddress.getParameterNames().indexOf("param2") >= 0) { }

jquery UI autocomplete - extended data?

I would like to use Jquery's UI autocomplete but with some additional functions: after user selects suggested item, I would also like to display additional data related with that item (for example if database of contacts are being searched, then I'd like to display contact's email, addres...) in some html element.
Is there a way to accomplish this?
Thanks in advance,
Ile
EDIT:
I'd like to provide more detail description of what I actually need:
When user starts searching contacts, as a result from database I would like to return contact's ID and Full Name. After user selects certain contact, then ajax function is called and it retrieves all details from selected contact using it's ID. But I don't know how to do following:
As a result from database return the ID and Full Name of contact as a JSON result (probably I would find the solution to get the right format, but I don't know how it needs to be passed to Autocomplete script)
How to handle the result data so that I display only full name and ID is used only when certain contact is selected, so that I can retrieve full details of certain contact
Have a look at its events: You can add a handler for the select event and display all your informations once it fires.
You can specify extra data in formatMatch function. The parameter must be some delimiter separated string. Later in .result function , which takes 3 arguments [event, data, formatted], you can retrieve it by splitting the formatted by the delimiter use and populate the required values.

Resources