multiple actions on button with if statement in xcode4 - xcode4

First of all, I'm very new to the Xcode 4 and Obj C and I m trying to build a survey function with only one navigation button. I need a method for my navigation button which will produce the result that if users select the first option and then select the navigation button, it will bring them to the second view controller while if they select the second option the navigation button will take them to another view. Can someone please help

I am in the same boat. I wish that other people would have posted to this. If it helps at all, the if/else statement in the code snippet library probably holds the keys, now we just need to find the lock.
if (<#condition#>) {
<#statements-if-true#>
} else {
<#statements-if-false#>
}
I am still learning here, but I know that an important conceptual distinction is that you can handle this survey in one of at least two ways:
Use if/then logic to branch out to different questions.
Have the same questions for everyone, storing the answers in a plist file and then at the end, based on the results gather, branch at that point to final results screens.
This was posted last year so you may be well ahead of me, but as I find out more, I'll post here. I'll be happy to add to the reference resources.
– David

Related

asp.net multiple user calculation error

Apologies if this has been asked/solved before. I've done a fair bit of searching but can't seem to find a direct answer to my problem.
I'm still very new to asp/vb coding.
I've created a complex calculator in asp.net using vb.net.
The user fills out a few text boxes with information then clicks the calculate button. The program then accesses an sql 2014 server to collect more information based on information the user has entered, then uses the information to run a few very complex calculations (I don't completely understand the calculations behind it).
It all works fine and is able to give the correct answer, the problem I've found is if there is more than one user accessing the site and they happen to click the calculate button within the same time, whoever clicked the calculate button first gets an error whilst the person who clicked second gets an answer.
I'm not sure if this is to do with how it accesses the sql database for information or if the information is somehow being overridden.
I was hoping this would be a common problem, but can't seem to find anything on it, at least I may not be asking the right question when searching.
Unfortunately for security reasons I'm not able to post any code for it (I'll see if I can get permission) but am hoping that someone has come across something similar and knows a work around. Maybe to have the site wait until the first round of calculations is complete before initiating the second round?
Thanks for your help in advance!
Please make sure that you should not use any shared variable in calculation because shared variables are common for all users. Also check for application variables.
I can understand, but if those public variable's value changed at one place, then after everywhere that variable's value will be new even if you are in middle of some processing.

How to generate PDF via IText Template

we want to realize the following:
Generate PDF with Template,which means set value in AcroFields
Create a big details table (structure of table is also in template). In this progress, the details will occupy more than one page.
If the detail table is on multi pages, the header of the table should be also on top of the new page.
We found some examples on following website:
http://kuujinbo.info/cs/itext_template1.aspx
http://kuujinbo.info/cs/itext_template2.aspx
But the details the founction is omitted there.
Add content; the code for _do_form_fields(), _get_transaction_details(), and _transaction_summary() are omitted, since they only return strings to add to ColumnText. ColumnText is smart; each call to Go() renders as much text that will fit on the current page and returns a status code that tells you: (1) how much text (to write) is remaining, and/or (2) how much space is still available on the page. On each iteration you add text to the current page, call ColumnText.HasMoreText() to inspect the status, and then Document.NewPage() if necessary.
Is there anyone who had same situation before? We are appreciated that you could offer some tips or suggestions.
Thank you.
best regards,
Cheng Gong
You are already making a mistake in the first step of your requirements.
You say "Generate PDF with Template,which means set value in AcroFields."
The first part is OK: you want to generate a PDF with a template. However, this doesn't mean setting values in AcroFields. That's only one option. It's the option you take if you consider PDF being the digital equivalent of paper. The form is static: every coordinate is fixed. You just fill out data at the appropriate places. If the data doesn't fit the designated areas, you're out of luck. I already referred to chapter 6 of my book in a comment. You can also see how AcroForms work in a longer tutorial: https://www.youtube.com/watch?v=6YwDME0Fl1c (This tutorial is almost completely dedicated to creating a report from a data set.)
Another way to create PDF from a template is by using the XML Forms Architecture. In this case (if you have a pure XFA form), your PDF is a container for XML. You can then inject XML data into this form and the form will adapt itself depending on the data. A one-page form can easily grow into a 20-page document when filled out. This is explained in this video: https://www.youtube.com/watch?v=h0wzj84tnmw (Note that the video dates from 2012. The product I present has been finished and the results are much better now.)
Alternatives to this approach could be to create a template in HTML. I often refer to this solution as a poor man's XFA solution. This solution requires XML Worker. You can see an example in this video: https://www.youtube.com/watch?v=clWoDrEEl50
This is a general answer. I couldn't be more specific because your question isn't clear. You first need to make your mind up regarding the approach. Right now, you talk about AcroFields and at the same time about ColumnText. In the long tutorial, this is described as the hard way. See also the corresponding online samples. It is very confusing why you're asking a very difficult question before asking the simple questions. Unless of course, you already have the answer to those simple questions. If so, please share these answers.

Two questions about Wakari.io

