Tag: nsnotificationcenter

PushNotifications iOS 7 not working when user taps on icon

I have the methods below to handle push notifications. They work perfect when the app is running and I do receive notifications when the app is in the background. When a user taps the icon however it opens the app but my UICollection view is not reloaded the way it is when a user receives […]

big problem with the NSNotificationCenter, it doesn't update the display of the target

Help, I’m deperate..i can’t continue my app because of this: I have setup one message between 2 of my cocoa objective-c clases, the main appdelegate is messaging a view through NSNotificationCenter the view receives indeed the notification but somehow it can’t update the controls visible on the view.. it’s like it can’t find the proper […]

Clicking on Like all the view should show like ojective C

When I select Throwback -> Description occurs if I click on like button the like button changes to unlike and ” like count=1099″ increases. If I press back I want this unlike to be displayed next to Throwback let say in a label and again select Throwback button should display unlike and like Count should […]

How to know where crash for postNotificationName:object:userInfo

Is there some method to know crash reason in Xcode 4.6? The crash stack is : Exception Type: SIGSEGV Exception Codes: SEGV_ACCERR at 0xd9f2c061 Crashed Thread: 0 Thread 0 Crashed: 0 libobjc.A.dylib 0x3a74f5aa objc_msgSend + 10 1 Foundation 0x33157599 -[NSNotificationCenter postNotificationName:object:userInfo:] + 73 2 UIKit 0x347830cd -[UIApplication _handleApplicationSuspend:eventInfo:] + 733 3 UIKit 0x346f91e7 -[UIApplication handleEvent:withNewEvent:] […]

iOS NSNotificationCenter Observer not being removed

I have the following code within AppDelegate. The purpose being to create a couple of observers, and then call some code. Once that code completes it then posts a notification, and the observer should then remove both observers and call the completion handler. My issue is that it appears that the observers are not being […]

How NSNotification works

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 mechanism behind this? Your answer and help will be appreciated a lot. Thanks ID.

How To set Custom repeat interval For Nslocal Notification…?

i am New to iphone Development .I Am Trying To Use NslocalNotification In My Project I Need To Give Remeinder For Every 2Hours or For Every Two Days Or For Every Two Months Etc..Currently I am Using NslocalNotification Repeat Interval .But Its Working For Only Every Minute For Every Hour using Nscalender …. NSString *InterVal=[freQuencyArr […]

kReachabilityChangedNotification is called multiple times

I’m using the Reachability classes for checking when I got an internet connection en when it goes down. This is my code: IN VIEW DID LOAD: internetReachable = [Reachability reachabilityForInternetConnection]; [internetReachable startNotifier]; // check if a pathway to a random host exists hostReachable = [Reachability reachabilityWithHostname:@”www.google.com”]; [hostReachable startNotifier]; Then the notification method -(void) checkNetworkStatus:(NSNotification *)notice […]

How do I check if an UIViewController is currently being displayed?

How do I check if an UIViewController is currently being displayed? My UIViewControllers are listening for NSNotifications – even if when they are not displayed (ie not shown). So I could have 10 UIViewController in the background observing NSNotifications from NSNotificationCenter. When an NSNotification is posted and received by the UIViewController, I’d like to find […]

Is NSNotificationCenter thread safe?

Can I post a notification in a given queue and receive it on another? I want to use notifications to communicate different queues, but I’m not sure if this is safe…