nsnotifications Questions
11
Solved
Where should I remove the observer for NSNotification in Swift, since viewDidUnload and dealloc() are unavailable?
Footstool asked 24/2, 2015 at 7:8
7
Solved
I'm implementing socket.io in my swift ios app.
Currently on several panels I'm listening to the server and wait for incoming messages. I'm doing so by calling the getChatMessage function in each...
Cense asked 28/4, 2016 at 9:47
8
Solved
I have a NSNotification that is posting a NSDictionary:
NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:
anItemID, @"ItemID",
[NSString stringWithFormat:@"%i",q], @"Quantity",
...
Rectangle asked 19/7, 2011 at 14:16
3
Solved
I am trying to run a program in a background process that will register every shutdown event in the system.
Doing so by registering to NSWorkspaceWillPowerOffNotification as show below:
#import &...
Jennettejenni asked 6/9, 2017 at 23:29
5
Solved
Right now the API doesn't seem to provide a way to detect if an observer has already been added for a particular NSNotification. What's the best way to avoid adding multiple NSNotification observer...
Evoy asked 14/4, 2011 at 4:9
4
I am trying to use a customized keyboard in my application, but I am hitting problems when trying to restrict it to one particular UITextField.
I based my code on this Xcode project (originally fo...
Bravado asked 22/10, 2009 at 0:6
9
Solved
I have an observer of NSNotification which is called twice. I do not know what to do with it.
I googled it but no solution found.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:...
Aboutface asked 13/10, 2011 at 8:11
6
Solved
I have some idea of which to use when but the exact usage is still not clear to me. Can someone explain with example?
Ahimsa asked 23/10, 2011 at 7:6
4
Solved
I could do this by using protocol and delegate but I would like to try with NSNotification
My task is sending an NSMutableArray via notification from one to another view. Is it possible to do
[[N...
Menial asked 24/7, 2012 at 14:46
13
Solved
In Objective-C, a custom notification is just a plain NSString, but it's not obvious in the WWDC version of Swift 3 just what it should be.
Colobus asked 18/6, 2016 at 17:28
3
Solved
The code below was working fine before Swift 4.2:
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillChange(notification:)), name: NSNotification.Name.UIKeyboardWillShow,...
Szechwan asked 23/9, 2018 at 12:34
5
Solved
I am trying to pass an object from my app delegate to a notification receiver in another class.
I want to pass integer messageTotal. Right now I have:
In Receiver:
- (void) receiveTestNotificati...
Strychnine asked 25/10, 2011 at 22:27
5
Solved
Within an App I make use of several viewcontrollers. On one viewcontroller an observer is initialized as follows:
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"MyNotification" o...
Heartburn asked 6/11, 2013 at 0:11
5
Solved
For some better understanding on what happens “under the hood”, I would love to do a complete trace of any notifications happening within my application.
Naïve as I am, the first thing I tried wa...
Warfield asked 16/9, 2010 at 9:11
1
I'm trying to move the view up when the keyboard pops up over the UITextfield which is placed on UIScrollView. I'm using UIKeyboardWillShowNotification and UIKeyboardWillHideNotification for this. ...
Radcliff asked 21/8, 2016 at 16:8
3
Solved
Is there an easy-to-grock pattern how to send a NSNotification (Objective C) | Notification (in Swift) and how to receive one? Code snippet? The docs write like 150 pages on the topic. Would like t...
Piece asked 20/4, 2010 at 15:28
2
I am trying to use the UITableView.keyboardDismissMode = UIScrollViewKeyboardDismissMode.Interactive, to be able to drag my keyboard up and down. However I can't find any way to track the keyboard ...
Dugger asked 17/7, 2015 at 10:49
2
Solved
My use case: I have a 'MainApp' which does the syncing of files.
I would like that 'MainApp' handles all server calls regarding syncing and other REST API calls such as document-sharing, etc.
On t...
Barrick asked 7/12, 2016 at 11:41
1
Trying to handle audio interruption in my project.
This code used to work in swift 4.
NotificationCenter.default.addObserver(self, selector: #selector(handleInterruption(_:)), name: NSNotificatio...
Frown asked 3/10, 2018 at 16:59
3
Solved
I created an extension for Notification.Name as below:
public extension Notification.Name {
public static let blahblahblah = Notification.Name(rawValue: "blahblahblah")
}
Now I want to ...
Unwept asked 18/10, 2017 at 20:19
2
Solved
How can I find out when a NSTabViewItem has been changed, i.e. a user has changed the view of an NSTabView?
Ideally I want to generate a notification but any solution would be welcome.
Forby asked 27/3, 2012 at 7:51
14
Solved
I have an objective C class. In it, I created a init method and set up a NSNotification in it
//Set up NSNotification
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(ge...
Solis asked 24/6, 2011 at 14:26
3
I am trying to bring my views up when the keyboard appears by modifying the bottom constrain to the keyboard height. But the keyboard height returned to me is varying.
When I tap on a textfield i...
Ayannaaycock asked 21/2, 2017 at 4:37
1
Solved
Is it just me, or did NotificationCenter become a hot mess in Swift 3? :)
I have the following setup:
// Yonder.swift
extension Notification.Name {
static let preferenceNotification = Notificat...
Dorkas asked 17/11, 2016 at 0:18
4
I understand what in Notification, poster and observer.
But I am quite unable to understand how our app or OS understands and sends the flag/notification to the observer-class?
What is the mecha...
Luker asked 30/6, 2013 at 7:50
1 Next >
© 2022 - 2024 — McMap. All rights reserved.