Questions tagged [nsnotificationcenter]

NSNotificationCenter allows to send and register for notifications in the Foundation framework, which is provided by Apple.

An NSNotificationCenter object (or simply, notification center) provides a mechanism for broadcasting information within a program. An NSNotificationCenter object is essentially a notification dispatch table. Notifications are differentiated according to their name and contain an object (the sender) as well as any specific data.

Objects register with a notification center to receive notifications (NSNotification objects) using the addObserver:selector:name:object: or addObserverForName:object:queue:usingBlock: methods. Each invocation of this method specifies a set of notifications. Therefore, objects may register as observers of different notification sets by calling these methods several times.

You can also post notifications with postNotification:, or create and post notifications with postNotificationName:object: and postNotificationName:object:userInfo:, where you may use custom names for your notifications.

References:

1577 questions
0
votes
1 answer

NSnotification center not working iOS

Last week I asked this question: Refresh the entire iOS app @Jim advised me to use the notification center. I was not able to figure out how to work with notifications and I was told to ask another question, I tried for the full week to figure it…
user1396737
  • 15
  • 1
  • 6
0
votes
2 answers

"Delegates or NSNotifications" Adjudging performance of code?

In my application, I have to display image files as a list in tableview, present them in full size and as multiple thumbnails. Hence basically I developed three seperate classes to handle these three views. Now to perform any file operations, I can…
0
votes
2 answers

how to post notification in Logos Tweak

I used the iOSOpenDev to create a Logos Tweak to hook the acknowledgeIncomingMessageWithId: of CTMessageCenter and I want to send notification by NSNotificationCenter to another app, but it doesn't work. I think that the NSNotificationCenter can…
Piosa
  • 1
  • 1
0
votes
2 answers

UITextFieldTextDidEndEditingNotification not working properly in TableVIew

I have a tableView in which I use an instance of a custom TableViewCell. In each custom cell, there's a textfield and a label. Each time the text on the textField changes, I need to do some update in another textField present on the main UIView of…
0
votes
1 answer

Why can't I rely on NSNotificationCenter using AVFoundation to loop video?

I loop my video played with AVFoundation video with the help of NSNotificationCenter and playerItemDidReachEnd: AVURLAsset *asset = [AVURLAsset URLAssetWithURL:url options:nil]; self.playerItem = [AVPlayerItem playerItemWithAsset:asset]; …
headkit
  • 3,307
  • 4
  • 53
  • 99
0
votes
1 answer

Updating a UILabel from another view using NSNotificationCenter

I'm updating a UILabel in another view using a method invoked using the NSNotification center. What I'm finding is that it's not working, the label remains unchanged until the view is reloaded at a later point (not using the method called by…
stackOverFlew
  • 1,479
  • 2
  • 31
  • 58
0
votes
2 answers

send application delegate message to current view without notification center

I want to display application delegate message such as "Application became active" (This is called when -applicationDidBecomeActive:application is called) on Window. One way is to use notification center like below: AppDelegate.m NSNotification *n…
Feel Physics
  • 2,783
  • 4
  • 25
  • 38
0
votes
1 answer

Is there a way to access the notifications shown in the notification center?

I have kind of to-do local notifications that are fired OK. So for example if 2 notifications have fired the badge number goes to 2. Now I like to handle these notifictaions also when the user just starts the app directly - not via the notifictaion…
user387184
  • 10,953
  • 12
  • 77
  • 147
0
votes
1 answer

What's the meaning of this piece of code?

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestAddressUpdatedNotification:) name:MTAddressUpdatedNotification …
generalzyq
  • 303
  • 3
  • 11
0
votes
1 answer

What happens when a nsnotification is sent to an inactive viewcontroller?

In my applicationWillEnterForeground, I check and send a notification if data refresh is necessary: [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshModelNotification" object:nil]; The only observer for that particular…
Steven
  • 1,049
  • 2
  • 14
  • 32
0
votes
3 answers

No orientation-related notifications are being fired. Why?

I want to be notified when the orientation of the device changes. I've setup a test method that's suppose to receive the notification. I'm trying several different observers to achieve that, and none of them are working. Why isn't testMethod being…
zakdances
  • 22,285
  • 32
  • 102
  • 173
0
votes
2 answers

How to move view up when a UIPickerView is displayed

I have a mainview with all of my textfields and buttons. For my textfields i am using the inputView to display UIPickerViews instead of the keyboards. I am wondering how I can main the view move up when a textfield is selected that way the picker…
user1450221
  • 109
  • 2
  • 12
0
votes
1 answer

Creating my own NSNotificationCenter, storing objects?

I'm trying to create my own NSNotificationCenter just to get better at programming. I am running into an EXC_BAD_ACCESS that I can't quite work out. My method: - (void)addObserver:(id)observer forKey:(NSString *)theKey withSelector:(SEL)block { …
Zaid Daghestani
  • 8,555
  • 3
  • 34
  • 44
0
votes
1 answer

NSNotificationCenter get notifications on NSMutableDictionary addObject

How can I get notifications with NSNotificationCenter when object is added to NSMutableDictionary? Also are there any notifications for immutable NSDictionary?
Shadowfax
  • 1,567
  • 2
  • 13
  • 16
0
votes
1 answer

Must I use a delegate to have information transfer back to the mainViewController?

I have a scoreboard app that has many UITextFields that holds the scores for each player of every round. When clicking on the text field, instead of just using the keyboard to input a score, I want to create another viewController (a popover or a…
1 2 3
99
100