mapViewDidFinishLoadingMap: called too early - objective-c

My problem is simple: I'm waiting to take a screenshot of an MKMapView, and I want to do it only once the map is loaded. Unfortunately, this delegate method is almost always called before the map is actually loaded. I just get a grid, or a few loaded tiles if I'm lucky. Is there a good way to do what I need to do? Or am I missing something in the MKMapViewDelegate protocol?
Thanks!

Perhaps you could try adding a timer and then take the screenshot in the completion block of the timer. Or perhaps, use the mapView:didUpdateUserLocation: delegate method as the callback for the screenshot instead of mapView:DidFinishLoadingMap:

It seems this is one of the many bugs in MapKit in iOS 6. Hopefully it will be fixed with iOS 7.

Related

In Sybase SUP, do you have suggestions for non-example startup?

All,
Maybe I'm thinking too much about this. All of the examples I have seen seem to cover starting a (iOS) native App from the AppDelegate. I'm not excited about this, but I can't get around it so that it feels more comfortable. Are you doing something different, and how?
Thanks.
You can simply move the processing of initializing the SUP connection from the AppDelegate's applicationDidFinishLaunching method to the viewDidLoad method of your main view controller class.
You would also need to move the NotificationCenter handler methods to your main view controller class.

Extend Gesture Length

I've come across a problem to which the simplest solution would be to extend the length of a UIGestureRecognizer. What I mean is that I need the iOS device to still believe the user has their finger on the screen for about 0.1 seconds after they release it. I need the device to think that the finger is in the exact same position for the 0.1 seconds as it was when the user released this.
Any help as to weather this is possible would be greatly appreciated!
Thank you!!!
EDIT:
Sorry for the late reply, I've been really busy with work.
To elaborate, I'm using a set of classes made by Alan Quartermain called AQGridView. It's a class that strongly resembles UITableView; however, it displays data in a grid instead of a list. There appears to be a bug where (if I understand correctly, and I may very well not) the data of the grid is reloaded before the delegate method, that is called when a user ends a UIGestureRecognizer, finishes if the user releases their finger while dragging a cell (from one grid index to another) very quickly. This causes a graphical glitch (which can be recreated in the springboard example that comes with the class set) where the dragging cell appears to settle one cell before or after it's appropriate location, and then quickly jumps to it's proper location. I believe this is because there is a brief period, when the user releases their finger, where the grids count is -1 of what it is when the cell settles.
This is a poor explanation of the problem, but the best I could come up with. As well, I'm a relatively new developer and could be way off on the cause of the problem. That is why I believe the most appropriate fix would be to extend the gesture length by a very small amount. If anyone wants to take a look at the AQGridView classes (https://github.com/AlanQuatermain/AQGridView/) I would really appreciate it! But if possible a simpler fix would just be to simulate the touch that the user inputed right before they released their finger so that the desired animation occurs.
Inside touchesEnded delegate method, start timer for 0.1 second and perform your selector.
You can even, subclass UIGestureRecogniser and implement your own gestures, Check the first answer of this question.
See : custom iOS gesture

iOS - Asynchronous Image Downloading

I am writing an app which is going to be displaying images found on my server in a UIImageView.
I need something that will asynchronously download the image and cache it while putting it in the UIImageView.
The download also needs to be able to be cancelled when I press a button.
Can anyone point me in the direction of something that can do this?
In the old times the framework for that was ASIHTTPRequest but is an abandoned project now. This https://github.com/AFNetworking/AFNetworking seems to be popular now.
Use the performSelectorInBackground:withObject: - method from NSObject ;)
Advise: The updating of the view must run on the main thread!
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/nsobject_Class/Reference/Reference.html

Need to call a Method when we Zoom into the Map

I am implementing a MapKit based application. I had a problem in that, my problem is when we zoom into the map I need to call a method. I have no idea to get implement this one. Can you guys please help on this.
Thanking you,
Sekhar Bethalam.
I haven't worked with the MapKit before, but it follows Apple's Delegate Pattern.
You'll want to implement the delegates described in Apple's LocationAwarenessProgramGuide
To check for a zoom, the region you're moving to should be smaller than the region you just viewed. Then, just call the method you need to.

What are some reasons that application:didFinishLaunchingWithOptions method could get skipped?

My iPad app was working fine until I opened up IB and started editing the interface. Now, my application:didFinishLaunchingWithOptions isn't getting called. I understand it's an optional function and it gets skipped if it doesn't exist, but in my case it does. What are some reasons that application:didFinishLaunchingWithOptions method could get skipped?
I should note that I'm building with the iPhone OS 3.2 SDK.
Thanks in advance for your help!
UPDATE: I fixed it, please see my answer below
Are you sure that class has been set as the application delegate of the app?
(source: xanga.com)
And also make sure the "File's Owner"'s delegate has been linked to "App Delegate".
(source: xanga.com)
Well it turns out, for an unknown reason, I had a "view" view object as a child of my RootViewController in IB that didn't serve any purpose except to hold my a TableView view object and a DatePicker view object. I thought it was harmless, but when I removed it in IB and programmatically added the TableView object and and DatePicker object, suddenly this problem went away. If anyone has any ideas why this is, I'd would love to understand it.
Thanks, everyone!