Can ABNewPersonViewController be used to edit existing records? - iphone

I'm trying to use ABNewPersonViewController to edit an existing record.
I set the displayedPerson property and it shows up fine with all the info.
If I hit Save, everything works as expected. However, if I hit Cancel, the record is deleted from the Address Book.
The only solution I can think it is deep copying the record and then re-adding it to the Address Book if the user cancels out of the editing dialog. Is there really no better way?

add a custom "Cancel" button to replace the original "cancel" button of ABNewPersonViewController!!

Related

My click trigger always fire in google tag manager

I'm having difficulties using the Click trigger in google tag manager.
I want to setup a trigger to fire on a click event, only when the element class contain "scrollto".
But the thing is, it keeps firing up even when the "scrollto" class isn't part of the element I clicked on.
Here are a few screenshot I hope will help you understand the problem:
Thank you for your help,
Alexis
Ones you set up any click trigger you will get these events everytime a user makes a click but that doesnt mean the trigger it self is being fired. You can append the trigger to any tag and you ll see that if you click anywhere else the tag wont fire even when you see the event.
Hope it helps!
Instead of click classes contains scrollto,
Give click classes equals scrollto

Working with a form in Add mode

please bear with me while I try to explain my problem. I am opening a form in Add mode; the form is bound to a single table but contains a subform linked to another table - the 2 tables have a 1 to many relationship. I enter some data which triggers the autoref to populate on the main form, and create a linked record on the subform. I then click a button on the main form to open another form. Using vba on the OnClick event of this button, I save the record on the current form and create a new record in a different table. This table is the data source for the 2nd form, and I open the form filtered to the newly created record. I enter some data in this secondary form and then click a button which takes a calculated value and populates a field on the main form and then closes the second form. The problem is that when it returns to the main form it seems to have lost the original record, as if it's back in Add mode. However, if I enter data on the main form and then simply close it, I can re-open it (in Edit mode) and open the 2nd form and back again without any problem. Sorry for the long-winded explanation but hope someone can help.
I've been programming Access for almost 20 years, and I've never found a use for Add mode. In other words, it has always been more trouble than it is worth.
Since you are coding already, I would just use DoCmd.GoToRecord , , acNewRec where needed to take you to a new record. Just make sure AllowAdditions is set to Yes in form properties.
Since this question is very general, it is hard to get any more specific than this. But if you do run into a specific problem that you can demonstrate in your code, update your question and I'll take a look.

Function across multiple view controllers

I am trying to make a function so that I request a 'manager override' where it presents a screen for a manager to enter their password and press an approve button. How should I do this? Will it have to be in multiple functions? Is there a way that I can call one function and it present the information back? Would a completion work for what I need? I have no ideas where to start for this.
My set up is as follows:
A view controller asks for manager approval, then a screen slides up with text boxes and an approve button. I want the approve button to trigger authenticating and dismissing the screen
Assuming you don't want a Framework target (that sounds like overkill for what you want) simply mark the function as "public" and move it outside of any class. I just tried in a sample project and it works.
It looks important - remember to keep it in a file already in the project. (My sample project didn't work with menu option File|Add|New|File.)
Now, if you really want portability, check out how to create a Framework project.

Prevent users from typing and clicking in MS Word Add-in

I am writting a MS Word Add-in, I create a button to run a long time work with text. My work requires that during the time it is excuted, no change can be made by user ( typing, clicking, deleting ...) When this work is completed, user can type and click as usual.
I have used
this.Application.Options.AllowClickAndTypeMouse = false;
However, this doesn't work.
Who can help me!
First, your approach is wrong. The Click and Type is Word functionality and has nothing to do with disabling user Mouse clicks
(For more information about Click and Type refer to here).
Now for your question, here is one approach I would suggest:
If the user is not able to do any action, I would expect an appropriate message, so my idea is to create a modal form by using:
myForm.ShowDialog();
It should do the job and block the active document until it get closed.
I would also add a nice progress bar and "Close" button which you will enable when work has done.

MFMailComposeViewController and cancelling "save" action sheet?

i am using MFMailComposeViewController inside my iphone app. I notice that if i enter any text in the body and then press the cancel button, i am prompted with an action sheet with an option to save/don't save the unsent message. I have two questions:
can I programmatically prevent the "save/don't save action sheet from appearing? MFMailComposeViewControllerDelegate doesn't appear to have anything along those lines
if i do save, where is the mail saved to? i looked in my mail accounts and didn't see anything saved in any of the "draft" folders.
No, you can't avoid the action sheet appearing. It's been added in iOS 4.x to, precisely, avoid tapping on the "Cancel" button inadvertently when writing a long email, which I think it's a good idea.
It is saved in "Drafts" folder of the account used to compose the e-mail (normally, your "default account" as it is registered in the Settings of your device). I've just tried using a couple of apps and it works.