Can anyone help me enable a delete button in ABPersonViewController
?
Asked
Active
Viewed 1,716 times
2 Answers
2
Take a look at ABPersonViewController+Delete category which does not use any private methods:

Marco
- 6,692
- 2
- 27
- 38
-
this is the exact same thing as below and almost certainly uses a private API – ecbtln Apr 13 '12 at 04:10
0
For me this code works:
ABPersonViewController *pvc = [[ABPersonViewController alloc] init];
[pvc setPersonViewDelegate:self];
[pvc setAllowsEditing:YES];
[pvc setAllowsDeletion:YES];
[pvc setAllowsActions:YES];
-
It should be mentioned that his is a hidden method that may cause your app to be rejected from the App Store. Also, you should do a test before using the method (`if (pvc respondsToSelector:@selector(setAllowsDeletion:))`). – David Beck Apr 10 '11 at 15:07
-
it results in compile error because setAllowsDeletion is a private method – user4951 Mar 30 '13 at 16:43
-
I manage to get it working with [picker setValue:[NSNumber numberWithBool:YES] forKey:@"allowsDeletion"];. However, after delete, the windows doesn't pop up. There is no on delete delegate. – user4951 Mar 30 '13 at 17:02
-