Creating Sencha Touch, Phone Gap project in Xcode - ios

Having trouble creating a sencha project, with phone gap. My development machine is a Mac.
These are the steps I took.
Downloaded phone gap from link.
created a project in xCode using Cordova-based-application
Run the application in xCode.
Got an error that the index.html file is missing so R-click on
Project and added www folder. I unchecked copy items to
destination folder and 'checked create folder references for any
added folder'
Once I added the www folder, I was unable to R-Click and add any
files or create folders inside it. Here's the screen shot;
Now, when I run the application, it says Cordova is working. I am unable to R-Click and add a file inside the www folder.
Why is this and how can I solve this ?
I guess the next step i should take is to add the Sencha Touch 2 files in to this project. I am not sure about the steps i should get. So can someone kindly give me the steps or a good link (which gives step-by-step guidelines to make this work).
Am I correct up to now if I have missed any steps please correct me. I have been trying to make this work for more than 3 days now.
Note:
My ultimate goal is to run the application (Hello world code) in an
iPhone and Android device. So Please help me.
I have gone through this tutorial
UPDATE- AFTER ADDING SENCHATOUCH PROJECT TO MY APPLICATION
When I expand the SenchaTouch Project

You will need to use Finder to manage the files. Two finger click on the root project and select "Show in Finder". Once you have that directory open, copy your Sencha Touch project to the directory using Finder. You can edit those files in XCode but you cannot do most of the normal file functions in XCode because the WWW directory is referenced directory.

Related

Xcode project not working when cloned from remote repository

I have developed an app in Xcode, and I now want to start using GitHub. I was able to successfully push the local project to remote, but when I try to clone the project to another computer and run the project, the project won't work.
When trying to run the workspace, which I usually have to use when editing the project, the .xcodeproj file in the left section of the screen is red, and it is no way to run it. In addition to this, it looks like the framework from the original local project has been left out. Attached is a screenshot where you can see my issue.
I would appreciate any help on this!
Screenshot
I finally got this working. What I had to do was simply deleting the empty (red) .xcodeproj file, go to File -> add files to "...", and manually locate and select the .xcodeproj file in the cloned folder.

DropboxSDK.framework file not found after relaunching Xcode

I am using the DropboxSDK.framework in a project of mine.
I have everything setup and working fine. However, every time I quite Xcode and open it again at a later point I get the error below:
Which is weird because I can see that the framework is in the project and nothing (that I know of) has changed since the last time I had the project open and working.
The way I make the error go away is to:
Right click on the DropboxSDK.framework in my project --> Delete --> Remove Reference.
In my project's Build Settings under Search Paths I remove the path that is under Framework Search Paths (the highlighted selection in the image below).
Then I clean my project SHIFT + CMD + K
Lastly, I click File --> Add files to my project, navigate to the DropboxSDK.framework file which I previously removed reference to and add it back to my project.
Then I build my project again and the error goes away and will remain gone until I quite Xcode and open it again.
Has anyone else ever encountered this happening and fixed it?
Or have any suggestions I could try to fix it? I'm using Xcode V5.1.1
Let me know if there's anything I can clarify. Thank you!
$(SRCROOT)/Application_Folder
Application_Folder is the name of the folder where your whole code other resources resides
Insert above line in Header Search Paths
I had a random thought sparked by Indrajeet's answer that solved my problem.
When a new project is created in Xcode a project folder is created. In that folder there is another folder with the same name as your project, a .xcodeproj file with your project's name and a yourProjectNameTests folder.
Visually like this.
Application_Name --> Application_Name
Application_Name.xcodeproj
Application_NameTests
When I was having the error I described above the DropboxSDK.framework and it's accompanying files were stored here in this folder:
After removing all references to the DropboxSDK.framework in my project I decided to move the DropboxSDK.framwork and it's accompanying files one folder level up to the main Application_Name folder here:
Once I did this, I clicked File --> Add files to my project, navigated to the DropboxSDK.framework file, now one folder level up and added it to my project.
After building no error was thrown. I restarted Xcode and tried again to make sure; still no error. Rebooted my computer to be truly sure... still no error!
I was having the sane problem and just found the answer by chance!
It happens when you create your project name with SPACES between the letters. Somehow it makes XCode crazy when searching for the frameworks.
So if want to create a project called "This is My Project Name", call it "This_is_My_Project_Name" and the frameworks will be found every time. It worked with me.

App falsely reports missing file

