nsnotification

Can I call -indexPathsForVisibleRows after scrolling UITableView without subclassing?

After each scroll (however large or small) of a UITableView, I would like to call -indexPathsForVisibleRows to run a method on the data that corresponds to visible cells. Are there any existing notifications or delegate methods I can tap into when a UITableView is scrolled? I'd like to avoid subclassing. EDIT I ended up subscribing t...

UITableView using NSMutableArray to display dynamic content

Been looking for a solution for a long while now, but still no success, perhaps someone here can help me. I created an application that runs a thread that communicates with a webserver in the background. Occasionally the thread receives information that I'd like to display in a UITableView. Because of the dynamic nature of the content I...

What is NSNotification?

Can anybody explain the importance of NSNotificationCenter? Where to use them? What is the difference between NSNotificationCenter vs. AppDelegate? ...

How to check for request time out , is there a notification I can set ?

Hello all I want to check for whether the request has timed out after some period. I know NSNotifiactionCenter ,but don't know how to set the request time out notification for it. thanks. ...

Use NSFilehandle to serial-port communication ,why don't receive NSFilehandle's notification .

my source-code as belowed : a part of source-code as belowed : - (id)init { NSFileHandle *fh =[[NSFileHandle alloc] initWithFileDescriptor:myfileDescriptor closeOnDealloc:YES]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter addObserver:self selector: @selector(getData:) ...

NSNotification the right choice for detecting changes?

I have a custom subclass of UIView that needs to perform a selector when a value (NSInteger) falls below a certain value. From what I can tell from the docs, I need to set up an observer object to look for this change. The NSInteger value exists in the view controller and the UIView subclass is implemented as a subview in the same view...

UIWebView/MPMoviePlayerController and the "Done" button

I am using the UIWebView to load both streaming audio and video. I have properly set up the UIWebView delegate and I am receiving webViewDidStartLoading and webViewFinishedLoading events perfectly. The webview launches a full screen window (likely a MPMoviePlayerController) Apple's MoviePlayer example gets the array of Windows to deter...

UIImagePickerController: Detecting Camera button (shutter) pressed

I would like to call a method that takes an NSNotification immediately after the user presses the camera shutter (i.e when the "Preview" tab bar has the buttons "Retake" and "Use"). I can't use the didFinishPickingImage method because at this time the user has already pressed the "Use" button. I have already implemented this by camer...

How to create a class to send and receive events through NSNotificationCenter in Objective-C?

Hi, I need to create two classes and both should be able to send and receive the events through the NSNotificationCenter methods.ie Both should have the sendEvent and receiveEvent methods: @implementation Class A -(void)sendEvent { addObserver:--- name:---- object:--- } -(void)ReceiveEvent { postNotificationName: --- object...

Custom Keyboard (iPhone), UIKeyboardDidShowNotification and UITableViewController

On an iPhone App, I've got a custom keyboard which works like the standard keyboard; it appears if a custom textfield becomes first responder and hides if the field resigns first responder. I'm also posting the Generic UIKeyboardWillShowNotification, UIKeyboardDidShowNotification and their hiding counterparts, like follows: NSMutableDic...

Notification not being recognised

I am trying to post a notification without much success! I can do it ok for the keyboard without issue but now am trying a custom one as follows: In my rootview I have this .h -(void) allowEdits:(NSNotification *)notification; .m //this section is run in method to present the passcode entry form [[NSNotificationCenter defaultCen...

Implementation of MVC with SQLite and NSURLConnection, use cases?

I'm interested in knowing how others have implemented/designed database & web services in their iphone app and how they simplified it for the entire application. My application is dependent on these services and I can't figure out a efficient way to use them together due to the (semi)complexity of my requirements. My past attempts on com...

How do I make my NSNotification trigger a selector?

Here's the code: - (void)viewDidLoad { [super viewDidLoad]; NSURL *musicURL = [NSURL URLWithString:@"http://live-three2.dmd2.ch/buureradio/buureradio.m3u"]; if([musicURL scheme]) { MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:musicURL]; if (mp) { ...

Tableview reload data problem iphone sdk

Hi all, I have a class A which is a subclass of uitableviewcontroller and one more class B which actually displays my tableview with its content is a subclass of A. There's an xml parser which parses my xml and stores the content in an nsmutablearray of application delegate. Now, I fetch this delegate array into a local nsmutablearray ...

NSNotificationCenter selector not being called

Hi, In my iPad app, in one class I register for a notification: NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(selectedList:) name:@"TTSelectedList" object:nil]; My selectedList: method looks like this: - (void)selectedList:(NSNotification*)notification { NSLog(@"rece...

Releasing while notifying

Hi there!, I have an object id currentObject; which I want to pass through notification. The problem is I don't know how to release it correctly and the memory management documentation is driving me crazy. I am doing it like this right now: [[NSNotificationCenter defaultCenter] postNotificationName:@"MessageReceived" object:nil us...

NSNotifications only being sent within the same object

Hey there, so I've got an NSObject subclass sending out a message via the notification center, and I'm sending out my notifications out to the object nil but the only object that can receive notifications is the one sending them I've got two notifications being sent out at the same time (to test if it is a threading issue) [[NSNotif...

MPMoviePlayer No Longer Seeks Forward and instead gives warning.

So it appears as though my MPMoviePlayer no longer wants to seek forward, despite it being the case that seeking is done internally by the MoviePlayer, so all I should be doing is setting up notifications in order to know that seeking is occurring. So I setup my notification as such: [[NSNotificationCenter defaultCenter] addObserver:se...

NSNotification to detect other program's crashes

I was planning on writing a small daemon that detected whether another app crashed, thinking all the while that the system would send an NSWorkspaceDidTerminateApplicationNotification, but this is not the case. Assuming that I do not want to create a launchd process to simply re-launch the crashed application, can I detect the crash an...

"Delivering Notifications To Particular Threads" - Exception when run on iPhone hardware

I have implemented thread-targeted notifications as per the Apple document "Delivering Notifications To Particular Threads" (http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Notifications/Articles/Threading.html#//apple_ref/doc/uid/20001289-CEGJFDFG) in my app, and it works great when run in the Simulator (iPhone 4 ...