I have been using FTP on an iPhone 3GS in my app for almost a year with no problems. On my new iPhone 4 FTP fails all the time when using the 3G network. I have tried on 4 other iPhone 4's with the same result. I have tried multiple FTP servers with the same result.
Steps to Reproduce:
1) Turn off wifi on iPhone 4.
2) Build and install code example SimpleFTPSample.
3) "Put" the lower right image (the larger the better. you may need to retry a few times to see the error)
You will see "Network write error". I added some debugging code to print out the actual error and this is what I got.
An error occured during FTP transfer
Description : The operation couldn’t be completed. Cannot allocate memory
Failure Reason : Cannot allocate memory
Recover Suggestion: (null)
Error Domain : NSPOSIXErrorDomain
Error Code : 12
Any ideas for working around this?
This ended up being a bug in apples code back when I posted this
Related
I've run into a funny problem. Our app, which was working prior to Saturday, can't connect to the server to get the necessary data. The server is fine, everything is up and running and I have rebooted it. The Support Tech has said the same. So it points to either the code having something that didn't change, or the ip/database info changed and the code is using the old info; as far as I know, we've changed nothing. Will I have to check the code?(I didn't write it, someone was hired to do it) or is there something else that could be causing the problem?
The error message:
"The app is currently unable to connect to the server. Please try again."
It's a very unspecific error message so I'm assuming the developers of the app put that specific message in themselves.
Assuming you have the app on an iPhone you may be able to diagnose (but not necessarily fix) this without getting into the code. Download Fiddler and use this tutorial to setup the iPhone so you can watch the network traffic. This will allow you to see exactly what requests the app is making to the server and you may be able to figure out the problem. Either your request isn't making it to the server or the server is returning an error message. Either way Fiddler should be able to give you that answer.
EDIT:
HTTP Scoop is a pretty easy to use client for the Mac that does what Fiddler does for PC. You can use it for free for 2 weeks so that should be enough to help you out.
Charles would also work. I know you can get a free trial for that as well.
My application allows the user to download relatively large files (~120 MB) from my own dedicated server. I'm using the ASIHTTPRequest library for downloading.
It may sound weird, but everything worked fine until yesterday. I've tried downloading files countless times both from my app (on an iPad) and a Mac, and while on the Mac the download succeeds, on the iPad it randomly times out. Sometimes it goes until 100%, sometimes it reaches 30%-40% or something and then ASIHTTPRequest's downloadFailed: selector gets called. If I print out the error's localizedDescription, I get "The request timed out".
What could this mean? Could it be a problem of my app? Or a problem with my server, or my connection? I realize this could depend on several factors, so please ask me any information you need if necessary. Thanks.
I had weird network situations like timeouts on my ipad when using wifi that started after the upgrade to 4.2, but were intermittent.
Going to Settings -> General -> Reset Network settings and then reentering the wifi settings solved it for me.
(Also check that someone hasn't recently setup a new nearby wifi access point on the same channel as your network!)
Does your server have limit about the number of connections ? I encountered a problem because the number of connections are too much, then the server declines those connections. Then, they are time out.
Do you use WiFi or 3G connection? Non-WiFi connection allows to download files with maximum size of 20Mb only.
Part of the functionality Ive written for an app is downloading zip files from a server using NSMutableURLRequest. All works until I try to download a file approx greater than 12MB.
The iPhone is on wireless lan.
I was wondering if there is a limit or max chunk size to implement when downloading larger files?
I fails for these file sizes on both simulator and device. The application just crashes and
didFailWithError connection delegate is never hit.
Ive been stumped by this for days now :(
Your help is much appreciated.
Tony
You're likely getting low memory warning and that cause application to crash. Check similar question - you can write the data you recieve directly into file, rather then into memory. You can use NSFileHandle class for that.
I recently had an app rejected from the app store because of Low Memory Exception. The app doesn't leak memory, but its base memory footprint seems to be too high. According to the crash logs sent by apple, it was taking about 14000 pages in the memory (mostly due to huge textures). There were 2 strange things though:
I tested it on 5 devices rigorously before submitting, and never got this crash on any one of them.
I did optimize the textures after the rejection, and brought them to about half the original size (texture memory consumption).
I have no way of knowing how many pages my app is taking now, unless I can reproduce the same crash as apple (which I never could). Is there another way to be able to find out the memory footprint of my app, so that I can be sure that it is optimized enough now.
I did try instruments, but my app crashes when I try to run it through my XCode (must be some problem with my XCode). But it works perfectly when I run it directly on my iPhones/iPods. Any help in finding out the memory footprint of my app on iPhone (if there is something analogous to task manager of windows), would be appreciated.
Thanks
EDIT:
Launching the app from XCode gives the following error in the console:
"Error launching remote program: failed to get the task for process 553."
Launching the app with Activity Monitor gives the following error:
"Target terminated too early to collect data"
EDIT2:
I was able to run my app with Activity Monitor, by using a dev profile instead of distribution profile. But now there are several sections in the Activity Monitor - Physical Memory Used, Real Memory, Virtual Memory. Which one of these do I consider. To sum it up, I need to know which one of these causes the iPhone to throw a Low Memory exception.
XCode -> Run -> Run With Performance Tool -> Activity Monitor.
If the device is connected, Activity Monitor runs on the iPhone/iTouch.
I think you're coming at this from the wrong angle. You're asking how to find the memory footprint without using XCode. I think the question you should be asking is: why can you not use XCode? Presumably that's what you used to develop the application in the first place?
Without XCode you're pretty much flying blind. You say you halved the size of your textures, but how do you know? Does your app release any extraneous memory when it gets a low memory warning? (applicationDidReceiveMemoryWarning:)
First, have you looked at the crash logs from when you run your app from XCode? You should be able to see them in the Organiser in XCode.
I'm not sure there's a single solution to stop your app crashing with XCode. Normally when my iPhone won't allow debugging I just restart xCode and my handset and it starts working again. Restarting XCode sometimes helps. I would also try reinstalling both XCode and the iPhone SDK.
Your mobile device has encountered an unexpected error(0xE800002E)
Try disconnecting and powering off the device;then power the device on and reconnect it.
I received these message so many times. How can I fix it?
Although you can see this error when you connect in XCode, it is not actually an Xcode defect.
See this thread at Apple's discussion boards. You basically need to reset you phone. I'm not sure but Ithink there may be a link between seeing this error and using your phone for development but I have no concrete evidence.
I find that if I plug my device in and its set to automatically run iPhoto - then you must let iPhoto load and let it try to sync photos before you quit it. Then you should be able to use XCode to load an application on to your phone.
If you do get the error - unplug the device, turn it off and then back on, and that usually clears up the problem