NimbleKit - fast iOS app development

Relative path?

Problem discussions

Re: Relative path?

Postby d0csp33d » Fri Jul 17, 2009 6:36 pm

Andy:

Can I use the Resources folder as a subfolder for my other html pages? My original app has more than 300 html files/pages and I don't want to place them in the html directory.
User avatar
d0csp33d
 
Posts: 175
Joined: Mon Jul 13, 2009 2:23 pm

Re: Relative path?

Postby HughJohnson » Fri Jul 17, 2009 7:49 pm

Andy: I think your issue is with Apple using the same icon graphic for folders as groups. I think they are conceptially different but close enough to use the same icon (they are different colors, yellow vs blue). I think groups are more like playlists in iTunes or something. You can move stuff around but it doesn't change the physical location of the files on the hard drive.

After a bit of testing I found you can have sub-folders (in some cases) and use the project window to manage your files in Xcode as well as the finder, here is how:

Create a folder in the finder called main, inside this folder create a folder called images. Inside the image folder put some image files.

Create a new Xcode project (using the "Nimble Kit Application" template.

Take the main folder from the finder and drag it to the "Groups & Files" area in the project window (the one seen in Andy's screen shot above). I used these settings to import my folder:

image_1.jpg
image_1.jpg (10.1 KiB) Viewed 458 times


It will then make a copy of your folder inside your project folder in the finder, as well as make the blue folders in Xcode.

Then edited main.html to have something like:

Code: Select all
<img src="main/images/image_2.png" />


Now to add more images you simply have to add them to the image folder in the finder. You might have to close and reopen the 'triangle' icon next to the folder icon in the project window to show your changes. If you replace images in the finder you might also have to do a Clean before you build your project to reflect your changed files.

This does not seem to work with html pages. But it does with javascript files and images, and probably other files as well.

Here is a project file to make it easier to understand, notice the javascript and images folders have blue icons instead of yellow. I hope it works, you might need the latest beta or something. Run this sample, if that image shows, and you can click it to get an alert, then sub-folders work.
Attachments
sub_folders.zip
(20.1 KiB) Downloaded 50 times
Image
User avatar
HughJohnson
NimbleKit Expert
 
Posts: 286
Joined: Thu Jun 18, 2009 4:44 pm

Re: Relative path?

Postby d0csp33d » Fri Jul 17, 2009 8:22 pm

I need subfolders for html files.

I will have to wait for an update for this before I submit my app into the app store.
User avatar
d0csp33d
 
Posts: 175
Joined: Mon Jul 13, 2009 2:23 pm

Re: Relative path?

Postby Andy Baird » Sat Jul 18, 2009 2:21 am

Ah! I assumed that a folder was a directory. Silly me. Just because that's been true for the past 22 years doesn't mean Apple has to stay consistent. ;-) Seriously, thanks a lot, Hugh. Once again my lack of familiarity with the SDK's.. uh.. unique way of doing things has tripped me up. Probably won't be the last time. Following your instructions, I was able to create a project with blue folders as well as the yellow ones I was used to seeing, and to embed this inspiring image in it:

Snap.jpg
Snap.jpg (27.06 KiB) Viewed 447 times

How peculiar that your method doesn't work with HTML files, though... and how unfortunate for our friend "d0csp33d". (Sir or madam: do you have a name? It's much friendlier when we know who we're talking with. :-)

However, if I were in "d0csp33d's" shoes, I don't think I'd let this situation prevent me from building and submitting my app. These yellow folders may not be real subdirectories, but they can be used to prevent visual clutter while developing the project... one just has to remember not to include them in one's paths. Perhaps there are aspects of the project that I'm not able to envision, but from what he or she has said so far, it doesn't seem as though there's any insuperable obstacle to going ahead with it.

Andy Baird
User avatar
Andy Baird
 
Posts: 113
Joined: Sat May 30, 2009 10:32 pm
Location: On the road in the southwestern US

Re: Relative path?

Postby sunny » Sat Jul 18, 2009 2:30 am

if there are hundreds of files I suppose it's worth thinking about generation those files dynamically maybe similar to what was done in Image Library tutorial on the web-site. It can be nice just to make pattern pages and load all the data from database.
This way it is possible to change design later, once and for all pages. Otherwise a small change will require lots of time
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Relative path?

Postby d0csp33d » Sat Jul 18, 2009 2:36 am

Hi Andy:

I am male. 8-)
I have been working with my apps all this week more than ever and will try to do my best to submit them into the app store in August (maybe 1st or 2nd week). I will publish my website and apps as soon as they are submitted, so you will know me better after this. I am developing two apps that are still unavailable (as a kind) and would like to keep it a secret. My apps will be for a special large group (medical), its not a game or music related app. I have purchased many iphone developing books but it has been very hard for me, since my Cocoa or C+ knowledge is smaller that an ant; my only strong knowledge is html and php. Therefore nimblekit is my only real solution right now.

Best regards!


Hi Sunny:
My app was already built when I found nimblekit. I was using phonegap and it lets me use subfolders. I prefer nimble kit. I will search the web for a solution.
User avatar
d0csp33d
 
Posts: 175
Joined: Mon Jul 13, 2009 2:23 pm

Re: Relative path?

Postby sunny » Sat Jul 18, 2009 2:49 am

ok, relative paths will be in 1.5. Will work on them tomorrow
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Relative path?

Postby d0csp33d » Sat Jul 18, 2009 2:54 am

WOW THANKS!!! :o :o
User avatar
d0csp33d
 
Posts: 175
Joined: Mon Jul 13, 2009 2:23 pm

Re: Relative path?

Postby Andy Baird » Sat Jul 18, 2009 6:18 am

"I have purchased many iphone developing books but it has been very hard for me, since my Cocoa or C+ knowledge is smaller that an ant; my only strong knowledge is html and php. Therefore nimblekit is my only real solution right now."

Believe me, I'm in the same boat. The books assume you already know how to use Xcode and are proficient in Objective C, but I am neither--haven't written any C since the 80s. That's why, like you, I'm using NimbleKit. :-)

Andy Baird
User avatar
Andy Baird
 
Posts: 113
Joined: Sat May 30, 2009 10:32 pm
Location: On the road in the southwestern US

Re: Relative path?

Postby tonygoodchild » Mon Jul 20, 2009 5:01 pm

I'm using relative reference to images in subfolder without problems. I keep all the images in the folder /images then I dragged that into the HTML directory in XCode. In the popup window I selected "Create Folder References for any added folders" and I can reference them from standard html or css tags / attributes as "images/something.jpg"
tonygoodchild
 
Posts: 15
Joined: Fri Jul 03, 2009 10:36 am

PreviousNext

Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 1 guest