(1) How do you "un-share" a bundle? (I know, this must be in the documentation. But I really can't find it. Sorry!)
(2) Is there any kind of user mailing list for Wakari, where questions like the above would be better targeted?
OK, well I ended up eventually finding it. So, just in case anybody else should look here. You can pull down a menu under your user name. One of the options is "settings." Within that there is an item called "sharing." When you click on that you get a list of your currently shared bundles with an option to delete them.

Best component to show three columns

I am struggling myself thinking about which component to use in my new app.
The first screen I am using Collection View with big images. Once the user touches one cell, it goes to the second screen ... and here is the problem.
I have three columns, similar to a dictionary with first language, second and third. The user will be able to choose which column he wants to search, and according to his criteria it will show the result that matches. I am not sure how to implement this, which component gives the best experience to the user. Any idea is more than welcome. Thank you in advance. Alex
If your data is several rows each with 3 columns, I would recommend customizing a UITableView. I followed this tutorial when I was trying to set up something similar.
The Table View will also give you efficiency if you have a lot of data, and you can build the custom table cells in the interface builder so that makes life a little easier.
-Ken

Drupal question: Views, arguments and nodequeues

Hello :) I posted this same question on a drupal-oriented site, but didn't get any replies at all. I grumbled to myself and wished that the site was more like StackOverflow, so I thought, why not try asking it here :)
I'm playing around with a view that displays nodes belonging to a taxonomy term. The vocabulary also has a taxonomy nodequeue with subqueues for all the terms.
So far the view has one argument, taxonomy term ID, and is sorted by post date. But what if I wanted to display all of the nodes of a particular term, with all the nodequeue nodes on top, and all the non-nodequeue nodes (but still under this particular taxonomy term) below, sorted by date?
To clarify, say this is my vocabulary, we'll call it 'living stuff'
Plant
--Fruit
--Vegetable
Animal
--Fish
--Dinosaurs
The following nodes are found under Dinosaurs:
Tyrannosaurus Rex (added 2009-01-01)
Megalosaurus (added 2009-01-02)
Velociraptor (added 2009-01-03)
Brachiosaurus (added 2009-01-04)
Since tyrannosauruses and velociraptors are extra awesome dinosaurs, they're also added to the nodequeue living stuff, subqueue dinosaurs:
The subqueue:
Velociraptor
Tyrannosaurus rex
The final view should display them in this order:
Velociraptor (it's first in the NQ)
Tyrannosaurus Rex (2nd in NQ)
Brachiosaurus (of the remaining dinosaurs, this is the newest)
Megalosaurus (oldest non-queue dinosaur)
I created a relationship to a nodequeue, but it wouldn't let me pick a subqueue, I could only limit to the 'living stuff' nodequeue.
My first view argument is term ID, so I thought that if I added "Nodequeue: subqueue reference" as the second argument, I'd get the expected behavior, but this only shows the dinosaurs listed in the nodequeue.
Any help or suggestions on this problem would be highly appreciated. Thanks!
I haven't really tried much with nodequeues' subqueues, so I'm not completely certain of this. But from my experience with nodequeues, it seems like when using views, you are limited to the basic things they support and can't really do the type of customization you are looking for. I think your best bet, would be to create your own views sort handler, where you can sort it like this. It will probably be quite tricky to make such a handler, since you have to figure out both views and nodequeues in order to make it work. You should really give it some thought if it would be worth it before venturing down that path, unless you have done this sort of things with views before.
More hacks:
A work-around for the behavior your trying to accomplish might be to forgo using nodequeues at all. I'm not sure the entire impetus for using the nodequeues nor the importance of dates, but faced with similar issues before, I've been able to tackle it using the following:
Sticky
Modified dates
If you sticky your super-cool dinosaurs, and modify the published dates of the elements so that they match your order, you could produce what you're looking for in a single view. It's sorta hokey, and it's predicated on not really caring about publishing dates (something that always depends on situation) nor having a more pressing reason for using a nodequeue. That said, if you don't need the nodequeue or the dates, it's a workable solution.
The 2-view solution by Jeremy should be workable, too, and I'd say that's another common way to handle the given scenario.
Hacky solution warning!
Have your primary view in your page with the nodequeue items.
Create another view which is exposed as a block for the non nodequeue items. Put this block in the main content region and limit it to only show on URLs which are the same as the first view.
You may have to do some fiddling with the url variables but I think it will work.
Why don't you concatenate the views behind each nodequeue? (each nodequeue generates a view)
You can add a header (see 'Basic Settings' in view edit page) to the second nodequeue that contains php code that invokes views_embed_view('first nodequeue') (you just need to change the header's input format to 'php'). Or rather, create a custom view that includes each nodequeue by invoking views_embed_view(). This would effectively place one nodequeue on top of another, and if they are of the same format/content type you don't even need to mess around with fields: you can use Row Style == Node. As far as your arguments, they can be passed to views_embed_view, as the third parameter (the docs don't say that AFAICR, but I found a post in the forums (http://drupal.org/node/99721) that indicated args can be sent as '$current_view->args' to the view being embedded).
HTH

Resources