Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
I'm sure it's just a couple of lines of code need to be changed, but I've tried several things and can't figure it out! Thanks to anyone that can help!
Downloading an online file is simple, changing it will require a bit of effort. You will need FTP access to the server to override the file.
I would recommend checking out Apple's SimpleFTPSample. You just need the upload functions as your already accessing the plist through a HTTPRequest(?). You can get the sample here: SimpleFTPSample
Downloading an online file is simple, changing it will require a bit of effort. You will need FTP access to the server to override the file.
I would recommend checking out Apple's SimpleFTPSample. You just need the upload functions as your already accessing the plist through a HTTPRequest(?). You can get the sample here: SimpleFTPSample
Well this is just an example. I just want to know how to change the code in the Xcode project to be able to access a file online. I have my own web server and what not so I know all about FTP and what not. My only problem is changing the code from accessing a local plist, to accessing it from a URL such as the one for TestData.plist.
Well this is just an example. I just want to know how to change the code in the Xcode project to be able to access a file online. I have my own web server and what not so I know all about FTP and what not. My only problem is changing the code from accessing a local plist, to accessing it from a URL such as the one for TestData.plist.
Thanks for the help!
Okie dokie, well your going to want to look at NSURLConnection. It allows you to download the contents of a URL.
Thanks I know of NSURLConnection, but I can't seem to get it working in this instance for some reason. I was hoping someone could help by showing the actual code I should change to.
Thanks I know of NSURLConnection, but I can't seem to get it working in this instance for some reason. I was hoping someone could help by showing the actual code I should change to.
So post the relevant section along with the changes you've made, and indicate what doesn't work.
Regards,
Duncan C WareTo
Animated GIF created with Face Dancer, available for free in the app store.
Urgh I've been trying different stuff all day, and can't figure it out! I'm frustrated with myself haha. No but seriously I am a very beginner coder and thought I was starting to understand Objective-C a little better, but now just got more confused.
Urgh I've been trying different stuff all day, and can't figure it out! I'm frustrated with myself haha. No but seriously I am a very beginner coder and thought I was starting to understand Objective-C a little better, but now just got more confused.
Okay well we need more information to help.
The only difference between the two code snippets you've posted is the last line.
I see you are just passing the array onto libraryContent, but connection wise its the same, which works. So are you getting a specific error or the UITableView is empty?
I see you are just passing the array onto libraryContent, but connection wise its the same, which works. So are you getting a specific error or the UITableView is empty?
Well I believe I have found out two issues I'm having but unfortunately don't know how to solve them.
The first is that if you check out the TestData.plist that's hosted here, you'll see that this line of code would not work for it:
So just by glance it doesn't seem like this would work. I think I'm making it harder than it needs to be. This may seem like a big request, but I was wondering if one of you could download the sample code from the site here, and try and get it to work. Sorry again for this. Like I said I'm making it a lot more confusing than it needs to be, and one of you will probably be able to figure it out in literally 2-3 minutes.
This was in the DvdLibraryDao.m. Sorry for being such a newbie about this. I just don't know a whole lot.
Your first block of code for parsing a text file is fine. The second block of code for treating the data as a plist is completely wrong.
You should read the data as NSData, not a string. It would be trivially simple to replace your call to initWithContentsOfFile to initWithConentsOfURL:
Replies
I would recommend checking out Apple's SimpleFTPSample. You just need the upload functions as your already accessing the plist through a HTTPRequest(?). You can get the sample here: SimpleFTPSample
This would just be a single file you are downloading and uploading. Multiple users would be accessing the same file from (For example)http://www.iphonedevcentral.com/wp-content/uploads/2009/07/TestData.plist and modifying it. Is this your intention?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThanks for the help!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThere are plenty examples from Apple on Using NSURLConnection
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeDuncan C
WareTo
Animated GIF created with Face Dancer, available for free in the app store.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeSo I tried something similar here, but I didn't think it would work:
This was in the DvdLibraryDao.m. Sorry for being such a newbie about this. I just don't know a whole lot.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThe only difference between the two code snippets you've posted is the last line.
v.s.
I see you are just passing the array onto libraryContent, but connection wise its the same, which works. So are you getting a specific error or the UITableView is empty?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThe first is that if you check out the TestData.plist that's hosted here, you'll see that this line of code would not work for it:
So I need to find a way to create the plist as an NSArray without using componentsSeperatedByString. I'm not entirely sure how to do this.
The second problem is that in the original code you see here:
I'm replacing it with this:
So just by glance it doesn't seem like this would work. I think I'm making it harder than it needs to be. This may seem like a big request, but I was wondering if one of you could download the sample code from the site here, and try and get it to work. Sorry again for this. Like I said I'm making it a lot more confusing than it needs to be, and one of you will probably be able to figure it out in literally 2-3 minutes.
Thanks again, Jordan
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeSo I tried something similar here, but I didn't think it would work:
This was in the DvdLibraryDao.m. Sorry for being such a newbie about this. I just don't know a whole lot.
Your first block of code for parsing a text file is fine. The second block of code for treating the data as a plist is completely wrong.
You should read the data as NSData, not a string. It would be trivially simple to replace your call to initWithContentsOfFile to initWithConentsOfURL:
Duncan C
WareTo
Animated GIF created with Face Dancer, available for free in the app store.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome