开发者

is there any system or library that can intelligently assign text from array to specific fields in iphone [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

HEllo,

I have a situation here i have contents(NSStrings) in an array, is there any system or library that can assign the content of array to specific fields.

Please help if you have an idea about this.

Thnx in advance

(ok to elaborate)

say I have standard of a student then allocate it to standards text field corresponding to standard

If I have email开发者_运维技巧 then allocate it to email text field

I have some sentences or short text statements in a list, and I want the application itself to perform semantic parsing of this text and act on it by filling in the appropriate values.


Putting text into text field is a central operation on the iPhone. See this tutorial for a very simple app that changes the text in a text field. The source of the text to put in the field is largely unimportant. Just take the string out of the array, core-data, generator etc and stick it in the field.

If you have a more complex question, you should edit your question to provide more detail.


I really don't understand your question but I think this may be related to what you're looking for - exZact data collection


Your question is vague:

  • contents in an array -- array either has contents or it doesn't, that doesn't tell me anything. What kind of contents? NSArray containing NSStrings? Some other standard class? A class of your own?

  • fields - are these a fixed group of fields, or does the number of fields needed depend on the NSArray's contents? do you want the fields to be editable, or do you just want to display data for reading?

  • standard of a student - What is a "standard of a student"? Don't assume we know your project and its domain-specific language. Can you explain what you mean? Your name looks Indian, so if you're not a native speaker of English, maybe you looked up the wrong translation? Can you try other translations? Circumscribe what you mean? Your complete use of "standard" has me confused, I know no meaning of the word that fits the three occurrences in your sentence.

As to semantic parsing, I don't think the iPhone has finished classes for that (does the iPhone have NSScanner or a public API to data detectors? I think only the Mac had that).

However, once you've done the parsing of the string (e.g. using NSString methods like -hasPrefix:, -characterAtIndex:, -substringFromIndex etc.), you should be able to just assign each piece of text to your UITextField or whatever you have, like in any other app. If you don't know how to do that, read up on IBOutlets, the -setText: method etc.

If you do not have a fixed number of items, you'll either want to create the views manually (Just +alloc/-initWithFrame: the right UIView subclass and -addSubview:, and keep a pointer to the view in another array) or use a UITableView, which is suitable for all kinds of lists of things.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