I am using the XLFORM library with swift, I want to clear the value of the row after a successfully request .
I am trying to get the row object using self.form.formRowWithTag and changing the value using .value but unfortunately I am not able to get the row's object :(
anyone can help on this ?
I was searching for this answer as well, and your answer gave me inspiration.
What you have done so far is correct. Here is the code:
self.form.formRowWithTag("whatever-tag").value = nil
self.tableView.reloadData()
The key is to reload your UITableView
Hope this helps =)
While the above answer might work, I found out how to do it the way XLForm author wants you to do. On XLForm Github, the author says:
You may have to update the cell to see the UI changes if the row is
already presented. -(void)reloadFormRow:(XLFormRowDescriptor *)formRow
method is provided by XLFormViewController to do so.
So, you can do this:
var row = self.form.formRowWithTag("whatever-tag")
row.value = nil
self.reloadFormRow(row)
Hope this helps.
Related
I'm trying to mark the last word in the document as a Annotation to be used by other rules.
This is what I've tried so far:
DocumentAnnotation{LAST(W) -> MARK(Unit2)};
Document{LAST(W) -> MARK(Unit2)};
Neither of these rules seem to work.
Is it even possible to mark the last word of the document by these means?
The Problem is that we try to find the last word/period of the Document so that a previously marked Annotation can be shifted to the last word.
Any help would be greatly appreciated.
You cant use LAST Condition for this scenario. Rather you can use MARKLAST action.
DECLARE LastWord;
Document{->MARKLAST(LastWord)};
Nevermind, I'm an oaf,
it's done with
Document{->MARKLAST(Unit2)}
Is there a way to determine if string does not contain something in an if statement? Basically the opposite of .contains .
Example of contains:
if someItem.contains(x) {
code
}
Example of what I am looking for:
if someItem.doesNotContain(x) {
code
}
Where a slolution for doesNotContain is what I am looking for.
Any help is greatly appreciated, thank you.
*FYI, I am new to Swift and to programming, thank you for your comments.
No Apple doesn't provide any function like doesNotContain or something similar.
But if you don't want to add else part then you can simply use:
if !someItem.contains("hello") {
//This means your someItem doesn't contain "hello" string.
}
try using this way
if !someItem.contains(x) {
code
}
Here are the results:
First off, I removed “without using a true/false Boolean” from my question in order to avoid confusion and to better suit the answer/solution.
Is there a code that is opposite to .contains? Simple Answer: NO.
It turns out that contains(_:) is a Boolean in of itself. This I did not know since I am new to coding.
The solution is actually quite simple as we can state this Boolean to be true or false, as suggested by #The Tiger.
if someItem.contains(x) == false
or
if someItem.contains(x)
Tested this, and works like a charm. Opens up a bunch of new oportunities for me, and I hope this helps out fellow coders in search of something like this.
Thank you all for your comments and helping me find the answer, Cheers.
I've downloaded saveppt2, jrichter's code and even WritetoWordfromMatlab and tried reading through them to figure it out with no luck. I have something of my own built already so I just need to figure out how to get tables to work.
Whenever I try something like:
myTable.Cell(1,1).TextFrame.Text = 'textstring'
or
myTable.Table.Cell(1,1) = 'textstring'
Or any combination of table / text commands I end up with there being no such property or function as cell for table objects. Every COM/VBA/C library I can find, as well as some code in Python (PandastoPowerPoint from Github) that does what I'm aiming to do says that Table.Cell(row,col) should work. Is this specifically a problem with matlab trying to use (#,#) as a form of indexing?
Try
myTable.Cell(1, 1).Shape.TextFrame.TextRange.Text = "TextString"
or = 'TextString' if that's what matlab prefers.
Thanks Steve R! With a little tweak, I got it to work, finally. So here's the answer:
% add table to existing slide object
myTable = slide.Shapes.addTable(nRows,nCols,x0,y0,rowWidthnRows,colHeightnCols)
myTable.Table.Cell(1, 1).Shape.TextFrame.TextRange.Text = 'TextString'
I am new to python.I am posting here for the first time and I know question might be quite basic but problem is I can't figure out myself.
Lets say I have
List=[("a,"b"),("c","d"),("e","f")]
I want the user to enter one of the elements of one of the tuples as input and the other element is printed.Or more precisely I would say that just one of elements in List[x][0] is input and corresponding List[x][1] element is printed as output.I hope it makes sense.
Thanks!
Please check List in the question.I think you forgot a quote(") in the first tuple.[("a^here,"b"),("c","d"),("e","f")]
I think this might help you.
List=[("a","b"),("c","d"),("e","f")]
c=raw_input('ENTER A CHARACTER-')
for i in xrange(len(List)):
if c in List[i]:
ind=List[i].index(c)
print List[i][abs(ind-1)]
break
I can add one mapobject by using:
m_framework.InsertPointMapObject(m_framework.GetMemoryMapHandle(),"amenity",
32.791576, 39.909264,
CartoType.CoordType.Degree,
"AHMET YILMAZ\n06DY1998\n",
CartoType.Util.IntAttribute("fue",1),ref id,false);
But adding another with same code to another location is impossible. It is not drawing the second one. I have tried changing id but not worked.
Can I only add one map point?
Thanks.
Muzaffer, I'm sorry I didn't notice this question. As the CTO of CartoType I ought to have done. Yes, you can insert as many points as you like.
The problem you're having is caused by a conflict in object IDs. The first call sets the ID to one assigned by CartoType. If you leave that ID as it is, and use it in a new call, it will conflict with the ID of the object you just inserted.
The best way fix this problem is to change the ID to zero each time, just before you call InsertPointMapObject. Then CartoType will assign an ID and return it to you in 'ref id'.
If that doesn't work, please post a small repeatable example with all the code needed to reproduce the problem, and I'll look into it further.