Data Entry for iPad Help Needed - ios

I am searching for a way to take the current text written in a text box and transfer that to a list, and after the list is full, send that list to an e-mail.
To make better sense of this, I'll explain. I help out at a youth ministry where the kids are required to check-in at the door. Instead of writing names down on paper, I have been tasked with designing an app so they can just type the name on an iPad. Once the kid hits "Submit" button, I would like their first and last name (different text boxes, but could conjoin if easier to code) to be added to a never-ending rtf file or something of the sorts. This rtf file would then be e-mailed to me so I could keep an online roster.
I have all the buttons and fields in place, I just cannot figure out how to code the submit button to handle the function of placing the current text from the linked boxes in a separate file. If it can't be rtf, I don't really care. Just wanting something I can e-mail back to my Mac to save time. If anyone knows how to do this, or somehow finds a site that I missed during my continued scouring of the Internet, please let me know your solutions.
Blessings,
Kyle Baity

You can have an NSMutableArray to which you add new name strings as they are submitted, you can then make this into a string list using componentsSeparatedByString:. This allows you to sort and count the names easily if you want to add more features later on.
It's not clear how you want the email to be sent, but MFMailComposeViewController would be a good start, using your list string as the message body.

Related

Local storage on Rails

I've built a Rails app, basically a CRUD app for memos/notes.
A notes title must be unique. If a user enters a name already taken a warning message is shown prompting them to chose another.
My question is how to make this latency for this feedback as close to zero as possible. When creating a note little UX speed bumps like this will get annoying for user quickly.
Of course the main bottleneck is the network. Inspired by Meteor (and mini-mongo) I was thinking some kind of local storage could be a solution?
I.E. When app first loads, send ALL JSON to the client with ALL note titles. The app (front end is Angular JS) could check LocalStorage (or App Cache, Web SQL?) instead of incurring a network round trip. The feedback would be instant.
I've used LocalStorage in the past to augment an app, but in the scenario it'd really seriously depend on it. I'm not sure how confident I'd be building on something that user might not have. Also as the number of user Notes/Memos I have doubts how feasible it is to send a JSON object down the wire with ALL the note titles. That might get pretty big. On the other hand MeteorJS seems to do this with no probs.
Has anyone done something similar or have any pointers? Thanks!
I don't know how Meteor works here, but you're right that storing all note titles in localStorage is not a good idea. Actually, you don't need localStorage here, you can just put it in a JS array, because you need this data only once (when checking new note title).
I think, there could be 2 possible solutions:
You can change your business requirements and allow non-unique title. Is there really a necessity for titles to be unique?
You can verify note title when user submits form. In this case you can provide suggestions for users, so they not spend time guessing vacant title.
Or, if titles must be unique only within a user (two users can have same title for their notes), you can really load all note titles in JS array and check uniqueness while users types in a title.
Or you can send an AJAX request checking title uniqueness as soon as user finished typing the title. In this case you can win some seconds.
Or you can send an AJAX request as soon as user typed in 3 symbols. The request will return all titles that begin with these 3 symbols, so you don't need to load all the titles.

Creating you own database with Parse for an iOS app in Swift

I need to know if I can use Parse for what i need. Let me give you some context. I am new to coding for iOS in Swift. I am creating an app, and a big part of it is displaying info to the user depending on what country they select.
So at the start of the app, they will select a country. I have used Parse a little bit through an online course, so I know how to signup and create users etc.
What i want to know if i can do?
Can i use Parse to create my own database? So have a Class called country_data, and then in that class, have all the countries with info about them. As an example of what i mean, see the table below:
Then, in the app, i can check that if the user selects 'Spain' for example, I can display all the Info for Spain.
Everything i've done in Parse so far had been about sending info to Parse that Ive created from the code in Xcode. But i need to know if i can go into my app in Parse and create this database myself.
Is this possible and is it the right way to do what i'm looking for. Any suggestions welcome, and thanks! Please ask questions if you need me to explain more.
Nick
Good news OP,
(1) yes Parse is absolutely perfect for this.
Parse is now at http://back4app.com
Here...
It literally took me less time to do that, than it took to answer your question!
It's almost unbelievable to understand how much time "BAAS" services save, in the new "BAAS" era.
(2) 196 countries. You should be OK :) Anything up to a few million countries will work fine. After that Parse will get a little slow on searches.
(3) "But I need to know if i can go into my app in Parse and create this database myself."
Yes, using the internet and a computer,
just go to back4app.com, log in, and click on your project. Click on "Core". (Parse software also offers features like Analytics, etc. For the database system, just click on "Core".)
Notice the button "Add Class", click that and type in "Country". Add a column called "name" which is a "String".
Make another new class "City". Again make a "String" column "name", and also make a column that is a "Pointer" to "Country".
You're completely done.
It is far quicker than me typing it here, heh

