I've seen many questions asked about how to add images to the simulator and have seen two answers:
Both worked great in everything previous to iOS SDK 4.0. Those same methods no longer work for me, and neither for anyone else that I have seen. I have tried to write an image to the photo library manually using the following chunk of code I found somewhere:
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{
UIAlertView *alert;
if (error) // Unable to save the image
alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Unable to save image to Photo Album."
delegate:self cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
else // All is well
alert = [[UIAlertView alloc] initWithTitle:@"Success"
message:@"Image saved to Photo Album."
delegate:self cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[alert show];
[alert release];
}
But it errors every time. So is it a problem with the write access of the simulator? or just some bug? I have already updated to the iOS 4.1 SDK in hopes of it being fixed, but it isn't.
The central component of the iOS SDK is Xcode, Apple's interactive development environment (IDE). Xcode facilitates building apps for OS X, iOS and WatchOS. Xcode includes the interface, the LLVM compiler, instruments and iOS simulator tools that make development and testing possible without an Apple device.
Overview. The iOS 13 SDK provides support for developing apps for iPhone devices running iOS 13. The SDK comes bundled with Xcode 11 available from the Mac App Store.
The iOS & iPadOS 14 SDK provides support to develop apps for iPhone, iPad, and iPod touch devices running iOS & iPadOS 14. The SDK comes bundled with Xcode 12, available from the Mac App Store.
I am using Xcode 3.2.4 with SDK 3.2, 4.0.1 and 4.1. The following steps worked for me: 1. Launch simulator 2. Drag an image from Finder to the simulator which will always launch Safari to show the image 3. CLICK and HOLD that click for a couple of seconds, then you will see a popup with a "Save Image" button
I had the same problem running iOS Simulator 4.3 Using user44990 answer above fixed the problem for me and subsequently browsing in Safari and hold-click to save an image worked for me. I suspect the first step creates the proper directory: ~/Library/Application Support/iPhone Simulator/4.3.2/Media/DCIM/100APPLE which enable the click and hold method to work.
This question is spot-on. All the current advice I've seen about dragging/dropping to Safari, creating DCIM\100APPLE, etc, are all ineffective in SDK 4.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With