• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Other option rather than .rsrc in Xcode...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Other option rather than .rsrc in Xcode...


  • Subject: Re: Other option rather than .rsrc in Xcode...
  • From: Philip Aker <email@hidden>
  • Date: Thu, 18 Dec 2008 02:41:25 -0800

On Thu, Dec 18, 2008 at 1:06 AM, Nima <email@hidden> wrote:

Hello everyone,

I have a JavaScript file that I want to include in my Xcode but for some reason, not as a separate file in project, I need something like a string that could contain entire script file( like STR in .rsrc) but don't want to include .rsrc file in my Xcode project.
I wonder what would be the best approach to do that? and how to retrieve the content of script(string) at runtime?


I use C/C++, OS X 10.5.5

Use a property list. C language functions are available in CoreFoundation.framework to read the property list data into a string. To create the file to be added to your project in Xcode, you can use the shell tool 'defaults' with a full path. Here is an example of what one would look like:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd ">
<plist version="1.0">
<dict>
<key>MyJavaScript</key>
<string>
var feedURL = "feed://developer.apple.com/rss/adcheadlines.rss";
var xmlRequest = new XMLHttpRequest();
var onloadHandler = function() {
xmlLoadedTest( xmlRequest );
};
/* ... */
</string>
</dict>
</plist>



Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Other option rather than .rsrc in Xcode... (From: Nima <email@hidden>)
 >Re: Other option rather than .rsrc in Xcode... (From: "Sukhvinder Pal Singh" <email@hidden>)

  • Prev by Date: Re: Age Old Question: How Do You Set __MyCompanyName__
  • Next by Date: How to disable auto-opening files in the main Xcode window?
  • Previous by thread: Re: Other option rather than .rsrc in Xcode...
  • Next by thread: linking QuantLib dynamic library in Xcode
  • Index(es):
    • Date
    • Thread