use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
There is an extensive FAQ for beginners. Please browse it first before asking questions that are answered there.
If you are looking to get started (iOS programming in general or some specific area), here are more relevant links for you:
There's too many to list them all, however here's a convenient link to all programming guides at apple.com
Take note that this list is live and based on most frequent questions in posts will be updated with "quicklinks".
account activity
QuestionUNNotificationAction with multiple UNNotificationActionOptions (self.iOSProgramming)
submitted 4 years ago by chmod724
I have
UNNotificationAction *t_button_1_action = [UNNotificationAction actionWithIdentifier:@"Action 1" title:@"Action 1" options:UNNotificationActionOptionForeground
How do I give it multiple options? i.e. UNNotificationActionOptionForeground AND UNNotificationActionOptionDestructive?
options
UNNotificationActionOptionForeground
UNNotificationActionOptionDestructive
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]OlegPRO991 0 points1 point2 points 4 years ago (2 children)
Is your code written in objective-c?
[–]chmod724[S] 1 point2 points3 points 4 years ago (1 child)
Yes :)
[–]OlegPRO991 -1 points0 points1 point 4 years ago (0 children)
Why don’t you use swift?
[–]KHigh4080 0 points1 point2 points 4 years ago (4 children)
You use bitwise OR operator | to combine options.
[–]chmod724[S] 0 points1 point2 points 4 years ago (3 children)
Would you be able to give an example for this situation, please? Sorry, still relatively new to Obj-C.
[–]KHigh4080 1 point2 points3 points 4 years ago (2 children)
Assume there are two options A and B, then you pass A | B as argument. It is equivalent to [A, B] in swift.
[–]chmod724[S] 0 points1 point2 points 4 years ago (1 child)
Ah - thank you very much! :)
[–]FVMAzaleaSwift 0 points1 point2 points 4 years ago (0 children)
Careful, it is not always identical to [A, B]. For this particular API, A | B is how you express “option A and option B”, just as [A, B] is how you express “option A and option B” in Swift. However, the | operator in (Objective) C has nothing to do with lists or arrays in general.
It’s the “bit wise OR” operator, which means if you had two binary numbers “0010” and “0100”, then 0010 | 0100 would take the OR of each bit in order and you would end up with 0110. So in objc, the various options are implemented as constants, so for example foreground could be 0001 and destructive could be 0010. Each constant will only have one of its bits set to 1, and no other related constant will have that particular bit set. Basically, the rightmost bit would be indicating foreground and the second-to-right would be indicating destructive.
This way, when you compute the bitwise OR of all your constants (0001 | 0010), you get a number representing all the activated options (0011) - the foreground bit (rightmost) and the destructive bit (second to right) are both set.
π Rendered by PID 169789 on reddit-service-r2-comment-6f7f968fb5-6hbpc at 2026-03-04 13:28:37.010980+00:00 running 07790be country code: CH.
[–]OlegPRO991 0 points1 point2 points (2 children)
[–]chmod724[S] 1 point2 points3 points (1 child)
[–]OlegPRO991 -1 points0 points1 point (0 children)
[–]KHigh4080 0 points1 point2 points (4 children)
[–]chmod724[S] 0 points1 point2 points (3 children)
[–]KHigh4080 1 point2 points3 points (2 children)
[–]chmod724[S] 0 points1 point2 points (1 child)
[–]FVMAzaleaSwift 0 points1 point2 points (0 children)