iOS: Store names in a plist

It's been years since I've done iOS, but I'm jumping back into it and have a quick, beginners question. When the app launches, it will launch with a search field. You type in a persons name, hit enter, and info about the name will appear. I'm thinking about storing all the most common names in a plist, and having the search run through the plist after the user hits "enter", then display info about the name they typed in. This is where I'm stuck. After you type in the name and hit enter, I have no clue about how to make it display the info about the name, or even where to store data about the name. Any help is much appreciated, thanks!
I'll give you half of the answer you need here, the "loading" and "saving" part.
The "plist" you're talking about here is actually an array of names.
And -- how handy! -- "NSArray" has both an "initWithContentsOfURL:" method and a "writeToURL:atomically:" method.
Any more than just a few names and people will start suggesting using Core Data.
Also, if you want to be able to change and/or save the names while the app is running, you'll need to use a "NSMutableArray" instead of an immutable array.
As for the displaying part, you should probably learn how to use table views (UITableView) and binding (i.e. you "bind" to the array and values get displayed based on whatever the user typed into the search field). There are lots of tutorials and examples on this, as well as related questions here on StackOverflow.

Can my iOS App load a XML file and Generate Interface from the information within XML?

I'm working on a home automation project. Here's what I want to do:
The app starts and it'll have a button to load an XML file.
The XML will have information about the rooms in the house like "Living Room, Dining Room, Kitchen etc.". It'll also have information about the equipment, like "Home Theater, TV, Blu-Ray Player, etc. in this case with a relation with the room that they belong" and so on with IR, RS-232 cmds, etc.
I'll install this app in different houses, so I intend just to change the XML file as the house changes.
I intend to generate the UI from the information contained in the XML file. E.g. The house has only "Living Room and Dining Room". The tab bar will show only those two tabs.
So, my questions:
Will Apple reject my app?
Can my customers just download the app from the App Store, and change and load the XML file? I mean, there's a package in the .app file, is it possible to open it and change the .xml file inside it?
Is it possible to change the UI as the XML information changes?
EDIT: more questions:
#competent_tech is saying that dynamic generation of code isn't allowed, but I'll change the code within the .storyboard or .xib .nib files, isn't it?
About the Contacts: I think is a little bit different idea, because in the contacts app, e.g.: there are 10 fields to fill out, like first name, last name, e-mail, phone number, etc. As a user, if I don't fill out the e-mail field, it'll still be there anyway. My plan is kind of different:
The house has 2 equipments to control: - Tab bar with item 1 and item 2.
The house has 3 equipments to control: - Tab bar with item 1 and item 2 and item 3.
Do you still think this is possible?
Can you recommend a book about this? I couldn't find anything useful myself.
Unfortunately, only apple can answer the rejection question.
However, from what you have described, there shouldn't be an issue since this is configuration-based changes instead of code changes. Apple specifically prohibits download of code and dynamic generation of code.
You can liken it to Contacts: iOS doesn't come configured with contacts, they allow you add them and configure different things about them. This sounds very much like what you are doing.
You should be able to download an XML file from a website or web service and use that to configure the app. We use a web service to retrieve data into the local Sqlite database to configure nomenclature and UI component visibility based on the current user and it works quite nicely.
With generating code they mean executable code, not the generating of views or viewcontrollers. If that is forbidden too, you could distribute your app via addhoc, but you need one developer program per 99 clients.

Assigning Fogbugz cases programmatically

I want to write an application that assigns Fogbugz cases programmatically, how would I accomplish this? Is it possible to achieve this given any of the following scenarios:
The user enters text in my
application's input field and the
Fogbugz report is opened in the
browser where the "note" field is
populated with the text from the user
input
The fogbugz report is assigned to the
specified user in the application
without the browser even being opened
i.e. the report is stored directly in
the DB.
I'm planning to add default values to the other fields as well so I would assume the process would be the same for adding text to the "note" field.
You can do this with the Fogbugz API. See the heading "Editing Cases" for the specifics on how to edit a case (which includes creating a new one). It's a little complicated (or perhaps just oddly designed) but, as I remember, you basically have to call cmd=new if you want to create a new case, supply your text in the 's' parameter and set the ixPersonAssignedTo to the correct person. For an existing case, use cmd=edit.
This is possible both with a regular form posted to your Fogbugz installation and some server side code that calls the API.
You might want to write a plugin for FB and allow others to use it. (share it or sell it)

Resources