I downloaded a git hub project, a screen recorder(ios). It said I had to also copy in Inappsettingskit, so I did. So I tried to run it on my iPod and it told me that IASKAppSettingsViewController.h and .m were missing, even though I checked, and they are there, in the correct folder.
All the files are there in the correct place. The only thing I am noticing is that the files are in red text in Xcode:
Sorry that I am such a noob. Any ideas on why these errors show up?
Just guessing here, but chances are something went wrong when you added the files to the project. Try this.-
Remove the files references from Project navigator
From finder, make sure the physical files are inside your project folder.
Drag the files from finder to Project navigator. Uncheck copy items into destination
Drag the recently added files from Project navigator to Build phases => Compile sources section

Should Facebook ios sdk's static library appear inside Xcode Project?

I'm currently doing facebook integration and have gone through this tutorial. So far, I've done everything until step #2.
To test the single sign - on, I decided to implement it in Paul Heggarty's Photomania project. To do this, as said by the tutorial linked above, I should clone the git hub repository (under step 2). I've done this by copy and pasting git clone git://github.com/facebook/facebook-ios-sdk.git
on my Terminal and it works fine. I can locate where the facebook-ios-sdk folder is in. Great, so I dragged the folder to the Photomania project.
Also stated in the tutorial that I should make a static library for the facebook-ios-sdk if I enabled Automatic Reference Counting for the App (Photomania). Which is what I did after discovering through streaming back to the Core Data Demo video that Photomania actually enabled ARC. So now, I did the static library by copy and pasting this ~/facebook-ios-sdk/scripts/build_facebook_ios_sdk_static_lib.sh to my Terminal. Upon doing so, it actually created the new library.
However, I can't see the lib folder inside facebook-ios-sdk (already copied in the Photomania). Even though through Finder I can locate the project Photomania, see the facebook-ios-sdk's lib folder in it with the Static library.
Enlighten me please.
You see, Xcode and the finder have completely independent file systems (assuming you are not checking the "copy files (if needed)" option). When you drag a file from the finder to an Xcode project, they are copied and placed under the "Copy Bundle Resources" tab, while still retaining the general file-structure that you dragged inside the Xcode file tree. So therefore, updates to finder files necessitate the new file(s) being dragged into the Xcode file tree. Simple as that.

PhoneGap application: "ERROR: Start Page at `www/index.html` was not found"

I have created a Phone Gap based application on iPhone. After the first run, I have dragged my www folder, containing index.html into the project, but still I am getting the following error in the simulator:
ERROR: Start Page at www/index.html was not found.
Do I have to mention the name of index.html in a plist file or anywhere else? How can I resolve this; can any one help me?
It's an incompatibility between PhoneGap and XCode 4. To resolve:
right click on your project and choose "Add files to [project
name]...";
choose the www folder from your curent project's folder (it's
included in there, but not added as a reference);
when you select the folder, make sure you choose "Copy items into
destination group's folder" as well as "Create folder references for
any added folders".
Note: if you choose "Create groups for any added folders", the app will still fail at runtime.
For those who are as silly as me...
I had forgotten to run cordova build.
Quit XCode and apply below command in terminal, its work for me
ionic cordova prepare ios
Try removing the reference, and adding it again. Did you add it as a "Reference"? The icon should be in blue. Then clean and rebuild.
I had the same problem where it worked in the simulator but not a device. My issue was case sensitivity. My file was Index.html instead of lower case index.html.
You could also just drop the www folder w/Finder into the Xcode Nav tab (root), after that just check dialog checkboxes "Copy items into destination group's folder" and "Create folder references for any added folders".
What versions of Xcode and PhoneGap are you using?
If you're using the older Xcode 3 and are creating a new project using the PhoneGap template... it should automatically create a www folder for you, along with a generic index.html file. If you've dragged your folder and index file into the project, then you should have been overwriting the existing files.
If you're using Xcode 4, there's a known issue with getting a PhoneGap project set up. It would be helpful to know what tutorial/guide you are following (assuming you are using a guide).
In very random cases, changes you make to your files/folders directly (via Finder) might not be picked up immediately by Xcode. You could always try quitting out of Xcode and re-opening your project, to ensure Xcode is pulling the latest files.
Well cordova build ios android was the only thing that worked for me, and cordova build didn't cut it.
in xcode target - Copy Bundle Resource
add www folder
You can fix this issue by adding www to Targets > Build Phases > Copy Bundle Resources

Resources