StackOverflow hasn't answered iOS question. Can you?
-
I am desperately seeking help with an iOS programming problem and my StackOverflow question has not been (satisfactorily) answered 14 hours in. Can someone here help? Or tell me how to renew interest in the question in a way that doesn't violate etiquette? The question is http://stackoverflow.com/questions/12907082/ios-code-fails-on-other-machines-but-not-mine-with-nsfilemanager-copyitematpa/12909354#12909354. It may be that I don't understand something fundamental about bundles and builds, but I've looked at the Apple Developer documentation and I don't understand. Basically, my understanding is that the pList files for our app should not be 'packaged' into the apps for users, because they are not the sort of pLists that contain static info to be loaded into controls like table cell. Rather, they are for writing to, and will be written to .pdf at the appropriate time when the app runs. When users run the app, the pList files they need will be created at that time. I thought that this would be best simulated during development as each developer sees a new pList file created in their Simulator folder. I am under the impression that the contents of these folders are developer-specific. Am I wrong? Please help. If you need more info, I will be thread-sitting. Alternately, if you have advice on how to renew interest in my question on StackOverflow, or if it's ok to rephrase the question and repost it, please let me know.
-
Answer:
Would this be an accurate restatement of your question? NSString *bundle = [[NSBundle mainBundle]pathForResource:@"Family" ofType:@"plist"]; is returning nil when pathForResource points to a valid resource. This code works fine on the simulator on my machine, but not on my teammate's machines. Our machines were all loaded with the same OS image. What are some possible causes of this issue? What environment/network settings and permissions should I be checking? One other thought I had was--what happens when you run this on a fresh image? You say that all of these images are identical, but if your teammates have been working on them for a few months, things have almost certainly started changing.
kitcat at Ask.Metafilter.Com Visit the source
Other answers
Found file. I'm an idiot. On the computer I was using before, it didn't show a file extension, yadda yadda. So, I'm on the home computer now. Last night, nothing worked. It's working now!!!!!. Hooray!!!!I am only afraid that I will go to school tomorrow, get on the computer there, and encounter myriad problems again, but here is what I did to make it work: 1. Delete existing Family.plist from Documents folder. 2. Reset Simulator 3. Clean, Build project 4. Create new Family.plist in app project (Supporting Files group). 5. Confirm in Build Phases that its in Copy Bundle Resources 6. Confirm that Family.plist shows in .app Package Contents 6. Run in Simulator and pray.... 7. Experience NO crash!!!!!!!!!! 8. Check file in Documents folder 9. See that data has successfully been written!!!!!!!!!!!!! Honest to god, I could swear I did these things over and over today on the other machine. I'm going to merge with other teammmates' work, push to repository and pull down tomorrow on that machine. Then follow these steps again. I need a drink before I thank you all.
kitcat
Thank you everyone. This was really kind of an embarrassing gong show and at some points a wild goose chase (the machines weren't the problem, unless tomorrow proves otherwise). Now I can go back to the StackOverflow question and fix it so that it's helpful to others. I really appreciate the way mefites follow through to help others out instead of handing out half-hearted answers and walking away. Thank you for doing that. Every day lost on this project is a big deal, we don't have iOS-savvy people at our school to help, and it's a can't fail kind of thing, so it means a lot to me.
kitcat
I had a new answer in StackOverflow suggesting I confirm that the local filepath exists. To confirm the 'pListpath', I copied the path from the debugging console and, from my home directory in terminal, I used cd Library/Application Support/iPhone Simulator/5.1/Applications/4DBE18C2-B22B-4CA9-B3A2-EC42711CEC3F/Documents. It can't find that path! If I use the tab method to autocomplete the directory names for me, it does find the path, but with the strange format: Library/Application\ Support/iPhone\ Simulator/5.1/Applications/4DBE18C2-B22B-4CA9-B3A2-EC42711CEC3F/Documents/ Is this a clue?
kitcat
jonbro: Umm, yeah, xCode is installed as a user. I don't get that, but I don't get macs either. If that wasn't perfectly clear before.
kitcat
what the heck? do you have xcode installed as a separate user? do you have sudo access? can you check in /Users/xcode/Library/Application Support/ to see if that is where the simulator is running from?
jonbro
Looking for file. Hoping syntax was correct for bash search: find / -type f -name '*.app' produces nothing, but notably?: find: /Users/xcode/Desktop: Permission denied find: /Users/xcode/Documents: Permission denied find: /Users/xcode/Downloads: Permission denied find: /Users/xcode/Library: Permission denied find: /Users/xcode/Movies: Permission denied find: /Users/xcode/Music: Permission denied find: /Users/xcode/Pictures: Permission denied
kitcat
Yeah, you must have a .app somewhere on your system if it is in the simulator. Track that down. It is possible that your simulator directory is somewhere unexpected, or you are using a different sdk then you think you are using.
jonbro
Not an iOS programmer and just in case I'm not stating the obvious: "YourApp.app" is probably a placeholder name and you're supposed to replace "YourApp" with the name of your program. In other words, see if Family.plist is present your app's folder when being simulated.
ethidda
Sorry, everyone refers to yourApp.app, but I don't have such a beast. Just UUID/Documents. Is that a problem? Is it hidden?
kitcat
Related Q & A:
- How can i access the number of questions asked on stackoverflow?Best solution by Meta Stack Overflow
- Why can't I view any of the questions I have answered?Best solution by Meta Stack Overflow
- Why won't click events work for elements on iOS?Best solution by Stack Overflow
- Is there any way I can get my MSN password back if I don't know the secret question that it asks?Best solution by Yahoo! Answers
- Buyer hasn't paid for item on eBay?Best solution by pages.ebay.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.