repo
string | commit
string | message
string | diff
string |
---|---|---|---|
foxbunny/Timetrack
|
cea1df2ee5c814a2fa064c6e5d3e250c6d0c397c
|
Added TSV export
|
diff --git a/tt.py b/tt.py
index b8d5059..53ed4ef 100755
--- a/tt.py
+++ b/tt.py
@@ -1,213 +1,237 @@
#!/usr/bin/env python
"""
Simple-stupid time tracker script
=================================
Timetrack
opyright (C) 2010, Branko Vukelic <studio@brankovukelic.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import sys
import getopt
import os
import re
import sqlite3
HOME_DIR = os.path.expanduser('~')
DEFAULT_FILE = os.path.join(HOME_DIR, 'timesheet.db')
PID_RE = re.compile(r'^[A-Za-z]{3}$')
def optpair(opts):
""" Pair option switches and their own arguments """
optdict = {}
for sw, a in opts:
optdict[sw] = a
return optdict
def check_pid(pname):
""" Check project name, return true if it is correct """
if PID_RE.match(pname):
return True
return False
def generate_timestamp():
from datetime import datetime
timenow = datetime.now()
return (datetime.strftime(timenow, '%Y-%m-%d %H:%M:%S'), timenow)
def getduration(seconds):
seconds = int(seconds)
hours = seconds // 3600
seconds = seconds - hours * 3600
minutes = seconds // 60
seconds = seconds - minutes * 60
return (hours, minutes, seconds)
-def read_stats(connection, pidfilter):
+def get_pids(connection):
+ """ Get unique PIDs from database """
pids = []
+ c = connection.cursor()
+ c.execute("SELECT DISTINCT pid FROM timesheet ORDER BY pid ASC;")
+ for pid in c:
+ pids.append(pid[0])
+ c.close()
+ return pids
+
+def get_times(connection, pidfilter):
+ """ Return a dictionary of PIDs with [job, time] pairs """
if pidfilter:
pids = [pidfilter]
else:
- c = connection.cursor()
- c.execute("SELECT DISTINCT pid FROM timesheet ORDER BY pid ASC;")
- for pid in c:
- pids.append(pid[0])
- print pids
- c.close()
-
+ pids = get_pids(connection)
pid_times = {}
for pid in pids:
c = connection.cursor()
c.execute("SELECT desc, TOTAL(dur) FROM timesheet WHERE pid = ? GROUP BY desc;", (pid,))
results = []
for result in c:
results.append(result)
pid_times[pid] = results
c.close()
+ return pid_times
+
+def read_stats(connection, pidfilter):
+ pid_times = get_times(connection, pidfilter)
for k in pid_times.keys():
print ""
print "=========================="
print "PID: %s" % k
print "=========================="
print ""
for j in pid_times[k]:
print "Job: %s" % j[0]
print "Total duration: %02d:%02d:%02d" % getduration(j[1])
print ""
print "=========================="
print ""
- c.close()
+
+def export_tsv(connection, filename, pidfilter):
+ pid_times = get_times(connection, pidfilter)
+
+ f = open(filename, 'w')
+ # Write header
+ f.write('PID\tJob\tTime\n')
+ for k in pid_times.keys():
+ for j in pid_times[k]:
+ f.write('%s\t%s\t%s\n' % (k, j[0], j[1]))
+ f.close()
def clean_string(s):
""" Escapes characters in a string for SQL """
return s.replace(';', '\\;').replace('\'', '\\\'')
def add_data(connection, pidfilter):
""" Gives user a prompt and writes data to the fhandle file """
import readline
print "Press Ctrl+C to exit."
try:
while True:
pid = pidfilter
while not check_pid(pid):
pid = raw_input("PID: ")
if not check_pid(pid):
print "'%s' is not a valid pid, please use a 3 letter sequence" % pid
print "Project ID is %s" % pid
desc = raw_input("Job: ")
desc = clean_string(desc)
if pid and desc:
timestamp, starttime = generate_timestamp()
print "Timer started at %s" % timestamp
raw_input("Press Enter to stop the timer")
endtimestamp, endtime = generate_timestamp()
print "Timer stopped at %s" % endtimestamp
delta = endtime - starttime
dsecs = delta.seconds
print "Total duration was %s seconds" % dsecs
args = (timestamp, pid, desc, dsecs)
c = connection.cursor()
try:
c.execute("INSERT INTO timesheet (timestamp, pid, desc, dur) VALUES (?, ?, ?, ?)", args)
except:
connection.rollback()
print "DB error: Data was not written"
raise
else:
connection.commit()
c.close()
print "\n"
except KeyboardInterrupt:
connection.rollback()
def usage():
print """Timetrack
Copyright (c) 2010, Branko Vukelic
Released under GNU/GPL v3, see LICENSE file for details.
-Usage: tt.py [-a] [-r] [-p] [PID] [--add] [--read] [--pid PID] [dbfile]"
+Usage: tt.py [-a] [-r] [-t FILE] [-p PID]
+ [--add] [--read] [--tsv FILE] [--pid PID] [dbfile]
-r --read : Display the stats.
-a --add : Start timer session (default action).
+-t --tsv : Export into a tab-separated table (TSV). FILE is the filename to
+ use for exporting.
-p --pid : With argument 'PID' (3 letters, no numbers or non-alphanumeric
- characters. Limits reads and writes to a single PID.
+ characters. Limits all operations to a single PID.
dbfile : Use this file as database, instead of default file. If the
specified file does not exist, it will be creadted.
More information at:
http://github.com/foxbunny/timetrack
"""
def main(argv):
try:
- opts, args = getopt.getopt(argv, 'rap:', ['read', 'add', 'pid='])
+ opts, args = getopt.getopt(argv, 'rat:p:', ['read', 'add', 'tsv=', 'pid='])
except getopt.GetoptError:
usage()
sys.exit(2)
optdict = optpair(opts)
statsfile = len(args) and args[0] or DEFAULT_FILE
print "Using stats file '%s'" % statsfile
pidfilter = optdict.get('-p', '') or optdict.get('--pid', '')
if pidfilter:
if check_pid(pidfilter):
print "Using project ID filter '%s'" % pidfilter
else:
print "Project ID filter '%s' is invalid and will be ignored." % pidfilter
print "Opening connection to database."
try:
connection = sqlite3.connect(statsfile)
except:
print "Database error. Exiting."
sys.exit(2)
print "Initialize table if none exists"
c = connection.cursor()
try:
c.execute("""CREATE TABLE IF NOT EXISTS timesheet (
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp DATETIME DEFAULT (datetime('now')),
pid VARCHAR(3) NOT NULL,
desc VARCHAR(255) NOT NULL,
dur INTEGER NOT NULL);""")
except:
connection.rollback()
raise
else:
connection.commit()
c.close()
if ('-r' in optdict.keys()) or ('--read' in optdict.keys()):
read_stats(connection, pidfilter)
+ elif ('-t' in optdict.keys()) or ('--tsv' in optdict.keys()):
+ filename = optdict.get('-t', None) or optdict.get('--tsv')
+ export_tsv(connection, filename, pidfilter)
else:
add_data(connection, pidfilter)
print "Closing connection to database"
connection.close()
sys.exit(1)
if __name__ == '__main__':
main(sys.argv[1:])
|
foxbunny/Timetrack
|
10e052cee28076302a7b1152b71c18a5d42d63ae
|
Fixed mistake in usage text.
|
diff --git a/tt.py b/tt.py
index 95b93f6..b8d5059 100755
--- a/tt.py
+++ b/tt.py
@@ -1,213 +1,213 @@
#!/usr/bin/env python
"""
Simple-stupid time tracker script
=================================
Timetrack
opyright (C) 2010, Branko Vukelic <studio@brankovukelic.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import sys
import getopt
import os
import re
import sqlite3
HOME_DIR = os.path.expanduser('~')
DEFAULT_FILE = os.path.join(HOME_DIR, 'timesheet.db')
PID_RE = re.compile(r'^[A-Za-z]{3}$')
def optpair(opts):
""" Pair option switches and their own arguments """
optdict = {}
for sw, a in opts:
optdict[sw] = a
return optdict
def check_pid(pname):
""" Check project name, return true if it is correct """
if PID_RE.match(pname):
return True
return False
def generate_timestamp():
from datetime import datetime
timenow = datetime.now()
return (datetime.strftime(timenow, '%Y-%m-%d %H:%M:%S'), timenow)
def getduration(seconds):
seconds = int(seconds)
hours = seconds // 3600
seconds = seconds - hours * 3600
minutes = seconds // 60
seconds = seconds - minutes * 60
return (hours, minutes, seconds)
def read_stats(connection, pidfilter):
pids = []
if pidfilter:
pids = [pidfilter]
else:
c = connection.cursor()
c.execute("SELECT DISTINCT pid FROM timesheet ORDER BY pid ASC;")
for pid in c:
pids.append(pid[0])
print pids
c.close()
pid_times = {}
for pid in pids:
c = connection.cursor()
c.execute("SELECT desc, TOTAL(dur) FROM timesheet WHERE pid = ? GROUP BY desc;", (pid,))
results = []
for result in c:
results.append(result)
pid_times[pid] = results
c.close()
for k in pid_times.keys():
print ""
print "=========================="
print "PID: %s" % k
print "=========================="
print ""
for j in pid_times[k]:
print "Job: %s" % j[0]
print "Total duration: %02d:%02d:%02d" % getduration(j[1])
print ""
print "=========================="
print ""
c.close()
def clean_string(s):
""" Escapes characters in a string for SQL """
return s.replace(';', '\\;').replace('\'', '\\\'')
def add_data(connection, pidfilter):
""" Gives user a prompt and writes data to the fhandle file """
import readline
print "Press Ctrl+C to exit."
try:
while True:
pid = pidfilter
while not check_pid(pid):
pid = raw_input("PID: ")
if not check_pid(pid):
print "'%s' is not a valid pid, please use a 3 letter sequence" % pid
print "Project ID is %s" % pid
desc = raw_input("Job: ")
desc = clean_string(desc)
if pid and desc:
timestamp, starttime = generate_timestamp()
print "Timer started at %s" % timestamp
raw_input("Press Enter to stop the timer")
endtimestamp, endtime = generate_timestamp()
print "Timer stopped at %s" % endtimestamp
delta = endtime - starttime
dsecs = delta.seconds
print "Total duration was %s seconds" % dsecs
args = (timestamp, pid, desc, dsecs)
c = connection.cursor()
try:
c.execute("INSERT INTO timesheet (timestamp, pid, desc, dur) VALUES (?, ?, ?, ?)", args)
except:
connection.rollback()
print "DB error: Data was not written"
raise
else:
connection.commit()
c.close()
print "\n"
except KeyboardInterrupt:
connection.rollback()
def usage():
print """Timetrack
Copyright (c) 2010, Branko Vukelic
Released under GNU/GPL v3, see LICENSE file for details.
-Usage: tt.py [-w] [-r] [-p] [PID] [--write] [--read] [--pid PID] [dbfile]"
+Usage: tt.py [-a] [-r] [-p] [PID] [--add] [--read] [--pid PID] [dbfile]"
-r --read : Display the stats.
--w --write : Start timer session (default action).
+-a --add : Start timer session (default action).
-p --pid : With argument 'PID' (3 letters, no numbers or non-alphanumeric
characters. Limits reads and writes to a single PID.
dbfile : Use this file as database, instead of default file. If the
specified file does not exist, it will be creadted.
More information at:
http://github.com/foxbunny/timetrack
"""
def main(argv):
try:
opts, args = getopt.getopt(argv, 'rap:', ['read', 'add', 'pid='])
except getopt.GetoptError:
usage()
sys.exit(2)
optdict = optpair(opts)
statsfile = len(args) and args[0] or DEFAULT_FILE
print "Using stats file '%s'" % statsfile
pidfilter = optdict.get('-p', '') or optdict.get('--pid', '')
if pidfilter:
if check_pid(pidfilter):
print "Using project ID filter '%s'" % pidfilter
else:
print "Project ID filter '%s' is invalid and will be ignored." % pidfilter
print "Opening connection to database."
try:
connection = sqlite3.connect(statsfile)
except:
print "Database error. Exiting."
sys.exit(2)
print "Initialize table if none exists"
c = connection.cursor()
try:
c.execute("""CREATE TABLE IF NOT EXISTS timesheet (
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp DATETIME DEFAULT (datetime('now')),
pid VARCHAR(3) NOT NULL,
desc VARCHAR(255) NOT NULL,
dur INTEGER NOT NULL);""")
except:
connection.rollback()
raise
else:
connection.commit()
c.close()
if ('-r' in optdict.keys()) or ('--read' in optdict.keys()):
read_stats(connection, pidfilter)
else:
add_data(connection, pidfilter)
print "Closing connection to database"
connection.close()
sys.exit(1)
if __name__ == '__main__':
main(sys.argv[1:])
|
winton/dialog
|
1286c8a0bb0a663e89acd7f6a43f7fbe1439d9cb
|
First working version
|
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..496ee2c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.DS_Store
\ No newline at end of file
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
diff --git a/install.rb b/install.rb
new file mode 100644
index 0000000..e69de29
diff --git a/javascripts/dialog.js b/javascripts/dialog.js
new file mode 100644
index 0000000..657301e
--- /dev/null
+++ b/javascripts/dialog.js
@@ -0,0 +1,107 @@
+var Dialog = new Class({
+ Implements: [ Events, Options ],
+ initialize: function(options) {
+ var el; // Element instance
+ var lightbox; // Lightbox instance
+
+ // Hide element and lightbox
+ this.hide = function() {
+ el.hide();
+ if (lightbox) lightbox.hide();
+ // Fire hide event
+ this.fireEvent('hide');
+ }.bind(this);
+
+ // Show element and lightbox
+ this.show = function() {
+ this.options = {};
+ this.setOptions(opts);
+ options = this.options;
+ el.show(options);
+ // Fire init event
+ this.fireEvent('show');
+ };
+
+ // Initializer
+ this.init = function(opts) {
+ window.addEvent('domready', function() {
+ this.options = {
+ id: 'dialog',
+ transition: {
+ 'in' : [ 'fade_in', 'slide_from_top' ],
+ 'out': [ 'fade_out', 'slide_to_top' ]
+ }
+ };
+ this.setOptions(opts);
+ options = this.options;
+ // Init lightbox
+ if (!lightbox) {
+ lightbox = Global.lightbox.init(options.lightbox);
+ lightbox.addEvent('click', function() { this.hide(); }.bind(this));
+ }
+ if (!el) {
+ el = Global.elements[options.id];
+ // Element show event
+ el.addEvent('show', function() {
+ // Show lightbox
+ if (lightbox) {
+ lightbox.show();
+ lightbox.indicator.show();
+ }
+ });
+ // Element showed event
+ el.addEvent('showed', function() {
+ // Center element
+ this.el.center();
+ // Hide lightbox indicator
+ if (lightbox)
+ lightbox.indicator.hide();
+ });
+ // Element hide event
+ el.addEvent('hide', function() {
+ // Hide lightbox
+ if (lightbox) {
+ lightbox.hide();
+ lightbox.indicator.hide();
+ }
+ });
+ // Re-init el
+ el.init(options);
+ // Add to Global object
+ Global.dialogs[options.id] = this;
+ }
+ // Fire init event
+ this.fireEvent('init');
+ }.bind(this));
+ return this;
+ };
+ this.init(options);
+
+ // Center dialog if resize
+ window.addEvent('resize', function() {
+ if (el && el.getStyle('opacity') > 0) el.center();
+ }.bind(this));
+ }
+});
+
+Element.implement({
+ center: function(second) {
+ var width = this.getSize().x;
+ var height = this.getSize().y;
+
+ this.setStyles({
+ position: 'absolute',
+ left: (Window.getWidth() / 2 - width / 2) + Window.getScrollLeft() + 'px',
+ top: (Window.getHeight() / 2 - height / 2) + Window.getScrollTop() + 'px',
+ 'z-index': 1001
+ });
+
+ if (this.getStyle('left') < 0) this.setStyle('left', 0);
+ if (this.getStyle('top') < 0) this.setStyle('right', 0);
+
+ return this;
+ }
+});
+
+var Global = Global || {};
+Global.dialogs = {};
\ No newline at end of file
diff --git a/javascripts/init.js b/javascripts/init.js
new file mode 100644
index 0000000..4de02b9
--- /dev/null
+++ b/javascripts/init.js
@@ -0,0 +1 @@
+new Dialog(<%= options.to_json %>);
\ No newline at end of file
diff --git a/options.rb b/options.rb
new file mode 100644
index 0000000..3a2025f
--- /dev/null
+++ b/options.rb
@@ -0,0 +1,14 @@
+{
+ # Dialog uses the Element and Lightbox widgets to make an absolute positioned, centered dialog.
+ #
+ # Default
+ # =======
+ :id => 'dialog'
+ #
+ # Options
+ # =======
+ # # Dialog inherits all options from the Element widget
+ #
+ # # Lightbox options are passed via the :lightbox option
+ # :lightbox => {}
+}
\ No newline at end of file
diff --git a/partials/_init.erb b/partials/_init.erb
new file mode 100644
index 0000000..c767b3a
--- /dev/null
+++ b/partials/_init.erb
@@ -0,0 +1,2 @@
+<%= widget :element, :id => options[:id] %>
+<%= widget :lightbox %>
\ No newline at end of file
|
davidwisch/ci_memsess
|
400d2a1d76f2f07937c1b9d25209fdf7fe3bd420
|
moved comment block
|
diff --git a/libraries/Session.php b/libraries/Session.php
index e919fb3..daea634 100644
--- a/libraries/Session.php
+++ b/libraries/Session.php
@@ -1,463 +1,468 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
-* Memcache Class
+* Use memcached as session storage backend in CodeIgniter
*
-* @author David Wischhusen
+* @author David Wischhusen <davewisch@gmail.com>
+*/
+
+/**
+* Memcache Class
*/
class CI_Session{
+
/**
* Memcache Object
*/
public $memcache;
/**
* Session Name/Cookie Name
*/
public $sessionname;
/**
* Session expire time (seconds)
*/
public $session_length;
/**
* Memcache servers to connect to (array)
*/
public $servers;
/**
* Unique identifier, unique to each session
*/
public $session_id;
/**
* Class constructor
*
* @access public
*/
public function CI_Session(){
log_message('debug', "Session [memcache] Class Initialized");
//load config
$CI = &get_instance();
$this->sessionname = $CI->config->item('memsess_name');
$this->session_length = $CI->config->item('memsess_expire_time');
$this->servers = $CI->config->item('memsess_servers');
$this->session_id = false;
$this->memcache = new Memcache;
$this->connect();
$this->init();
}
//////////////CI Interface functions
/*
Originally this class wasn't meant to be a drop-in session replacement.
Eventually I'll convert it completely but for now I basically aliased
my functions to recreate the CodeIgniter session functions.
*/
/**
* Replicates the set_userdata function from CI Session library
*
* @access public
* @param string
* @param mixed
*/
public function set_userdata($data, $value=NULL){
if(is_array($data)){
foreach($data as $key=>$value){
$this->set($key, $value);
}
}
else if(is_string($data)){
$this->set($data, $value);
}
}
/**
* Replicates the userdata function from the CI Session library
*
* @access public
* @param string
* @return mixed
*/
public function userdata($key){
return $this->get($key);
}
/**
* Replicates the unset_userdata function from the CI Session library
*
* @access public
* @param string
* @return bool
*/
public function unset_userdata($key){
return $this->delete($key);
}
//set_flashdata is already defined below
/**
* Replicates the flashdata function from the CI Session library
*
* @access public
* @param key
* @return mixed
*/
public function flashdata($key){
return $this->get_flashdata($key);
}
/**
* Replicates the keep_flashdata function from the CI Session library
*
* @access public
* @param string
* @return bool
*/
public function keep_flashdata($key){
return $this->extend_flashdata($key);
}
/**
* Replicates the sess_destroy function from the CI Session library
*/
public function sess_destroy(){
$this->destroy();
}
//////////////////END CI interface functions
/**
* Start or resume session
*
* Looks to see if a valid session already exists in user cookie
* and resumes session or starts a new one
*
* @acccess private
* @return bool
*/
private function init(){
if(isset($_COOKIE[$this->sessionname])){
$this->session_id = $_COOKIE[$this->sessionname];
$session = $this->get_session();
if($session !== false){
$last_activity = $session['last_activity'];
if($last_activity !== false){
$time = time();
if($last_activity < $time-$this->session_length &&
$this->session_length !== false){
$this->destroy();
return false;
}
}
}
return true;
}
$this->_create_session();
return true;
}
/**
* Retrieve key from session userdata
*
* @access public
* @param string
* @return mixed
*/
public function get($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['userdata'][$key])){
return $session['userdata'][$key];
}
return false;
}
/**
* Returns the session variable
*
* @access public
* @return array
*/
public function dump_session(){
if($this->session_id === false){
return false;
}
return $this->get_session();
}
/**
* Set userdata value
*
* @access public
* @param string
* @param mixed
* @return bool
*/
public function set($key, $value){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
$session['userdata'][$key] = $value;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
/**
* Delete key from userdata
*
* @access public
* @param string
* @return bool
*/
public function delete($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['userdata'][$key])){
unset($session['userdata'][$key]);
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
else{
return false;
}
}
/**
* Place temporary data in the session
*
* Places data in the session for default 1 request. Cleaned out
* automatically. Can optionally specify the number of requests that
* data should last for.
*
* @access public
* @param string
* @param mixed
* @param int
* @return bool
*/
public function set_flashdata($key, $value, $requests=1){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session == false){
return false;
}
$data = array(
'value' => $value,
'length' => $requests
);
$session['flashdata'][$key] = $data;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
/**
* Retrieves a value from the flashdata
*
* @access public
* @param string
* @return mixed
*/
public function get_flashdata($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['flashdata'][$key])){
return $session['flashdata'][$key]['value'];
}
return false;
}
/**
* Extend the number of requests a single flashdata entry is kept for
*
* @access public
* @param string
* @param int
* @return bool
*/
public function extend_flashdata($key, $extension=1){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['flashdata'][$key])){
$session['flashdata'][$key]['length'] += $extension;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
return false;
}
/**
* Returns the session from memcached
*
* @access private
* @return mixed
*/
private function get_session(){
return $this->memcache->get($this->session_id);
}
/**
* Destroy current session
*
* @access public
*/
public function destroy(){
if($this->session_id !== false){
$this->memcache->delete($this->session_id);
$this->session_id = false;
}
setcookie($this->sessionname, '', time()-3600);
}
/**
* Connect to memcache servers
*
* @access private
*/
private function connect(){
foreach($this->servers as $server){
$this->memcache->addServer($server['host'], $server['port']);
}
}
/**
* Start new session
*
* @access private
*/
private function _create_session(){
$ua = $_SERVER['HTTP_USER_AGENT'];
$ip = $_SERVER['REMOTE_ADDR'];
$time = time();
//make session_id & ensure unique
while(true){
$sessid = hash(
'sha512',
uniqid(rand().$ua.$ip.$time,true)
);
if($this->memcache->get($sessid) === false){
break;
}
}
//cookie doesn't expire
setcookie($this->sessionname, $sessid, 0, '/');
$this->session_id = $sessid;
$data['last_activity'] = $time;
$data['userdata'] = array();
$data['flashdata'] = array();
$this->memcache->set($this->session_id, $data);
}
/**
* Deletes expired entries from flashdata
*
* @access private
* @param array
* @return array
*/
private function _clean_flashdata($flashdata){
$flashdata_clean = array();
foreach($flashdata as $key=>$value){
$length = $value['length'];
if($length <= 0){
//wont append to clean array
continue;
}
$length--;
$data = array(
'value' => $value['value'],
'length' => $length
);
$flashdata_clean[$key] = $data;
unset($flashdata[$key]);
}
return $flashdata_clean;
}
/**
* Close connection to memcache servers
*
* @access private
* @return bool
*/
private function close(){
return $this->memcache->close();
}
/**
* Class destructor
*
* Updates last activity value in memcache session
*
* @access public
*/
public function __destruct(){
if($this->session_id !== false){
$session = $this->get_session();
$session['last_activity'] = time();
if(isset($session['flashdata'])){
$session['flashdata'] = $this->_clean_flashdata($session['flashdata']);
}
if($this->memcache->replace($this->session_id, $session) === false){
$this->memcache->set($this->session_id, $session);
}
}
$this->close();
}
}
/* End of file Session.php */
|
davidwisch/ci_memsess
|
f80a25605ce53e1b6dc80353463662524acde1f7
|
require that BASEPATH be defined & added accessor to session array
|
diff --git a/libraries/Session.php b/libraries/Session.php
index 43c5f1f..e919fb3 100644
--- a/libraries/Session.php
+++ b/libraries/Session.php
@@ -1,448 +1,463 @@
-<?php
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
/**
* Memcache Class
*
* @author David Wischhusen
*/
class CI_Session{
/**
* Memcache Object
*/
public $memcache;
/**
* Session Name/Cookie Name
*/
public $sessionname;
/**
* Session expire time (seconds)
*/
public $session_length;
/**
* Memcache servers to connect to (array)
*/
public $servers;
/**
* Unique identifier, unique to each session
*/
public $session_id;
/**
* Class constructor
*
* @access public
*/
public function CI_Session(){
log_message('debug', "Session [memcache] Class Initialized");
//load config
$CI = &get_instance();
$this->sessionname = $CI->config->item('memsess_name');
$this->session_length = $CI->config->item('memsess_expire_time');
$this->servers = $CI->config->item('memsess_servers');
$this->session_id = false;
$this->memcache = new Memcache;
$this->connect();
$this->init();
}
//////////////CI Interface functions
/*
Originally this class wasn't meant to be a drop-in session replacement.
Eventually I'll convert it completely but for now I basically aliased
my functions to recreate the CodeIgniter session functions.
*/
/**
* Replicates the set_userdata function from CI Session library
*
* @access public
* @param string
* @param mixed
*/
public function set_userdata($data, $value=NULL){
if(is_array($data)){
foreach($data as $key=>$value){
$this->set($key, $value);
}
}
else if(is_string($data)){
$this->set($data, $value);
}
}
/**
* Replicates the userdata function from the CI Session library
*
* @access public
* @param string
* @return mixed
*/
public function userdata($key){
return $this->get($key);
}
/**
* Replicates the unset_userdata function from the CI Session library
*
* @access public
* @param string
* @return bool
*/
public function unset_userdata($key){
return $this->delete($key);
}
//set_flashdata is already defined below
/**
* Replicates the flashdata function from the CI Session library
*
* @access public
* @param key
* @return mixed
*/
public function flashdata($key){
return $this->get_flashdata($key);
}
/**
* Replicates the keep_flashdata function from the CI Session library
*
* @access public
* @param string
* @return bool
*/
public function keep_flashdata($key){
return $this->extend_flashdata($key);
}
/**
* Replicates the sess_destroy function from the CI Session library
*/
public function sess_destroy(){
$this->destroy();
}
//////////////////END CI interface functions
/**
* Start or resume session
*
* Looks to see if a valid session already exists in user cookie
* and resumes session or starts a new one
*
* @acccess private
* @return bool
*/
private function init(){
if(isset($_COOKIE[$this->sessionname])){
$this->session_id = $_COOKIE[$this->sessionname];
$session = $this->get_session();
if($session !== false){
$last_activity = $session['last_activity'];
if($last_activity !== false){
$time = time();
if($last_activity < $time-$this->session_length &&
$this->session_length !== false){
$this->destroy();
return false;
}
}
}
return true;
}
$this->_create_session();
return true;
}
/**
* Retrieve key from session userdata
*
* @access public
* @param string
* @return mixed
*/
public function get($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['userdata'][$key])){
return $session['userdata'][$key];
}
return false;
}
+ /**
+ * Returns the session variable
+ *
+ * @access public
+ * @return array
+ */
+ public function dump_session(){
+ if($this->session_id === false){
+ return false;
+ }
+
+ return $this->get_session();
+ }
+
/**
* Set userdata value
*
* @access public
* @param string
* @param mixed
* @return bool
*/
public function set($key, $value){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
$session['userdata'][$key] = $value;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
/**
* Delete key from userdata
*
* @access public
* @param string
* @return bool
*/
public function delete($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['userdata'][$key])){
unset($session['userdata'][$key]);
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
else{
return false;
}
}
/**
* Place temporary data in the session
*
* Places data in the session for default 1 request. Cleaned out
* automatically. Can optionally specify the number of requests that
* data should last for.
*
* @access public
* @param string
* @param mixed
* @param int
* @return bool
*/
public function set_flashdata($key, $value, $requests=1){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session == false){
return false;
}
$data = array(
'value' => $value,
'length' => $requests
);
$session['flashdata'][$key] = $data;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
/**
* Retrieves a value from the flashdata
*
* @access public
* @param string
* @return mixed
*/
public function get_flashdata($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['flashdata'][$key])){
return $session['flashdata'][$key]['value'];
}
return false;
}
/**
* Extend the number of requests a single flashdata entry is kept for
*
* @access public
* @param string
* @param int
* @return bool
*/
public function extend_flashdata($key, $extension=1){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['flashdata'][$key])){
$session['flashdata'][$key]['length'] += $extension;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
return false;
}
/**
* Returns the session from memcached
*
* @access private
* @return mixed
*/
private function get_session(){
return $this->memcache->get($this->session_id);
}
/**
* Destroy current session
*
* @access public
*/
public function destroy(){
if($this->session_id !== false){
$this->memcache->delete($this->session_id);
$this->session_id = false;
}
setcookie($this->sessionname, '', time()-3600);
}
/**
* Connect to memcache servers
*
* @access private
*/
private function connect(){
foreach($this->servers as $server){
$this->memcache->addServer($server['host'], $server['port']);
}
}
/**
* Start new session
*
* @access private
*/
private function _create_session(){
$ua = $_SERVER['HTTP_USER_AGENT'];
$ip = $_SERVER['REMOTE_ADDR'];
$time = time();
//make session_id & ensure unique
while(true){
$sessid = hash(
'sha512',
uniqid(rand().$ua.$ip.$time,true)
);
if($this->memcache->get($sessid) === false){
break;
}
}
//cookie doesn't expire
setcookie($this->sessionname, $sessid, 0, '/');
$this->session_id = $sessid;
$data['last_activity'] = $time;
$data['userdata'] = array();
$data['flashdata'] = array();
$this->memcache->set($this->session_id, $data);
}
/**
* Deletes expired entries from flashdata
*
* @access private
* @param array
* @return array
*/
private function _clean_flashdata($flashdata){
$flashdata_clean = array();
foreach($flashdata as $key=>$value){
$length = $value['length'];
if($length <= 0){
//wont append to clean array
continue;
}
$length--;
$data = array(
'value' => $value['value'],
'length' => $length
);
$flashdata_clean[$key] = $data;
unset($flashdata[$key]);
}
return $flashdata_clean;
}
/**
* Close connection to memcache servers
*
* @access private
* @return bool
*/
private function close(){
return $this->memcache->close();
}
/**
* Class destructor
*
* Updates last activity value in memcache session
*
* @access public
*/
public function __destruct(){
if($this->session_id !== false){
$session = $this->get_session();
$session['last_activity'] = time();
if(isset($session['flashdata'])){
$session['flashdata'] = $this->_clean_flashdata($session['flashdata']);
}
if($this->memcache->replace($this->session_id, $session) === false){
$this->memcache->set($this->session_id, $session);
}
}
$this->close();
}
}
/* End of file Session.php */
|
davidwisch/ci_memsess
|
f9db764d41e4fdfb7f463a7ae89c159f519f0be4
|
fixed bug in function extend_flashdata
|
diff --git a/libraries/Session.php b/libraries/Session.php
index b94a7d9..4ef6d79 100644
--- a/libraries/Session.php
+++ b/libraries/Session.php
@@ -1,448 +1,448 @@
<?php
/**
* Memcache Class
*
* @author David Wischhusen
*/
class CI_Session{
/**
* Memcache Object
*/
var $memcache;
/**
* Session Name/Cookie Name
*/
var $sessionname;
/**
* Session expire time (seconds)
*/
var $session_length;
/**
* Memcache servers to connect to (array)
*/
var $servers;
/**
* Unique identifier, unique to each session
*/
var $session_id;
/**
* Class constructor
*
* @access public
*/
function CI_Session(){
log_message('debug', "Session [memcache] Class Initialized");
//load config
$CI = &get_instance();
$this->sessionname = $CI->config->item('memsess_name');
$this->session_length = $CI->config->item('memsess_expire_time');
$this->servers = $CI->config->item('memsess_servers');
$this->session_id = false;
$this->memcache = new Memcache;
$this->connect();
$this->init();
}
//////////////CI Interface functions
/*
Originally this class wasn't meant to be a drop-in session replacement.
Eventually I'll convert it completely but for now I basically aliased
my functions to recreate the CodeIgniter session functions.
*/
/**
* Replicates the set_userdata function from CI Session library
*
* @access public
* @param string
* @param mixed
*/
function set_userdata($data, $value=NULL){
if(is_array($data)){
foreach($data as $key=>$value){
$this->set($key, $value);
}
}
else if(is_string($data)){
$this->set($data, $value);
}
}
/**
* Replicates the userdata function from the CI Session library
*
* @access public
* @param string
* @return mixed
*/
function userdata($key){
return $this->get($key);
}
/**
* Replicates the unset_userdata function from the CI Session library
*
* @access public
* @param string
* @return bool
*/
function unset_userdata($key){
return $this->delete($key);
}
//set_flashdata is already defined below
/**
* Replicates the flashdata function from the CI Session library
*
* @access public
* @param key
* @return mixed
*/
function flashdata($key){
return $this->get_flashdata($key);
}
/**
* Replicates the keep_flashdata function from the CI Session library
*
* @access public
* @param string
* @return bool
*/
function keep_flashdata($key){
return $this->extend_flashdata($key);
}
/**
* Replicates the sess_destroy function from the CI Session library
*/
function sess_destroy(){
$this->destroy();
}
//////////////////END CI interface functions
/**
* Start or resume session
*
* Looks to see if a valid session already exists in user cookie
* and resumes session or starts a new one
*
* @acccess private
* @return bool
*/
private function init(){
if(isset($_COOKIE[$this->sessionname])){
$this->session_id = $_COOKIE[$this->sessionname];
$session = $this->get_session();
if($session !== false){
$last_activity = $session['last_activity'];
if($last_activity !== false){
$time = time();
if($last_activity < $time-$this->session_length &&
$this->session_length !== false){
$this->destroy();
return false;
}
}
}
return true;
}
$this->_create_session();
return true;
}
/**
* Retrieve key from session userdata
*
* @access public
* @param string
* @return mixed
*/
function get($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['userdata'][$key])){
return $session['userdata'][$key];
}
return false;
}
/**
* Set userdata value
*
* @access public
* @param string
* @param mixed
* @return bool
*/
function set($key, $value){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
$session['userdata'][$key] = $value;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
/**
* Delete key from userdata
*
* @access public
* @param string
* @return bool
*/
function delete($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['userdata'][$key])){
unset($session['userdata'][$key]);
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
else{
return false;
}
}
/**
* Place temporary data in the session
*
* Places data in the session for default 1 request. Cleaned out
* automatically. Can optionally specify the number of requests that
* data should last for.
*
* @access public
* @param string
* @param mixed
* @param int
* @return bool
*/
function set_flashdata($key, $value, $requests=1){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session == false){
return false;
}
$data = array(
'value' => $value,
'length' => $requests
);
$session['flashdata'][$key] = $data;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
/**
* Retrieves a value from the flashdata
*
* @access public
* @param string
* @return mixed
*/
function get_flashdata($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['flashdata'][$key])){
return $session['flashdata'][$key]['value'];
}
return false;
}
/**
* Extend the number of requests a single flashdata entry is kept for
*
* @access public
* @param string
* @param int
* @return bool
*/
function extend_flashdata($key, $extension=1){
if($this->session_id === false){
return false;
}
- $session = get_session();
+ $session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['flashdata'][$key])){
$session['flashdata'][$key]['length'] += $extension;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
return false;
}
/**
* Returns the session from memcached
*
* @access private
* @return mixed
*/
private function get_session(){
return $this->memcache->get($this->session_id);
}
/**
* Destroy current session
*
* @access public
*/
function destroy(){
if($this->session_id !== false){
$this->memcache->delete($this->session_id);
$this->session_id = false;
}
setcookie($this->sessionname, '', time()-3600);
}
/**
* Connect to memcache servers
*
* @access private
*/
private function connect(){
foreach($this->servers as $server){
$this->memcache->addServer($server['host'], $server['port']);
}
}
/**
* Start new session
*
* @access private
*/
private function _create_session(){
$ua = $_SERVER['HTTP_USER_AGENT'];
$ip = $_SERVER['REMOTE_ADDR'];
$time = time();
//make session_id & ensure unique
while(true){
$sessid = hash(
'sha512',
uniqid(rand().$ua.$ip.$time,true)
);
if($this->memcache->get($sessid) === false){
break;
}
}
//cookie doesn't expire
setcookie($this->sessionname, $sessid, 0, '/');
$this->session_id = $sessid;
$data['last_activity'] = $time;
$data['userdata'] = array();
$data['flashdata'] = array();
$this->memcache->set($this->session_id, $data);
}
/**
* Deletes expired entries from flashdata
*
* @access private
* @param array
* @return array
*/
private function _clean_flashdata($flashdata){
$flashdata_clean = array();
foreach($flashdata as $key=>$value){
$length = $value['length'];
if($length <= 0){
//wont append to clean array
continue;
}
$length--;
$data = array(
'value' => $value['value'],
'length' => $length
);
$flashdata_clean[$key] = $data;
unset($flashdata[$key]);
}
return $flashdata_clean;
}
/**
* Close connection to memcache servers
*
* @access private
* @return bool
*/
private function close(){
return $this->memcache->close();
}
/**
* Class destructor
*
* Updates last activity value in memcache session
*
* @access public
*/
function __destruct(){
if($this->session_id !== false){
$session = $this->get_session();
$session['last_activity'] = time();
if(isset($session['flashdata'])){
$session['flashdata'] = $this->_clean_flashdata($session['flashdata']);
}
if($this->memcache->replace($this->session_id, $session) === false){
$this->memcache->set($this->session_id, $session);
}
}
$this->close();
}
}
/* End of file Session.php */
|
davidwisch/ci_memsess
|
4b954b14499551dd7a8ef86aa30b71b0013b8658
|
fixed a bug that occurred after a call to destroy()
|
diff --git a/libraries/Session.php b/libraries/Session.php
index 70d3cb8..b94a7d9 100644
--- a/libraries/Session.php
+++ b/libraries/Session.php
@@ -1,446 +1,448 @@
<?php
/**
* Memcache Class
*
* @author David Wischhusen
*/
class CI_Session{
/**
* Memcache Object
*/
var $memcache;
/**
* Session Name/Cookie Name
*/
var $sessionname;
/**
* Session expire time (seconds)
*/
var $session_length;
/**
* Memcache servers to connect to (array)
*/
var $servers;
/**
* Unique identifier, unique to each session
*/
var $session_id;
/**
* Class constructor
*
* @access public
*/
function CI_Session(){
log_message('debug', "Session [memcache] Class Initialized");
//load config
$CI = &get_instance();
$this->sessionname = $CI->config->item('memsess_name');
$this->session_length = $CI->config->item('memsess_expire_time');
$this->servers = $CI->config->item('memsess_servers');
$this->session_id = false;
$this->memcache = new Memcache;
$this->connect();
$this->init();
}
//////////////CI Interface functions
/*
Originally this class wasn't meant to be a drop-in session replacement.
Eventually I'll convert it completely but for now I basically aliased
my functions to recreate the CodeIgniter session functions.
*/
/**
* Replicates the set_userdata function from CI Session library
*
* @access public
* @param string
* @param mixed
*/
function set_userdata($data, $value=NULL){
if(is_array($data)){
foreach($data as $key=>$value){
$this->set($key, $value);
}
}
else if(is_string($data)){
$this->set($data, $value);
}
}
/**
* Replicates the userdata function from the CI Session library
*
* @access public
* @param string
* @return mixed
*/
function userdata($key){
return $this->get($key);
}
/**
* Replicates the unset_userdata function from the CI Session library
*
* @access public
* @param string
* @return bool
*/
function unset_userdata($key){
return $this->delete($key);
}
//set_flashdata is already defined below
/**
* Replicates the flashdata function from the CI Session library
*
* @access public
* @param key
* @return mixed
*/
function flashdata($key){
return $this->get_flashdata($key);
}
/**
* Replicates the keep_flashdata function from the CI Session library
*
* @access public
* @param string
* @return bool
*/
function keep_flashdata($key){
return $this->extend_flashdata($key);
}
/**
* Replicates the sess_destroy function from the CI Session library
*/
function sess_destroy(){
$this->destroy();
}
//////////////////END CI interface functions
/**
* Start or resume session
*
* Looks to see if a valid session already exists in user cookie
* and resumes session or starts a new one
*
* @acccess private
* @return bool
*/
private function init(){
if(isset($_COOKIE[$this->sessionname])){
$this->session_id = $_COOKIE[$this->sessionname];
$session = $this->get_session();
if($session !== false){
$last_activity = $session['last_activity'];
if($last_activity !== false){
$time = time();
if($last_activity < $time-$this->session_length &&
$this->session_length !== false){
$this->destroy();
return false;
}
}
}
return true;
}
$this->_create_session();
return true;
}
/**
* Retrieve key from session userdata
*
* @access public
* @param string
* @return mixed
*/
function get($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['userdata'][$key])){
return $session['userdata'][$key];
}
return false;
}
/**
* Set userdata value
*
* @access public
* @param string
* @param mixed
* @return bool
*/
function set($key, $value){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
$session['userdata'][$key] = $value;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
/**
* Delete key from userdata
*
* @access public
* @param string
* @return bool
*/
function delete($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['userdata'][$key])){
unset($session['userdata'][$key]);
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
else{
return false;
}
}
/**
* Place temporary data in the session
*
* Places data in the session for default 1 request. Cleaned out
* automatically. Can optionally specify the number of requests that
* data should last for.
*
* @access public
* @param string
* @param mixed
* @param int
* @return bool
*/
function set_flashdata($key, $value, $requests=1){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session == false){
return false;
}
$data = array(
'value' => $value,
'length' => $requests
);
$session['flashdata'][$key] = $data;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
/**
* Retrieves a value from the flashdata
*
* @access public
* @param string
* @return mixed
*/
function get_flashdata($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['flashdata'][$key])){
return $session['flashdata'][$key]['value'];
}
return false;
}
/**
* Extend the number of requests a single flashdata entry is kept for
*
* @access public
* @param string
* @param int
* @return bool
*/
function extend_flashdata($key, $extension=1){
if($this->session_id === false){
return false;
}
$session = get_session();
if($session === false){
return false;
}
if(isset($session['flashdata'][$key])){
$session['flashdata'][$key]['length'] += $extension;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
return false;
}
/**
* Returns the session from memcached
*
* @access private
* @return mixed
*/
private function get_session(){
return $this->memcache->get($this->session_id);
}
/**
* Destroy current session
*
* @access public
*/
function destroy(){
if($this->session_id !== false){
$this->memcache->delete($this->session_id);
$this->session_id = false;
}
setcookie($this->sessionname, '', time()-3600);
}
/**
* Connect to memcache servers
*
* @access private
*/
private function connect(){
foreach($this->servers as $server){
$this->memcache->addServer($server['host'], $server['port']);
}
}
/**
* Start new session
*
* @access private
*/
private function _create_session(){
$ua = $_SERVER['HTTP_USER_AGENT'];
$ip = $_SERVER['REMOTE_ADDR'];
$time = time();
//make session_id & ensure unique
while(true){
$sessid = hash(
'sha512',
uniqid(rand().$ua.$ip.$time,true)
);
if($this->memcache->get($sessid) === false){
break;
}
}
//cookie doesn't expire
setcookie($this->sessionname, $sessid, 0, '/');
$this->session_id = $sessid;
$data['last_activity'] = $time;
$data['userdata'] = array();
$data['flashdata'] = array();
$this->memcache->set($this->session_id, $data);
}
/**
* Deletes expired entries from flashdata
*
* @access private
* @param array
* @return array
*/
private function _clean_flashdata($flashdata){
$flashdata_clean = array();
foreach($flashdata as $key=>$value){
$length = $value['length'];
if($length <= 0){
//wont append to clean array
continue;
}
$length--;
$data = array(
'value' => $value['value'],
'length' => $length
);
$flashdata_clean[$key] = $data;
unset($flashdata[$key]);
}
return $flashdata_clean;
}
/**
* Close connection to memcache servers
*
* @access private
* @return bool
*/
private function close(){
return $this->memcache->close();
}
/**
* Class destructor
*
* Updates last activity value in memcache session
*
* @access public
*/
function __destruct(){
if($this->session_id !== false){
$session = $this->get_session();
$session['last_activity'] = time();
- $session['flashdata'] = $this->_clean_flashdata($session['flashdata']);
+ if(isset($session['flashdata'])){
+ $session['flashdata'] = $this->_clean_flashdata($session['flashdata']);
+ }
if($this->memcache->replace($this->session_id, $session) === false){
$this->memcache->set($this->session_id, $session);
}
}
$this->close();
}
}
/* End of file Session.php */
|
davidwisch/ci_memsess
|
9c13421535ba3cf3a6f358d586513790390aeda4
|
made README less ugly
|
diff --git a/README.markdown b/README.markdown
index 21fc9a9..e2c36ee 100644
--- a/README.markdown
+++ b/README.markdown
@@ -1,50 +1,47 @@
# Memsess - A memcached backend for CodeIgniter sessions
***
## Usage
### Installation
Simply copy **libraries/Session.php** to the libraries/ directory in your application folder.
Copy **config/appconfig.php** to the config/ directory in your application folder.
### Configuration
In **config/appconfig.php** there are three settings for you to configure.
* $config['memsess_name'] - *The name of the session*
* $config['memsess_expire_time'] - *The expiration time for the session (in seconds)*
* $config['memsess_servers'] - *Array of associative arrays containing keys 'host' and 'port'. Each associative array corresponts to a single host/port combo. Put in as many of these as you'd like.*
### Initialization
Library doesn't take any initialization parameters. Simply load it in a controller using:
`$this->load->library("session");`
Alternativly, you could autoload it in config/autoload.php
### Usage
Has the same styntax as CodeIgniters session library so no changes to your code should be required.
There are also a few additional commands (and aliases for the CodeIgniter ones).
In addition to **set_userdata()**, **userdata()**, **unset_userdata()**, **flashdata()**, **keep_flashdata()**, and **sess_destroy()**
this library also provides the following:
`$this->session->set($key, $value); //alias for set_userdata()`
`$this->session->get($key); //alias for userdata()`
`$this->session->delete($key); //alias for unset_userdata()`
`$this->session->destroy(); //alias for sess_destroy()`
-`
-/*
-alias for keep_flashdata but provides an optional second parameter (defaults to 1) that lets you specify the number of requests to retain the data
-*/
-$this->session->extend_flashdata($key, $num_requests=1);
-`
+Alias for keep_flashdata() but provides an optional second parameter (defaults to 1) that lets you specify the number of requests to retain the data.
+
+`$this->session->extend_flashdata($key, $num_requests=1);`
|
davidwisch/ci_memsess
|
3d00ff732e806c19c31f84a3621f455b8b27694f
|
Finally added stuff to the README
|
diff --git a/README b/README
deleted file mode 100644
index e69de29..0000000
diff --git a/README.markdown b/README.markdown
new file mode 100644
index 0000000..21fc9a9
--- /dev/null
+++ b/README.markdown
@@ -0,0 +1,50 @@
+# Memsess - A memcached backend for CodeIgniter sessions
+
+***
+
+## Usage
+
+### Installation
+
+Simply copy **libraries/Session.php** to the libraries/ directory in your application folder.
+Copy **config/appconfig.php** to the config/ directory in your application folder.
+
+### Configuration
+
+In **config/appconfig.php** there are three settings for you to configure.
+
+* $config['memsess_name'] - *The name of the session*
+* $config['memsess_expire_time'] - *The expiration time for the session (in seconds)*
+* $config['memsess_servers'] - *Array of associative arrays containing keys 'host' and 'port'. Each associative array corresponts to a single host/port combo. Put in as many of these as you'd like.*
+
+### Initialization
+
+Library doesn't take any initialization parameters. Simply load it in a controller using:
+
+`$this->load->library("session");`
+
+Alternativly, you could autoload it in config/autoload.php
+
+### Usage
+
+Has the same styntax as CodeIgniters session library so no changes to your code should be required.
+
+There are also a few additional commands (and aliases for the CodeIgniter ones).
+
+In addition to **set_userdata()**, **userdata()**, **unset_userdata()**, **flashdata()**, **keep_flashdata()**, and **sess_destroy()**
+this library also provides the following:
+
+`$this->session->set($key, $value); //alias for set_userdata()`
+
+`$this->session->get($key); //alias for userdata()`
+
+`$this->session->delete($key); //alias for unset_userdata()`
+
+`$this->session->destroy(); //alias for sess_destroy()`
+
+`
+/*
+alias for keep_flashdata but provides an optional second parameter (defaults to 1) that lets you specify the number of requests to retain the data
+*/
+$this->session->extend_flashdata($key, $num_requests=1);
+`
|
davidwisch/ci_memsess
|
2a589da8edbbc5e886caa3f4ce5259df2918ec82
|
fixed some commenting
|
diff --git a/config/appconfig.php b/config/appconfig.php
index b65165c..d297758 100644
--- a/config/appconfig.php
+++ b/config/appconfig.php
@@ -1,9 +1,11 @@
<?php
$config['memsess_name'] = "app_session";
$config['memsess_expire_time'] = 36288000;
$config['memsess_servers'] = array(
array(
'host' => '127.0.0.1',
'port' => 11211
)
);
+
+/* End of file appconfig.php */
\ No newline at end of file
diff --git a/libraries/Session.php b/libraries/Session.php
index 6fda3ef..70d3cb8 100644
--- a/libraries/Session.php
+++ b/libraries/Session.php
@@ -1,446 +1,446 @@
<?php
/**
* Memcache Class
*
* @author David Wischhusen
*/
class CI_Session{
/**
* Memcache Object
- * @var MemcacheObject
*/
var $memcache;
/**
* Session Name/Cookie Name
*/
var $sessionname;
/**
* Session expire time (seconds)
*/
var $session_length;
/**
* Memcache servers to connect to (array)
*/
var $servers;
/**
* Unique identifier, unique to each session
*/
var $session_id;
/**
* Class constructor
*
* @access public
*/
function CI_Session(){
log_message('debug', "Session [memcache] Class Initialized");
//load config
$CI = &get_instance();
$this->sessionname = $CI->config->item('memsess_name');
$this->session_length = $CI->config->item('memsess_expire_time');
$this->servers = $CI->config->item('memsess_servers');
$this->session_id = false;
$this->memcache = new Memcache;
$this->connect();
$this->init();
}
//////////////CI Interface functions
/*
Originally this class wasn't meant to be a drop-in session replacement.
Eventually I'll convert it completely but for now I basically aliased
my functions to recreate the CodeIgniter session functions.
*/
/**
* Replicates the set_userdata function from CI Session library
*
* @access public
- * @param mixed
+ * @param string
* @param mixed
*/
function set_userdata($data, $value=NULL){
if(is_array($data)){
foreach($data as $key=>$value){
$this->set($key, $value);
}
}
else if(is_string($data)){
$this->set($data, $value);
}
}
/**
* Replicates the userdata function from the CI Session library
*
* @access public
* @param string
* @return mixed
*/
function userdata($key){
return $this->get($key);
}
/**
* Replicates the unset_userdata function from the CI Session library
*
* @access public
* @param string
* @return bool
*/
function unset_userdata($key){
return $this->delete($key);
}
//set_flashdata is already defined below
/**
* Replicates the flashdata function from the CI Session library
*
* @access public
* @param key
* @return mixed
*/
function flashdata($key){
return $this->get_flashdata($key);
}
/**
* Replicates the keep_flashdata function from the CI Session library
*
* @access public
* @param string
* @return bool
*/
function keep_flashdata($key){
return $this->extend_flashdata($key);
}
/**
* Replicates the sess_destroy function from the CI Session library
*/
function sess_destroy(){
$this->destroy();
}
//////////////////END CI interface functions
/**
* Start or resume session
*
* Looks to see if a valid session already exists in user cookie
* and resumes session or starts a new one
*
* @acccess private
* @return bool
*/
private function init(){
if(isset($_COOKIE[$this->sessionname])){
$this->session_id = $_COOKIE[$this->sessionname];
$session = $this->get_session();
if($session !== false){
$last_activity = $session['last_activity'];
if($last_activity !== false){
$time = time();
if($last_activity < $time-$this->session_length &&
$this->session_length !== false){
$this->destroy();
return false;
}
}
}
return true;
}
$this->_create_session();
return true;
}
/**
* Retrieve key from session userdata
*
* @access public
* @param string
* @return mixed
*/
function get($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['userdata'][$key])){
return $session['userdata'][$key];
}
return false;
}
/**
* Set userdata value
*
* @access public
* @param string
- * @param bool
+ * @param mixed
+ * @return bool
*/
function set($key, $value){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
$session['userdata'][$key] = $value;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
/**
* Delete key from userdata
*
* @access public
* @param string
* @return bool
*/
function delete($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['userdata'][$key])){
unset($session['userdata'][$key]);
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
else{
return false;
}
}
/**
* Place temporary data in the session
*
* Places data in the session for default 1 request. Cleaned out
* automatically. Can optionally specify the number of requests that
* data should last for.
*
* @access public
* @param string
* @param mixed
* @param int
* @return bool
*/
function set_flashdata($key, $value, $requests=1){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session == false){
return false;
}
$data = array(
'value' => $value,
'length' => $requests
);
$session['flashdata'][$key] = $data;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
/**
* Retrieves a value from the flashdata
*
* @access public
* @param string
* @return mixed
*/
function get_flashdata($key){
if($this->session_id === false){
return false;
}
$session = $this->get_session();
if($session === false){
return false;
}
if(isset($session['flashdata'][$key])){
return $session['flashdata'][$key]['value'];
}
return false;
}
/**
* Extend the number of requests a single flashdata entry is kept for
*
* @access public
* @param string
* @param int
* @return bool
*/
function extend_flashdata($key, $extension=1){
if($this->session_id === false){
return false;
}
$session = get_session();
if($session === false){
return false;
}
if(isset($session['flashdata'][$key])){
$session['flashdata'][$key]['length'] += $extension;
if($ret = $this->memcache->replace($this->session_id, $session) === false){
return $this->memcache->set($this->session_id, $session);
}
return $ret;
}
return false;
}
/**
* Returns the session from memcached
*
* @access private
* @return mixed
*/
private function get_session(){
return $this->memcache->get($this->session_id);
}
/**
* Destroy current session
*
* @access public
*/
function destroy(){
if($this->session_id !== false){
$this->memcache->delete($this->session_id);
$this->session_id = false;
}
setcookie($this->sessionname, '', time()-3600);
}
/**
* Connect to memcache servers
*
* @access private
*/
private function connect(){
foreach($this->servers as $server){
$this->memcache->addServer($server['host'], $server['port']);
}
}
/**
* Start new session
*
* @access private
*/
private function _create_session(){
$ua = $_SERVER['HTTP_USER_AGENT'];
$ip = $_SERVER['REMOTE_ADDR'];
$time = time();
//make session_id & ensure unique
while(true){
$sessid = hash(
'sha512',
uniqid(rand().$ua.$ip.$time,true)
);
if($this->memcache->get($sessid) === false){
break;
}
}
//cookie doesn't expire
setcookie($this->sessionname, $sessid, 0, '/');
$this->session_id = $sessid;
$data['last_activity'] = $time;
$data['userdata'] = array();
$data['flashdata'] = array();
$this->memcache->set($this->session_id, $data);
}
/**
* Deletes expired entries from flashdata
*
* @access private
* @param array
* @return array
*/
private function _clean_flashdata($flashdata){
$flashdata_clean = array();
foreach($flashdata as $key=>$value){
$length = $value['length'];
if($length <= 0){
//wont append to clean array
continue;
}
$length--;
$data = array(
'value' => $value['value'],
'length' => $length
);
$flashdata_clean[$key] = $data;
unset($flashdata[$key]);
}
return $flashdata_clean;
}
/**
* Close connection to memcache servers
*
* @access private
* @return bool
*/
private function close(){
return $this->memcache->close();
}
/**
* Class destructor
*
* Updates last activity value in memcache session
*
* @access public
*/
function __destruct(){
if($this->session_id !== false){
$session = $this->get_session();
$session['last_activity'] = time();
$session['flashdata'] = $this->_clean_flashdata($session['flashdata']);
if($this->memcache->replace($this->session_id, $session) === false){
$this->memcache->set($this->session_id, $session);
}
}
$this->close();
}
}
-/* End of file msess.php */
+/* End of file Session.php */
|
apg/django-favorites
|
b1459497453cfcecd06b56e42a152194feb5d472
|
use PositiveIntegerField for object_id, as in http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#id1
|
diff --git a/favorites/models.py b/favorites/models.py
index 76517ff..302d572 100644
--- a/favorites/models.py
+++ b/favorites/models.py
@@ -1,71 +1,71 @@
from django.db import models, connection
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
class FavoriteManager(models.Manager):
""" A Manager for Favorites
"""
def favorites_for_user(self, user):
""" Returns Favorites for a specific user
"""
return self.get_query_set().filter(user=user)
def favorites_for_model(self, model, user=None):
""" Returns Favorites for a specific model
"""
content_type = ContentType.objects.get_for_model(model)
qs = self.get_query_set().filter(content_type=content_type)
if user:
qs = qs.filter(user=user)
return qs
def favorites_for_object(self, obj, user=None):
""" Returns Favorites for a specific object
"""
content_type = ContentType.objects.get_for_model(type(obj))
qs = self.get_query_set().filter(content_type=content_type,
object_id=obj.pk)
if user:
qs = qs.filter(user=user)
return qs
def favorite_for_user(self, obj, user):
"""Returns the favorite, if exists for obj by user
"""
content_type = ContentType.objects.get_for_model(type(obj))
return self.get_query_set().get(content_type=content_type,
object_id=obj.pk)
@classmethod
def create_favorite(cls, content_object, user):
content_type = ContentType.objects.get_for_model(type(content_object))
favorite = Favorite(
user=user,
content_type=content_type,
object_id=content_object.pk,
content_object=content_object
)
favorite.save()
return favorite
class Favorite(models.Model):
user = models.ForeignKey(User)
content_type = models.ForeignKey(ContentType)
- object_id = models.IntegerField()
+ object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey('content_type', 'object_id')
created_on = models.DateTimeField(auto_now_add=True)
objects = FavoriteManager()
class Meta:
verbose_name = _('favorite')
verbose_name_plural = _('favorites')
unique_together = (('user', 'content_type', 'object_id'),)
def __unicode__(self):
return "%s likes %s" % (self.user, self.content_object)
|
apg/django-favorites
|
baebdc0f773db77e41db4c1aea5255846faa3266
|
* Backwards Incompatible Change: Changed the order of the args in `create_favorite' to be more compatible with the other methods * Now calling get_query_set() in the Manager's methods
|
diff --git a/favorites/managers.py b/favorites/managers.py
index 6b0657f..ff88e2c 100644
--- a/favorites/managers.py
+++ b/favorites/managers.py
@@ -1,38 +1,38 @@
from django.db import models, connection
from django.contrib.contenttypes.models import ContentType
from models import Favorite
qn = connection.ops.quote_name
class FavoritesManagerMixin(object):
""" A Mixin to add a `favorite__favorite` column via extra
"""
def with_favorite_for(self, user, all=True):
""" Adds a column favorite__favorite to the returned object, which
indicates whether or not this item is a favorite for a user
"""
+ Favorite = models.get_model('favorites', 'Favorite')
content_type = ContentType.objects.get_for_model(self.model)
pk_field = "%s.%s" % (qn(self.model._meta.db_table),
qn(self.model._meta.pk.column))
favorite_sql = """(SELECT 1 FROM %(favorites_db_table)s
WHERE %(favorites_db_table)s.object_id = %(pk_field)s and
%(favorites_db_table)s.content_type_id = %(content_type)d and
%(favorites_db_table)s.user_id = %(user_id)d)
""" % {'pk_field': pk_field, \
'db_table': qn(self.model._meta.db_table), \
'favorites_db_table': qn(Favorite._meta.db_table), \
'user_id': user.pk, \
'content_type': content_type.id, \
}
extras = {
'select': {'favorite__favorite': favorite_sql},
}
if not all:
extras['where'] = ['favorite__favorite == 1']
- return self.extra(**extras)
-
+ return self.get_query_set().extra(**extras)
diff --git a/favorites/models.py b/favorites/models.py
index 2b20c75..76517ff 100644
--- a/favorites/models.py
+++ b/favorites/models.py
@@ -1,59 +1,71 @@
from django.db import models, connection
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
class FavoriteManager(models.Manager):
""" A Manager for Favorites
"""
def favorites_for_user(self, user):
""" Returns Favorites for a specific user
"""
return self.get_query_set().filter(user=user)
- def favorites_for_model(self, model):
+ def favorites_for_model(self, model, user=None):
""" Returns Favorites for a specific model
"""
content_type = ContentType.objects.get_for_model(model)
- return self.filter(content_type=content_type)
+ qs = self.get_query_set().filter(content_type=content_type)
+ if user:
+ qs = qs.filter(user=user)
+ return qs
- def favorites_for_object(self, obj):
+ def favorites_for_object(self, obj, user=None):
""" Returns Favorites for a specific object
"""
content_type = ContentType.objects.get_for_model(type(obj))
- return self.filter(content_type=content_type, object_id=obj.pk)
+ qs = self.get_query_set().filter(content_type=content_type,
+ object_id=obj.pk)
+ if user:
+ qs = qs.filter(user=user)
+ return qs
+
+ def favorite_for_user(self, obj, user):
+ """Returns the favorite, if exists for obj by user
+ """
+ content_type = ContentType.objects.get_for_model(type(obj))
+ return self.get_query_set().get(content_type=content_type,
+ object_id=obj.pk)
+
@classmethod
- def create_favorite(cls, user, content_object):
+ def create_favorite(cls, content_object, user):
content_type = ContentType.objects.get_for_model(type(content_object))
favorite = Favorite(
user=user,
content_type=content_type,
object_id=content_object.pk,
content_object=content_object
)
favorite.save()
return favorite
class Favorite(models.Model):
user = models.ForeignKey(User)
content_type = models.ForeignKey(ContentType)
object_id = models.IntegerField()
content_object = generic.GenericForeignKey('content_type', 'object_id')
created_on = models.DateTimeField(auto_now_add=True)
objects = FavoriteManager()
class Meta:
verbose_name = _('favorite')
verbose_name_plural = _('favorites')
unique_together = (('user', 'content_type', 'object_id'),)
def __unicode__(self):
return "%s likes %s" % (self.user, self.content_object)
-
-
-
|
apg/django-favorites
|
e8a37f6d233dfb1a34ff1482e0e8aa22a8476efc
|
* Quoted things that should be quoted
|
diff --git a/favorites/managers.py b/favorites/managers.py
index f52a897..6b0657f 100644
--- a/favorites/managers.py
+++ b/favorites/managers.py
@@ -1,36 +1,38 @@
-from django.db import models
+from django.db import models, connection
from django.contrib.contenttypes.models import ContentType
from models import Favorite
+qn = connection.ops.quote_name
+
class FavoritesManagerMixin(object):
""" A Mixin to add a `favorite__favorite` column via extra
"""
def with_favorite_for(self, user, all=True):
""" Adds a column favorite__favorite to the returned object, which
indicates whether or not this item is a favorite for a user
"""
content_type = ContentType.objects.get_for_model(self.model)
- pk_field = "%s.%s" % (self.model._meta.db_table,
- self.model._meta.pk.column)
+ pk_field = "%s.%s" % (qn(self.model._meta.db_table),
+ qn(self.model._meta.pk.column))
favorite_sql = """(SELECT 1 FROM %(favorites_db_table)s
WHERE %(favorites_db_table)s.object_id = %(pk_field)s and
%(favorites_db_table)s.content_type_id = %(content_type)d and
%(favorites_db_table)s.user_id = %(user_id)d)
""" % {'pk_field': pk_field, \
- 'db_table': self.model._meta.db_table, \
- 'favorites_db_table': Favorite._meta.db_table, \
+ 'db_table': qn(self.model._meta.db_table), \
+ 'favorites_db_table': qn(Favorite._meta.db_table), \
'user_id': user.pk, \
'content_type': content_type.id, \
}
extras = {
'select': {'favorite__favorite': favorite_sql},
}
if not all:
extras['where'] = ['favorite__favorite == 1']
return self.extra(**extras)
diff --git a/favorites/models.py b/favorites/models.py
index 8abf56c..2b20c75 100644
--- a/favorites/models.py
+++ b/favorites/models.py
@@ -1,59 +1,59 @@
-from django.db import models
+from django.db import models, connection
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
class FavoriteManager(models.Manager):
""" A Manager for Favorites
"""
def favorites_for_user(self, user):
""" Returns Favorites for a specific user
"""
return self.get_query_set().filter(user=user)
def favorites_for_model(self, model):
""" Returns Favorites for a specific model
"""
content_type = ContentType.objects.get_for_model(model)
return self.filter(content_type=content_type)
def favorites_for_object(self, obj):
""" Returns Favorites for a specific object
"""
content_type = ContentType.objects.get_for_model(type(obj))
return self.filter(content_type=content_type, object_id=obj.pk)
@classmethod
def create_favorite(cls, user, content_object):
content_type = ContentType.objects.get_for_model(type(content_object))
favorite = Favorite(
user=user,
content_type=content_type,
object_id=content_object.pk,
content_object=content_object
)
favorite.save()
return favorite
class Favorite(models.Model):
user = models.ForeignKey(User)
content_type = models.ForeignKey(ContentType)
object_id = models.IntegerField()
content_object = generic.GenericForeignKey('content_type', 'object_id')
created_on = models.DateTimeField(auto_now_add=True)
objects = FavoriteManager()
class Meta:
verbose_name = _('favorite')
verbose_name_plural = _('favorites')
unique_together = (('user', 'content_type', 'object_id'),)
def __unicode__(self):
return "%s likes %s" % (self.user, self.content_object)
diff --git a/setup.py b/setup.py
index 311f770..0fc67e6 100644
--- a/setup.py
+++ b/setup.py
@@ -1,18 +1,18 @@
from distutils.core import setup
setup(
name = 'favorites',
version = '0.1',
description = 'Generic favorites application for Django',
author = 'Andrew Gwozdziewycz',
- author_email = 'hg@apgwoz.com',
+ author_email = 'git@apgwoz.com',
packages = ['favorites'],
classifiers = ['Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities'],
)
|
apg/django-favorites
|
0cbfd0481d1dec98da7c60fa71c3a2747a87c44c
|
* setup.py referred to "tagging," which is where the setup.py originall came from
|
diff --git a/favorites/views.py b/favorites/views.py
deleted file mode 100644
index e69de29..0000000
diff --git a/setup.py b/setup.py
index 4714ea9..311f770 100644
--- a/setup.py
+++ b/setup.py
@@ -1,18 +1,18 @@
from distutils.core import setup
setup(
- name = 'tagging',
+ name = 'favorites',
version = '0.1',
description = 'Generic favorites application for Django',
author = 'Andrew Gwozdziewycz',
author_email = 'hg@apgwoz.com',
packages = ['favorites'],
classifiers = ['Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities'],
)
|
apg/django-favorites
|
5d429a0704108c65f25dab228a6fe2b0ab6945d8
|
* Forgot to set the version number in setup.py
|
diff --git a/setup.py b/setup.py
index 7183278..4714ea9 100644
--- a/setup.py
+++ b/setup.py
@@ -1,18 +1,18 @@
from distutils.core import setup
setup(
name = 'tagging',
- version = version,
+ version = '0.1',
description = 'Generic favorites application for Django',
author = 'Andrew Gwozdziewycz',
author_email = 'hg@apgwoz.com',
packages = ['favorites'],
classifiers = ['Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities'],
)
|
apg/django-favorites
|
3935e47548b21e15b4d4e984b0c9be8cf4442c3e
|
* Initial commit of my Django favorites library. Yes there are others, but this one is mine.
|
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..cca7fc2
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..e69de29
diff --git a/INSTALL.txt b/INSTALL.txt
new file mode 100644
index 0000000..0d26c91
--- /dev/null
+++ b/INSTALL.txt
@@ -0,0 +1,7 @@
+================
+Django Favorites
+================
+
+To install it, run the following command inside this directory:
+
+ python setup.py install
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..bb24796
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,5 @@
+================
+Django Favorites
+================
+
+My generic favorites framework for Django.
diff --git a/favorites/__init__.py b/favorites/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/favorites/managers.py b/favorites/managers.py
new file mode 100644
index 0000000..f52a897
--- /dev/null
+++ b/favorites/managers.py
@@ -0,0 +1,36 @@
+from django.db import models
+from django.contrib.contenttypes.models import ContentType
+
+from models import Favorite
+
+class FavoritesManagerMixin(object):
+ """ A Mixin to add a `favorite__favorite` column via extra
+ """
+ def with_favorite_for(self, user, all=True):
+ """ Adds a column favorite__favorite to the returned object, which
+ indicates whether or not this item is a favorite for a user
+ """
+ content_type = ContentType.objects.get_for_model(self.model)
+ pk_field = "%s.%s" % (self.model._meta.db_table,
+ self.model._meta.pk.column)
+
+ favorite_sql = """(SELECT 1 FROM %(favorites_db_table)s
+WHERE %(favorites_db_table)s.object_id = %(pk_field)s and
+ %(favorites_db_table)s.content_type_id = %(content_type)d and
+ %(favorites_db_table)s.user_id = %(user_id)d)
+""" % {'pk_field': pk_field, \
+ 'db_table': self.model._meta.db_table, \
+ 'favorites_db_table': Favorite._meta.db_table, \
+ 'user_id': user.pk, \
+ 'content_type': content_type.id, \
+ }
+
+ extras = {
+ 'select': {'favorite__favorite': favorite_sql},
+ }
+
+ if not all:
+ extras['where'] = ['favorite__favorite == 1']
+
+ return self.extra(**extras)
+
diff --git a/favorites/models.py b/favorites/models.py
new file mode 100644
index 0000000..8abf56c
--- /dev/null
+++ b/favorites/models.py
@@ -0,0 +1,59 @@
+from django.db import models
+
+from django.contrib.auth.models import User
+from django.utils.translation import ugettext_lazy as _
+from django.contrib.contenttypes.models import ContentType
+from django.contrib.contenttypes import generic
+
+class FavoriteManager(models.Manager):
+ """ A Manager for Favorites
+ """
+ def favorites_for_user(self, user):
+ """ Returns Favorites for a specific user
+ """
+ return self.get_query_set().filter(user=user)
+
+ def favorites_for_model(self, model):
+ """ Returns Favorites for a specific model
+ """
+ content_type = ContentType.objects.get_for_model(model)
+ return self.filter(content_type=content_type)
+
+ def favorites_for_object(self, obj):
+ """ Returns Favorites for a specific object
+ """
+ content_type = ContentType.objects.get_for_model(type(obj))
+ return self.filter(content_type=content_type, object_id=obj.pk)
+
+ @classmethod
+ def create_favorite(cls, user, content_object):
+ content_type = ContentType.objects.get_for_model(type(content_object))
+ favorite = Favorite(
+ user=user,
+ content_type=content_type,
+ object_id=content_object.pk,
+ content_object=content_object
+ )
+ favorite.save()
+ return favorite
+
+class Favorite(models.Model):
+ user = models.ForeignKey(User)
+ content_type = models.ForeignKey(ContentType)
+ object_id = models.IntegerField()
+ content_object = generic.GenericForeignKey('content_type', 'object_id')
+
+ created_on = models.DateTimeField(auto_now_add=True)
+
+ objects = FavoriteManager()
+
+ class Meta:
+ verbose_name = _('favorite')
+ verbose_name_plural = _('favorites')
+ unique_together = (('user', 'content_type', 'object_id'),)
+
+ def __unicode__(self):
+ return "%s likes %s" % (self.user, self.content_object)
+
+
+
diff --git a/favorites/tests.py b/favorites/tests.py
new file mode 100644
index 0000000..47de128
--- /dev/null
+++ b/favorites/tests.py
@@ -0,0 +1,102 @@
+import unittest
+
+from django.db import models
+from django.contrib.auth.models import User
+
+from models import Favorite
+from managers import FavoritesManagerMixin
+
+class BaseFavoriteTestCase(unittest.TestCase):
+ def setUp(self):
+ self.users = dict([(u.username, u) for u in User.objects.all()])
+ if len(self.users) != 4:
+ for name in ['alice', 'bob', 'chris', 'dawn']:
+ try:
+ u = User.objects.create(username=name)
+ self.users[name] = u
+ except:
+ pass
+
+class FavoriteTestCase(BaseFavoriteTestCase):
+ def testAddFavorite(self):
+ """ Add alice as a favorite of chris, add the favorite as a favorite
+ of alice
+ """
+ chris = self.users['chris']
+ alice = self.users['alice']
+ favorite = Favorite.objects.create_favorite(chris, alice)
+
+ self.assertEquals(favorite.user, chris)
+ self.assertEquals(favorite.content_object, alice)
+
+ meta_favorite = Favorite.objects.create_favorite(alice, favorite)
+
+ self.assertEquals(meta_favorite.user, alice)
+ self.assertEquals(meta_favorite.content_object, favorite)
+
+ def testGetFavoritesForUser(self):
+ """ Get favorites for chris """
+ chris = self.users['chris']
+ alice = self.users['alice']
+
+ # verify that people can get them
+ favorites = Favorite.objects.favorites_for_user(chris)
+
+ self.assertEquals(len(favorites), 1)
+ self.assertEquals(favorites[0].content_object, self.users['alice'])
+
+ def testGetFavoritesForModel(self):
+ alice = self.users['alice']
+
+ # the meta favorite
+ meta_favorite = Favorite.objects.get(pk=2)
+
+ favorites = Favorite.objects.favorites_for_model(Favorite)
+
+ self.assertEquals(len(favorites), 1)
+ self.assertEquals(favorites[0], meta_favorite)
+ self.assertEquals(favorites[0].user, alice)
+
+ def testGetFavoritesForObject(self):
+ alice = self.users['alice']
+
+ favorite = Favorite.objects.get(pk=1)
+
+ favorites = Favorite.objects.favorites_for_object(favorite)
+ self.assertEquals(len(favorites), 1)
+ self.assertEquals(favorites[0].user, alice)
+
+class AnimalManager(models.Manager, FavoritesManagerMixin):
+ pass
+
+class Animal(models.Model):
+ name = models.CharField(max_length=20)
+
+ objects = AnimalManager()
+
+ def __unicode__(self):
+ return self.name
+
+class FavoritesMixinTestCase(BaseFavoriteTestCase):
+ def testWithFavorites(self):
+ """ Tests whether or not `with_favorite_for` works
+ """
+ alice = self.users['alice']
+ chris = self.users['chris']
+ animals = {}
+ for a in ['zebra', 'donkey', 'horse']:
+ ani = Animal(name=a)
+ ani.save()
+ animals[a] = ani
+
+ Favorite.objects.create_favorite(alice, animals['zebra'])
+ Favorite.objects.create_favorite(chris, animals['donkey'])
+
+ zebra = Animal.objects.with_favorite_for(alice).get(name='zebra')
+ self.assertEquals(zebra.favorite__favorite, 1)
+
+ all_animals = Animal.objects.with_favorite_for(alice).all()
+ self.assertEquals(len(all_animals), 3)
+
+ favorite_animals = Animal.objects.with_favorite_for(alice, all=False).all()
+ self.assertEquals(len(favorite_animals), 1)
diff --git a/favorites/views.py b/favorites/views.py
new file mode 100644
index 0000000..e69de29
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..7183278
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,18 @@
+from distutils.core import setup
+
+setup(
+ name = 'tagging',
+ version = version,
+ description = 'Generic favorites application for Django',
+ author = 'Andrew Gwozdziewycz',
+ author_email = 'hg@apgwoz.com',
+ packages = ['favorites'],
+ classifiers = ['Development Status :: 4 - Beta',
+ 'Environment :: Web Environment',
+ 'Framework :: Django',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python',
+ 'Topic :: Utilities'],
+)
|
redjohn/misc
|
17be97cdaa581663c5e139bea1484ea3b7a243e9
|
Added eclipse preferences
|
diff --git a/tango.epf b/tango.epf
new file mode 100644
index 0000000..5faec3d
--- /dev/null
+++ b/tango.epf
@@ -0,0 +1,254 @@
+#Wed Sep 15 14:53:18 MDT 2010
+/instance/org.eclipse.wst.html.core/piUndefined=2
+/instance/org.eclipse.wst.jsdt.web.core/jspIndexState=1
+/instance/org.eclipse.mylyn.context.core/mylyn.attention.migrated=true
+/instance/org.eclipse.ui.ide/EXIT_PROMPT_ON_CLOSE_LAST_WINDOW=false
+/instance/org.eclipse.wst.sse.core/task-tag-projects-already-scanned=Alta,Beehive
+/instance/org.eclipse.ui.views.log/activate=true
+/instance/org.eclipse.wst.html.core/cdataInvalidContent=2
+/instance/org.eclipse.ui.workbench/<Pydev>_persp=<?xml version\="1.0" encoding\="UTF-8"?>\n<perspective editorAreaTrimState\="2" editorAreaVisible\="1" fixed\="0" version\="0.016">\n<descriptor descriptor\="org.python.pydev.ui.PythonPerspective" id\="<Pydev>" label\="<Pydev>"/>\n<window height\="768" width\="1024" x\="0" y\="25"/>\n<alwaysOnActionSet id\="org.eclipse.ui.cheatsheets.actionSet"/>\n<alwaysOnActionSet id\="org.eclipse.search.searchActionSet"/>\n<alwaysOnActionSet id\="org.eclipse.ui.edit.text.actionSet.annotationNavigation"/>\n<alwaysOnActionSet id\="org.eclipse.ui.edit.text.actionSet.navigation"/>\n<alwaysOnActionSet id\="org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo"/>\n<alwaysOnActionSet id\="org.eclipse.ui.externaltools.ExternalToolsSet"/>\n<alwaysOnActionSet id\="org.eclipse.ui.actionSet.keyBindings"/>\n<alwaysOnActionSet id\="org.eclipse.ui.actionSet.openFiles"/>\n<alwaysOnActionSet id\="org.eclipse.mylyn.context.ui.actionSet"/>\n<alwaysOnActionSet id\="org.eclipse.mylyn.doc.actionSet"/>\n<alwaysOnActionSet id\="org.eclipse.mylyn.tasks.ui.navigation"/>\n<alwaysOnActionSet id\="org.eclipse.debug.ui.launchActionSet"/>\n<alwaysOnActionSet id\="org.eclipse.ui.NavigateActionSet"/>\n<show_view_action id\="org.eclipse.search.ui.views.SearchView"/>\n<show_view_action id\="org.eclipse.ui.console.ConsoleView"/>\n<show_view_action id\="org.eclipse.ui.views.ContentOutline"/>\n<show_view_action id\="org.eclipse.ui.views.ProblemView"/>\n<show_view_action id\="org.eclipse.ui.views.ResourceNavigator"/>\n<show_view_action id\="org.eclipse.pde.runtime.LogView"/>\n<show_view_action id\="org.eclipse.ui.views.TaskList"/>\n<show_view_action id\="org.python.pydev.views.PyRefactorView"/>\n<show_view_action id\="org.python.pydev.views.PyCodeCoverageView"/>\n<show_view_action id\="org.python.pydev.navigator.view"/>\n<new_wizard_action id\="org.python.pydev.ui.wizards.project.PythonProjectWizard"/>\n<new_wizard_action id\="org.python.pydev.ui.wizards.files.PythonSourceFolderWizard"/>\n<new_wizard_action id\="org.python.pydev.ui.wizards.files.PythonPackageWizard"/>\n<new_wizard_action id\="org.python.pydev.ui.wizards.files.PythonModuleWizard"/>\n<new_wizard_action id\="org.eclipse.ui.wizards.new.folder"/>\n<new_wizard_action id\="org.eclipse.ui.wizards.new.file"/>\n<new_wizard_action id\="org.eclipse.ui.editors.wizards.UntitledTextFileWizard"/>\n<hide_toolbar_item_id id\="org.eclipse.ui.edit.text.toggleShowSelectedElementOnly"/>\n<view id\="org.eclipse.ui.views.ContentOutline"/>\n<fastViewBars>\n<fastViewBar fastViewLocation\="1024" id\="bottom" orientation\="256" selectedTabId\="net.sourceforge.sqlexplorer.plugin.views.DatabaseDetailView" style\="0">\n<fastViews>\n<view id\="org.eclipse.team.ui.GenericHistoryView" ratio\="0.2996633"/>\n</fastViews>\n</fastViewBar>\n<fastViewBar fastViewLocation\="1024" id\="org.eclipse.ui.internal.ViewStack@72ec315b" orientation\="256" selectedTabId\="org.eclim.eclipse.headed.EclimdView" style\="0">\n<fastViews>\n<view id\="org.eclipse.ui.views.ProblemView" ratio\="0.3"/>\n<view id\="org.eclipse.ui.console.ConsoleView" ratio\="0.3"/>\n</fastViews>\n</fastViewBar>\n</fastViewBars>\n<layout>\n<mainWindow>\n<info folder\="true" part\="topLeft">\n<folder activePageID\="org.python.pydev.navigator.view" appearance\="2" expanded\="2">\n<page content\="org.python.pydev.navigator.view" label\="LabelNotFound"/>\n<presentation id\="org.eclipse.ui.presentations.WorkbenchPresentationFactory">\n<part id\="0"/>\n</presentation>\n</folder>\n</info>\n<info folder\="true" part\="stickyFolderRight" ratio\="0.75" ratioLeft\="1254" ratioRight\="418" relationship\="2" relative\="topLeft">\n<folder appearance\="2" expanded\="2">\n<page content\="org.eclipse.help.ui.HelpView" label\="LabelNotFound"/>\n<page content\="org.eclipse.ui.internal.introview" label\="LabelNotFound"/>\n<page content\="org.eclipse.ui.cheatsheets.views.CheatSheetView" label\="LabelNotFound"/>\n</folder>\n</info>\n<info part\="org.eclipse.ui.editorss" ratio\="0.16762704" ratioLeft\="320" ratioRight\="1589" relationship\="2" relative\="topLeft"/>\n<info folder\="true" part\="bottom" ratio\="0.7522523" ratioLeft\="668" ratioRight\="220" relationship\="4" relative\="org.eclipse.ui.editorss">\n<folder appearance\="2" expanded\="2">\n<page content\="org.eclipse.search.ui.views.SearchView" label\="LabelNotFound"/>\n<page content\="org.eclipse.ui.views.BookmarkView" label\="LabelNotFound"/>\n<page content\="org.eclipse.ui.views.ProgressView" label\="LabelNotFound"/>\n<page content\="org.eclipse.ui.views.TaskList" label\="LabelNotFound"/>\n<page content\="org.eclipse.team.ui.GenericHistoryView" label\="LabelNotFound"/>\n<page content\="org.eclipse.team.sync.views.SynchronizeView" label\="LabelNotFound"/>\n<presentation id\="org.eclipse.ui.presentations.WorkbenchPresentationFactory"/>\n</folder>\n</info>\n<info folder\="true" part\="org.eclipse.ui.internal.ViewStack@5c94dd46" ratio\="0.80832285" ratioLeft\="1282" ratioRight\="304" relationship\="2" relative\="org.eclipse.ui.editorss">\n<folder activePageID\="org.eclipse.ui.views.ContentOutline" appearance\="2" expanded\="2">\n<page content\="org.eclipse.ui.views.ContentOutline" label\="Outline"/>\n<page content\="org.eclipse.pde.runtime.LogView" label\="LabelNotFound"/>\n<presentation id\="org.eclipse.ui.presentations.WorkbenchPresentationFactory">\n<part id\="0"/>\n</presentation>\n</folder>\n</info>\n<info folder\="true" part\="org.eclipse.ui.internal.ViewStack@72ec315b" ratio\="0.7443694" ratioLeft\="661" ratioRight\="227" relationship\="4" relative\="org.eclipse.ui.editorss">\n<folder appearance\="2" expanded\="2">\n<page content\="org.eclipse.ui.views.ProblemView" label\="LabelNotFound"/>\n<page content\="org.eclipse.ui.console.ConsoleView" label\="LabelNotFound"/>\n<page content\="org.eclim.eclipse.headed.EclimdView" label\="LabelNotFound"/>\n<page content\="com.python.pydev.ui.hierarchy.PyHierarchyView" label\="LabelNotFound"/>\n<presentation id\="org.eclipse.ui.presentations.WorkbenchPresentationFactory"/>\n</folder>\n</info>\n</mainWindow>\n</layout>\n</perspective>
+/instance/org.eclim/org.eclim.java.checkstyle.properties=
+/instance/org.eclim/org.eclim.project.vcs.web.url=
+/instance/org.eclipse.wst.html.core/attrInvalidValue=2
+@org.eclipse.epp.usagedata.recording=1.3.0.R201005261100
+/instance/org.eclipse.ui.ide/platformState=1281386071194
+@org.eclipse.ui.ide=3.6.0.I20100601-0800
+/instance/org.eclipse.wst.html.core/elemEndInvalidCase=1
+@org.eclipse.jdt.core=3.6.0.v_A58
+/instance/org.eclipse.egit.ui/RepositorySelectionPage.UsedUrisLength=21
+/instance/org.eclim/org.eclim.java.checkstyle.config=
+/instance/org.python.pydev/org.python.pydev.OUTLINE_ALPHA_SORT=true
+/instance/org.eclipse.ui.workbench/editors=<?xml version\="1.0" encoding\="UTF-8"?>\n<editors>\n<descriptor class\="org.python.pydev.editor.PyEdit" id\="org.python.pydev.editor.PythonEditor" image\="icons/python_file.gif" internal\="true" label\="Python Editor" openMode\="1" open_in_place\="false" plugin\="org.python.pydev"/>\n<descriptor id\="org.eclipse.ui.browser.editorSupport" image\="$nl$/icons/obj16/internal_browser.gif" internal\="false" label\="Web Browser" launcher\="org.eclipse.ui.internal.browser.BrowserLauncher" openMode\="4" open_in_place\="false" plugin\="org.eclipse.ui.browser"/>\n<descriptor class\="net.sourceforge.sqlexplorer.plugin.editors.SQLEditor" id\="net.sourceforge.sqlexplorer.plugin.editors.SQLEditor" image\="icons/editor.gif" internal\="true" label\="Sql Editor" openMode\="1" open_in_place\="false" plugin\="net.sourceforge.sqlexplorer"/>\n<descriptor class\="net.sourceforge.sqlexplorer.filelist.FileListEditor" id\="net.sourceforge.sqlexplorer.filelist.FileListEditor" image\="icons/filelist.gif" internal\="true" label\="File List Editor" openMode\="1" open_in_place\="false" plugin\="net.sourceforge.sqlexplorer"/>\n<descriptor id\="org.eclipse.jdt.ui.JARDescEditor" image\="$nl$/icons/full/obj16/jar_desc_obj.gif" internal\="false" label\="JAR Export Wizard" launcher\="org.eclipse.jdt.internal.ui.jarpackager.OpenJarExportWizardEditorLauncher" openMode\="4" open_in_place\="false" plugin\="org.eclipse.jdt.ui"/>\n<descriptor class\="org.eclipse.jdt.internal.debug.ui.snippeteditor.JavaSnippetEditor" id\="org.eclipse.jdt.debug.ui.SnippetEditor" image\="$nl$/icons/full/obj16/jsbook_obj.gif" internal\="true" label\="Scrapbook" openMode\="1" open_in_place\="false" plugin\="org.eclipse.jdt.debug.ui"/>\n</editors>
+@org.eclipse.wst.sse.core=1.1.500.v201006020308
+/instance/org.eclipse.wst.sse.ui/content_assist_number_of_computers=7
+/instance/org.eclipse.jdt.ui/org.eclipse.jdt.ui.javadoclocations.migrated=true
+@org.eclipse.wst.sse.ui=1.2.0.v201006030742
+/instance/org.eclipse.debug.ui/preferredTargets=default\:default|
+/configuration/org.eclipse.ui.ide/SHOW_WORKSPACE_SELECTION_DIALOG=false
+/instance/org.eclipse.egit.ui/RepositorySelectionPage.UsedUris=file\:////projects/bee
+/instance/org.eclim/org.eclim.user.email=
+/instance/org.eclipse.epp.usagedata.gathering/org.eclipse.epp.usagedata.gathering.terms_accepted=true
+/instance/org.eclipse.egit.ui/decorator_show_tracked_icon=false
+/instance/org.eclipse.wst.html.core/attrUndefValue=2
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.codeComplete.visibilityCheck=enabled
+/instance/org.eclipse.ant.ui/useQuickDiffPrefPage=true
+/instance/org.eclipse.wst.html.core/docDuplicateTag=1
+/instance/org.eclipse.wst.css.ui/PROPERTY_VALUE=\#00aa00 | null | false | true | false | false
+/instance/org.eclipse.ui.workbench/ColorsAndFontsPreferencePage.expandedCategories=Torg.eclipse.ui.workbenchMisc
+/instance/com.python.pydev.codecompletion/CHARS_FOR_CTX_INSENSITIVE_TOKENS_COMPLETION=200
+/instance/org.eclipse.wst.html.core/elemUnknownName=2
+@org.eclipse.team.ui=3.5.100.I20100527-0800
+/instance/org.kacprzak.eclipse.django.editor.plugin/_django.editor.custom.templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
+@org.python.pydev=1.6.0.2010071813
+/instance/org.eclipse.jdt.launching/org.eclipse.jdt.launching.PREF_VM_XML=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\n<vmSettings defaultVM\="57,org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType13,1272653886321" defaultVMConnector\="">\n<vmType id\="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType">\n<vm id\="1272653886321" javadocURL\="http\://java.sun.com/javase/6/docs/api/" name\="java-6-sun-1.6.0.20" path\="/usr/lib/jvm/java-6-sun-1.6.0.20">\n<libraryLocations>\n<libraryLocation jreJar\="/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/resources.jar" jreJavadoc\="http\://java.sun.com/javase/6/docs/api/" jreSrc\="" pkgRoot\=""/>\n<libraryLocation jreJar\="/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/rt.jar" jreJavadoc\="http\://java.sun.com/javase/6/docs/api/" jreSrc\="" pkgRoot\=""/>\n<libraryLocation jreJar\="/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/jsse.jar" jreJavadoc\="http\://java.sun.com/javase/6/docs/api/" jreSrc\="" pkgRoot\=""/>\n<libraryLocation jreJar\="/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/jce.jar" jreJavadoc\="http\://java.sun.com/javase/6/docs/api/" jreSrc\="" pkgRoot\=""/>\n<libraryLocation jreJar\="/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/charsets.jar" jreJavadoc\="http\://java.sun.com/javase/6/docs/api/" jreSrc\="" pkgRoot\=""/>\n<libraryLocation jreJar\="/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/ext/sunpkcs11.jar" jreJavadoc\="http\://java.sun.com/javase/6/docs/api/" jreSrc\="" pkgRoot\=""/>\n<libraryLocation jreJar\="/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/ext/sunjce_provider.jar" jreJavadoc\="http\://java.sun.com/javase/6/docs/api/" jreSrc\="" pkgRoot\=""/>\n<libraryLocation jreJar\="/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/ext/dnsns.jar" jreJavadoc\="http\://java.sun.com/javase/6/docs/api/" jreSrc\="" pkgRoot\=""/>\n<libraryLocation jreJar\="/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/ext/localedata.jar" jreJavadoc\="http\://java.sun.com/javase/6/docs/api/" jreSrc\="" pkgRoot\=""/>\n</libraryLocations>\n</vm>\n</vmType>\n</vmSettings>\n
+/instance/org.eclipse.wst.html.core/elemInvalidName=1
+/instance/org.eclipse.team.cvs.ui/pref_first_startup=false
+/instance/org.eclipse.ui.ide/quickStart=false
+/instance/org.eclim/org.eclim.java.logging.template=logger.gst
+\!/=
+/instance/org.python.pydev/FUNC_NAME_COLOR=138,226,52
+@org.eclipse.search=3.6.0.v20100520-0800
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.source=1.6
+/instance/org.eclipse.ui.ide/tipsAndTricks=true
+/instance/org.eclipse.jdt.ui/tabWidthPropagated=true
+/instance/org.eclipse.wst.jsdt.core/org.eclipse.wst.jsdt.core.codeComplete.visibilityCheck=enabled
+@org.eclipse.debug.ui=3.6.0.v20100601-1530
+/instance/org.python.pydev/KEYWORD_COLOR=173,127,168
+/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.SelectionForeground.SystemDefault=false
+/instance/org.eclipse.ui.editors/overviewRuler_migration=migrated_3.1
+/instance/org.eclim/org.eclim.java.doc.sourcepath=
+@org.eclipse.egit.ui=0.8.4
+/configuration/com.aptana.db/ide-id=910c38fd-5583-4046-b2d9-8d3915467315
+/instance/org.eclipse.wst.html.ui/tagAttributeValue=\#00aa00 | null | false | true | false | false
+@org.eclipse.ui.workbench=3.6.0.I20100603-1100
+/instance/org.eclipse.wst.html.core/piInvalidContent=2
+/instance/org.eclipse.mylyn.monitor.ui/org.eclipse.mylyn.monitor.activity.tracking.enabled.checked=true
+/instance/org.eclipse.ui.workbench/<SQL_Explorer>_persp=<?xml version\="1.0" encoding\="UTF-8"?>\n<perspective editorAreaTrimState\="2" editorAreaVisible\="1" fixed\="0" version\="0.016">\n<descriptor descriptor\="net.sourceforge.sqlexplorer.plugin.perspectives.SQLExplorerPluginPerspective" id\="<SQL_Explorer>" label\="<SQL Explorer>"/>\n<window height\="1037" width\="1922" x\="0" y\="24"/>\n<alwaysOnActionSet id\="org.eclipse.mylyn.context.ui.actionSet"/>\n<alwaysOnActionSet id\="org.eclipse.mylyn.doc.actionSet"/>\n<alwaysOnActionSet id\="org.eclipse.mylyn.tasks.ui.navigation"/>\n<alwaysOnActionSet id\="org.eclipse.ui.cheatsheets.actionSet"/>\n<alwaysOnActionSet id\="org.eclipse.search.searchActionSet"/>\n<alwaysOnActionSet id\="org.eclipse.ui.edit.text.actionSet.annotationNavigation"/>\n<alwaysOnActionSet id\="org.eclipse.ui.edit.text.actionSet.navigation"/>\n<alwaysOnActionSet id\="org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo"/>\n<alwaysOnActionSet id\="org.eclipse.ui.externaltools.ExternalToolsSet"/>\n<alwaysOnActionSet id\="org.eclipse.ui.actionSet.keyBindings"/>\n<alwaysOnActionSet id\="org.eclipse.ui.actionSet.openFiles"/>\n<show_view_action id\="net.sourceforge.sqlexplorer.connections.ConnectionsView"/>\n<show_view_action id\="net.sourceforge.sqlexplorer.plugin.views.DatabaseStructureView"/>\n<show_view_action id\="net.sourceforge.sqlexplorer.plugin.views.DatabaseDetailView"/>\n<show_view_action id\="net.sourceforge.sqlexplorer.plugin.views.SQLHistoryView"/>\n<hide_toolbar_item_id id\="org.eclipse.ui.edit.text.toggleShowSelectedElementOnly"/>\n<view id\="org.eclipse.ui.navigator.ProjectExplorer"/>\n<view id\="org.eclipse.ui.views.ProgressView"/>\n<view id\="org.eclipse.search.ui.views.SearchView"/>\n<view id\="org.eclipse.team.ui.GenericHistoryView"/>\n<fastViewBars/>\n<layout>\n<mainWindow>\n<info folder\="true" part\="topLeft">\n<folder activePageID\="org.eclipse.ui.navigator.ProjectExplorer" appearance\="2" expanded\="2">\n<page content\="org.eclipse.ui.navigator.ProjectExplorer" label\="Project Explorer"/>\n<page content\="net.sourceforge.sqlexplorer.connections.ConnectionsView" label\="LabelNotFound"/>\n<presentation id\="org.eclipse.ui.presentations.WorkbenchPresentationFactory">\n<part id\="0"/>\n</presentation>\n</folder>\n</info>\n<info folder\="true" part\="stickyFolderRight" ratio\="0.75" ratioLeft\="1434" ratioRight\="478" relationship\="2" relative\="topLeft">\n<folder appearance\="2" expanded\="2">\n<page content\="org.eclipse.help.ui.HelpView" label\="LabelNotFound"/>\n<page content\="org.eclipse.ui.internal.introview" label\="LabelNotFound"/>\n<page content\="org.eclipse.ui.cheatsheets.views.CheatSheetView" label\="LabelNotFound"/>\n</folder>\n</info>\n<info part\="org.eclipse.ui.editorss" ratio\="0.14981666" ratioLeft\="286" ratioRight\="1623" relationship\="2" relative\="topLeft"/>\n<info folder\="true" part\="right" ratio\="0.699877" ratioLeft\="1138" ratioRight\="488" relationship\="2" relative\="org.eclipse.ui.editorss">\n<folder activePageID\="net.sourceforge.sqlexplorer.plugin.views.DatabaseStructureView" appearance\="2" expanded\="2">\n<page content\="net.sourceforge.sqlexplorer.plugin.views.DatabaseStructureView" label\="LabelNotFound"/>\n<presentation id\="org.eclipse.ui.presentations.WorkbenchPresentationFactory">\n<part id\="0"/>\n</presentation>\n</folder>\n</info>\n<info folder\="true" part\="bottomRight" ratio\="0.8989899" ratioLeft\="801" ratioRight\="90" relationship\="4" relative\="right">\n<folder activePageID\="org.eclipse.ui.views.ProgressView" appearance\="2" expanded\="2">\n<page content\="org.eclipse.ui.views.ProgressView" label\="Progress"/>\n<page content\="org.eclipse.search.ui.views.SearchView" label\="Search"/>\n<page content\="org.eclipse.team.ui.GenericHistoryView" label\="History"/>\n<page content\="org.eclim.eclipse.headed.EclimdView" label\="LabelNotFound"/>\n<presentation id\="org.eclipse.ui.presentations.WorkbenchPresentationFactory">\n<part id\="0"/>\n<part id\="1"/>\n<part id\="2"/>\n</presentation>\n</folder>\n</info>\n<info folder\="true" part\="bottom" ratio\="0.7601351" ratioLeft\="675" ratioRight\="213" relationship\="4" relative\="org.eclipse.ui.editorss">\n<folder activePageID\="net.sourceforge.sqlexplorer.plugin.views.DatabaseDetailView" appearance\="2" expanded\="2">\n<page content\="net.sourceforge.sqlexplorer.plugin.views.DatabaseDetailView" label\="LabelNotFound"/>\n<presentation id\="org.eclipse.ui.presentations.WorkbenchPresentationFactory">\n<part id\="0"/>\n</presentation>\n</folder>\n</info>\n<info folder\="true" part\="bottomLeft" ratio\="0.2996633" ratioLeft\="267" ratioRight\="624" relationship\="4" relative\="topLeft">\n<folder activePageID\="net.sourceforge.sqlexplorer.plugin.views.SQLHistoryView" appearance\="2" expanded\="2">\n<page content\="net.sourceforge.sqlexplorer.plugin.views.SQLHistoryView" label\="LabelNotFound"/>\n<presentation id\="org.eclipse.ui.presentations.WorkbenchPresentationFactory">\n<part id\="0"/>\n</presentation>\n</folder>\n</info>\n</mainWindow>\n</layout>\n</perspective>
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.JRE_LIB=/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/rt.jar
+/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.SelectionBackground.SystemDefault=false
+/instance/org.eclipse.wst.html.core/elemInvalidDirective=1
+/instance/org.eclipse.jdt.ui/org.eclipse.jdt.internal.ui.navigator.layout=2
+/instance/org.eclipse.wst.html.core/cdataUnclosed=1
+/instance/org.eclipse.ui.workbench/perspectives=<Pydev> <SQL_Explorer>
+/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.Background=46,52,54
+/instance/org.eclipse.ui.editors/lineNumberColor=255,255,255
+@org.eclipse.wst.html.core=1.1.400.v201005261534
+@org.eclipse.ant.ui=3.5.0.v20100427
+/instance/org.eclipse.wst.html.core/elemDuplicate=2
+/instance/org.eclipse.ui/showIntro=false
+/instance/org.eclipse.ui.views.log/orderType=0
+/instance/org.eclim/org.eclim.java.run.mainclass=none
+/instance/org.eclipse.team.ui/org.eclipse.team.ui.first_time=false
+/instance/org.eclipse.wst.jsdt.ui/org.eclipse.wst.jsdt.ui.editor.tab.width=
+/instance/org.eclipse.wst.jsdt.ui/org.eclipse.wst.jsdt.ui.javadoclocations.migrated=true
+/instance/org.eclim/org.eclim.java.compile.sourcepath=
+/instance/org.python.pydev/NUMBER_COLOR=246,195,62
+/instance/org.eclim/org.eclim.project.version=1.0
+/configuration/org.eclipse.ui.ide/RECENT_WORKSPACES_PROTOCOL=3
+/instance/org.python.pydev/org.python.pydev.editor.templates.PyTemplatePreferencesPage=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
+/instance/org.eclipse.debug.ui/pref_state_memento.org.eclipse.debug.ui.VariableView=<?xml version\="1.0" encoding\="UTF-8"?>\n<VariablesViewMemento org.eclipse.debug.ui.SASH_DETAILS_PART\="315" org.eclipse.debug.ui.SASH_VIEW_PART\="684">\n<PRESENTATION_CONTEXT_PROPERTIES IMemento.internal.id\="org.eclipse.debug.ui.VariableView"/>\n</VariablesViewMemento>
+/instance/org.eclipse.wst.html.core/commentInvalidContent=2
+/instance/org.eclipse.debug.ui/preferredDetailPanes=DefaultDetailPane\:DefaultDetailPane|
+/configuration/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
+/instance/org.python.pydev/DJANGO_CUSTOM_COMMANDS=runserver
+/instance/org.eclipse.wst.html.core/elemMissingStart=2
+@org.eclipse.egit.core=0.8.4
+/instance/org.eclipse.jdt.ui/sourceHoverBackgroundColor=0,0,0
+/instance/org.eclipse.jdt.ui/useQuickDiffPrefPage=true
+/instance/org.eclipse.jdt.ui/content_assist_proposals_foreground=50,50,50
+/instance/net.sourceforge.vrapper.eclipse/vrapperEnabled=true
+/instance/org.eclipse.wst.jsdt.ui/fontPropagated=true
+/instance/org.eclipse.wst.xml.ui/lastActivePage=1
+@com.python.pydev.codecompletion=1.6.0.2010071813
+/instance/org.eclipse.epp.usagedata.recording/org.eclipse.epp.usagedata.recording.last-upload=1284393275317
+/instance/org.eclim/org.eclim.java.doc.packagenames=
+/instance/net.sourceforge.sqlexplorer/Confirm.CloseAllConnections=false
+/instance/com.python.pydev.codecompletion/USE_KEYWORDS_CODE_COMPLETION=false
+/instance/org.eclipse.ui.editors/printMarginColumn=120
+/instance/org.python.pydev/INTERPRETER_PATH_NEW=Name\:python1\:EndName\:Version2.6Executable\:/usr/bin/python2.6|/usr/lib/pymodules/python2.6|/usr/lib/pymodules/python2.6/gtk-2.0|/usr/lib/python2.6|/usr/lib/python2.6/dist-packages|/usr/lib/python2.6/dist-packages/PIL|/usr/lib/python2.6/dist-packages/gst-0.10|/usr/lib/python2.6/dist-packages/gtk-2.0|/usr/lib/python2.6/dist-packages/wx-2.6-gtk2-unicode|/usr/lib/python2.6/lib-dynload|/usr/lib/python2.6/lib-old|/usr/lib/python2.6/lib-tk|/usr/lib/python2.6/plat-linux2|/usr/local/lib/python2.6/dist-packages|/usr/lib/pymodules/python2.6/soaplib@$|Image|OpenGL|__builtin__|__main__|_ast|_bisect|_bytesio|_codecs|_codecs_cn|_codecs_hk|_codecs_iso2022|_codecs_jp|_codecs_kr|_codecs_tw|_collections|_csv|_fileio|_functools|_heapq|_hotshot|_json|_locale|_lsprof|_md5|_multibytecodec|_random|_sha|_sha256|_sha512|_socket|_sre|_struct|_subprocess|_symtable|_warnings|_weakref|_winreg|array|audioop|binascii|cPickle|cStringIO|cmath|datetime|email|errno|exceptions|fcntl|future_builtins|gc|grp|imageop|imp|itertools|marshal|math|mmap|msvcrt|nt|numpy|operator|os|os.path|parser|posix|pwd|select|signal|spwd|strop|sys|syslog|thread|time|unicodedata|wx|wxPython|xxsubtype|zipimport|zlib&&&&&
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+/instance/org.eclipse.ui.editors/pydevOccurrenceIndicationColor=77,77,77
+@org.eclipse.jdt.ui=3.6.0.v20100602-1600
+/instance/org.eclipse.ui.editors/currentLineColor=45,45,45
+/instance/org.eclipse.ui.workbench/resourcetypes=<?xml version\="1.0" encoding\="UTF-8"?>\n<editors version\="3.1">\n<info extension\="pyw" name\="*">\n<editor id\="org.python.pydev.editor.PythonEditor"/>\n<defaultEditor id\="org.python.pydev.editor.PythonEditor"/>\n</info>\n<info extension\="py" name\="*">\n<editor id\="org.python.pydev.editor.PythonEditor"/>\n<defaultEditor id\="org.python.pydev.editor.PythonEditor"/>\n</info>\n<info extension\="html" name\="*">\n<editor id\="org.eclipse.ui.browser.editorSupport"/>\n</info>\n<info extension\="htm" name\="*">\n<editor id\="org.eclipse.ui.browser.editorSupport"/>\n</info>\n<info extension\="sql" name\="*">\n<editor id\="net.sourceforge.sqlexplorer.plugin.editors.SQLEditor"/>\n<defaultEditor id\="net.sourceforge.sqlexplorer.plugin.editors.SQLEditor"/>\n</info>\n<info extension\="fls" name\="*">\n<editor id\="net.sourceforge.sqlexplorer.filelist.FileListEditor"/>\n<defaultEditor id\="net.sourceforge.sqlexplorer.filelist.FileListEditor"/>\n</info>\n<info extension\="jardesc" name\="*">\n<editor id\="org.eclipse.jdt.ui.JARDescEditor"/>\n<defaultEditor id\="org.eclipse.jdt.ui.JARDescEditor"/>\n</info>\n<info extension\="jpage" name\="*">\n<editor id\="org.eclipse.jdt.debug.ui.SnippetEditor"/>\n</info>\n<info extension\="shtml" name\="*">\n<editor id\="org.eclipse.ui.browser.editorSupport"/>\n</info>\n</editors>
+/instance/org.eclipse.wst.html.core/docInvalidContent=-1
+/instance/org.eclipse.ui.workbench/org.eclipse.ui.commands=<?xml version\="1.0" encoding\="UTF-8"?>\n<org.eclipse.ui.commands/>
+/instance/org.eclipse.wst.html.core/elemCoexistence=2
+/instance/org.eclipse.jdt.ui/useAnnotationsPrefPage=true
+/instance/org.python.pydev/KEYWORD_STYLE=1
+/instance/org.python.pydev/CLASS_NAME_COLOR=138,226,52
+/instance/org.eclipse.ui.ide/PROBLEMS_FILTERS_MIGRATE=true
+/configuration/org.eclipse.ui.ide/RECENT_WORKSPACES=/home/redjohn/workspace
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.USER_HOME=/home/redjohn
+/instance/org.eclipse.wst.html.ui/tagName=\#ad7fa8 | null | false | false | false | false
+/instance/org.eclipse.jdt.ui/org.eclipse.jdt.ui.formatterprofiles.version=11
+/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.SelectionForeground=82,82,82
+/instance/org.eclipse.wst.sse.ui/useQuickDiffPrefPage=true
+@org.kacprzak.eclipse.django.editor.plugin=0.5.4
+/instance/org.eclipse.ui.views.log/groupBy=0
+/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.Foreground.SystemDefault=false
+/instance/org.eclim/org.eclim.project.copyright=
+/instance/org.eclipse.wst.html.core/elemUnclosedStartTag=1
+/instance/org.python.pydev/SELF_COLOR=246,195,62
+/instance/org.python.pydev/TRIM_EMPTY_LINES=true
+/instance/org.eclipse.wst.jsdt.ui/org.eclipse.wst.jsdt.internal.ui.navigator.layout=1
+/instance/org.eclipse.wst.html.core/attrValueUnclosed=2
+/instance/org.eclipse.wst.html.core/elemMissingEnd=2
+/instance/org.eclim/org.eclim.java.junit.output_dir=
+/instance/net.sourceforge.sqlexplorer/SQLEditor.KeywordColor=160,32,240
+file_export_version=3.0
+@org.eclipse.mylyn.context.core=3.4.0.v20100608-0100-e3x
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.JUNIT_HOME=/home/redjohn/eclipse/plugins/org.junit_3.8.2.v3_8_2_v20100427-1100/
+/instance/org.eclipse.wst.html.core/docDoctypeUnclosed=1
+@org.eclim=1.5.8
+/configuration/org.eclipse.ui.ide/MAX_RECENT_WORKSPACES=5
+/instance/org.eclipse.wst.jsdt.ui/java_keyword=173,127,168
+/instance/org.eclipse.wst.sse.ui/hoverModifiers=combinationHover|true|0;problemHover|false|0;documentationHover|false|0;annotationHover|true|Shift;
+/instance/org.eclipse.ant.ui/useAnnotationsPrefPage=true
+/instance/org.eclipse.ui.editors/printMargin=true
+/instance/org.eclipse.jdt.ui/spelling_locale_initialized=true
+/instance/org.eclipse.jdt.ui/content_assist_number_of_computers=16
+@org.eclipse.wst.xml.ui=1.1.100.v201006030742
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+/instance/org.eclipse.wst.html.ui/tagBorder=\#ad7fa8 | null | false | false | false | false
+/instance/net.sourceforge.sqlexplorer/SQLEditor.ColumnsColor=173,127,168
+/instance/org.eclipse.debug.ui/pref_state_memento.org.eclipse.debug.ui.DebugVieworg.eclipse.debug.ui.DebugView=<?xml version\="1.0" encoding\="UTF-8"?>\n<DebugViewMemento org.eclipse.debug.ui.BREADCRUMB_DROPDOWN_AUTO_EXPAND\="false"/>
+/instance/org.eclipse.jdt.ui/org.eclipse.jdt.ui.editor.tab.width=
+/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.Background.SystemDefault=false
+/instance/org.eclipse.egit.ui/GitRepositoriesView.GitDirectories=/projects/bee/.git\:
+/instance/org.eclipse.wst.jsdt.ui/java_bracket=191,191,191
+/instance/net.sourceforge.sqlexplorer/SQLEditor.TableColor=173,127,168
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.compliance=1.6
+/instance/org.eclipse.wst.html.core/attrValueMismatch=1
+/instance/org.eclipse.ui.editors/printMarginColor=255,0,0
+/instance/org.eclim/org.eclim.project.vcs.web.viewer=viewvc
+/instance/org.eclim/org.eclim.user.name=
+/instance/org.eclipse.ui.views.log/show_filter_text=true
+/instance/org.eclipse.epp.usagedata.recording/org.eclipse.epp.usagedata.recording.ask=false
+/instance/org.eclim/org.eclim.java.logging.impl=commons-logging
+/instance/org.eclim/org.eclim.java.junit.version=4
+/instance/org.eclipse.wst.html.core/attrUndefName=2
+/instance/org.eclipse.wst.xml.ui/tagAttributeName=\#ad7fa8 | null | false | false | false | false
+/instance/org.eclipse.wst.css.ui/PROPERTY_NAME=\#ad7fa8 | null | false | false | false | false
+/instance/org.eclipse.ui.editors/occurrenceIndicationColor=77,77,77
+@org.eclipse.ui.editors=3.6.0.v20100520-0800
+/instance/org.eclipse.wst.jsdt.ui/org.eclipse.jface.textfont=1|Monospace|10.0|0|GTK|1|;
+/instance/org.eclipse.search/org.eclipse.search.defaultPerspective=org.eclipse.search.defaultPerspective.none
+@org.eclipse.wst.jsdt.ui=1.1.0.v201005200157
+/instance/org.python.pydev/USE_METHODS_FORMAT=1
+/instance/org.eclipse.core.resources/version=1
+@org.eclipse.core.net=1.2.100.I20100511-0800
+/instance/org.eclipse.wst.jsdt.ui/tabWidthPropagated=true
+/instance/org.eclipse.wst.jsdt.ui/java_default=191,191,191
+/instance/org.eclipse.wst.html.ui/entityReference=\#1e90ff | null | false | false | false | false
+/instance/org.eclipse.wst.html.ui/org.eclipse.wst.sse.ui.custom_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
+/instance/org.eclipse.wst.jsdt.ui/org.eclipse.wst.jsdt.ui.formatterprofiles.version=11
+/instance/org.eclipse.wst.jsdt.ui/useAnnotationsPrefPage=true
+/instance/org.python.pydev/CODE_COLOR=191,191,191
+/instance/org.python.pydev/BACKQUOTES_COLOR=255,255,255
+@org.eclipse.mylyn.monitor.ui=3.4.0.v20100608-0100-e3x
+/instance/org.eclipse.jdt.ui/proposalOrderMigrated=true
+/instance/org.eclipse.egit.core/RepositorySearchDialogSearchPath=/projects/bee
+/instance/org.eclipse.jdt.ui/content_assist_proposals_background=255,255,255
+@org.eclipse.core.resources=3.6.0.v20100526-0737
+/instance/org.eclipse.debug.ui/org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\n<launchPerspectives/>\n
+/instance/org.eclipse.jdt.ui/org.eclipse.jface.textfont=1|Monospace|10.0|0|GTK|1|;
+@org.eclipse.wst.html.ui=1.0.500.v201006030742
+@net.sourceforge.sqlexplorer=3.5.1.v20100211_SR3b
+@net.sourceforge.vrapper.eclipse=0.14.0
+/instance/org.eclipse.wst.html.core/attrInvalidName=2
+@org.eclipse.jdt.launching=3.5.100.v20100526
+/instance/org.eclipse.wst.xml.ui/tagAttributeValue=\#00aa00 | null | false | true | false | false
+@org.eclipse.epp.usagedata.gathering=1.3.0.R201005261100
+@org.eclipse.team.cvs.ui=3.3.300.I20100526-0800
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.JRE_SRCROOT=
+/instance/net.sourceforge.sqlexplorer/SQLEditor.DefaultColor=212,212,212
+/instance/org.eclipse.jdt.ui/fontPropagated=true
+/instance/org.eclim/org.eclim.project.tracker=
+/instance/org.eclipse.wst.jsdt.ui/proposalOrderMigrated=true
+/instance/org.eclipse.egit.ui/decorator_recursive_limit=10
+/instance/org.eclipse.wst.html.ui/tagAttributeName=\#5ab35a | null | false | false | false | false
+@org.eclipse.ui.views.log=1.0.100.v20100423
+/instance/org.eclim/org.eclim.java.doc.dest=doc
+/instance/org.eclipse.wst.html.core/elemInvalidContent=-1
+/instance/org.eclipse.wst.html.core/elemInvalidEmptyTag=2
+/instance/org.eclipse.ui.workbench/ColorsAndFontsPreferencePage.selectedElement=Torg.eclipse.jdt.ui.presentation
+/instance/org.eclipse.wst.sse.ui/useAnnotationsPrefPage=true
+/instance/org.eclipse.wst.html.core/attrNameMismatch=2
+/instance/org.eclipse.ui.views.log/column4=150
+/instance/org.eclipse.ui.views.log/column3=150
+/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.Foreground=255,255,255
+/instance/org.eclipse.ui.views.log/column2=300
+/instance/org.eclipse.wst.jsdt.ui/java_keyword_return=173,127,168
+/instance/org.eclim/org.eclim.java.doc.version=
+/instance/org.eclim/org.eclim.java.validation.ignore.warnings=false
+/instance/org.eclipse.wst.html.core/refInvalidContent=2
+/instance/org.eclipse.wst.html.core/elemUnclosedEndTag=1
+@org.eclipse.wst.jsdt.web.core=1.0.300.v201004150625
+/instance/org.eclipse.wst.jsdt.ui/java_operator=191,191,191
+/instance/org.eclipse.debug.ui/org.eclipse.debug.ui.user_view_bindings=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\n<viewBindings>\n<view id\="org.eclipse.ui.console.ConsoleView">\n<perspective id\="net.sourceforge.sqlexplorer.plugin.perspectives.SQLExplorerPluginPerspective" userAction\="opened"/>\n<perspective id\="org.python.pydev.ui.PythonPerspective" userAction\="opened"/>\n</view>\n</viewBindings>\n
+@org.eclipse.wst.jsdt.core=1.1.0.v201006030738
+/instance/org.eclipse.wst.jsdt.ui/useQuickDiffPrefPage=true
+/instance/org.eclipse.ui.workbench/ENABLED_DECORATORS=org.eclipse.wst.server.ui.decorator\:false,org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator\:true,org.eclipse.jdt.ui.override.decorator\:true,org.eclipse.jdt.ui.interface.decorator\:false,org.eclipse.jdt.ui.buildpath.decorator\:true,org.eclipse.mylyn.context.ui.decorator.interest\:true,org.eclipse.mylyn.tasks.ui.decorators.task\:true,org.eclipse.mylyn.team.ui.changeset.decorator\:true,org.eclipse.team.cvs.ui.decorator\:true,org.eclipse.ui.LinkedResourceDecorator\:true,org.eclipse.ui.VirtualResourceDecorator\:true,org.eclipse.ui.ContentTypeDecorator\:true,org.eclipse.ui.ResourceFilterDecorator\:false,org.eclipse.wst.jsdt.ui.override.decorator\:true,org.eclipse.wst.server.ui.navigatorDecorator\:true,
+/instance/org.eclipse.wst.html.core/commentUnclosed=1
+/instance/org.eclipse.ui.ide/TASKS_FILTERS_MIGRATE=true
+/instance/org.eclipse.wst.html.core/indentationSize=4
+/instance/org.eclipse.wst.html.core/attrDuplicate=2
+/instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
+/instance/org.eclipse.wst.html.core/elemStartInvalidCase=2
+/instance/org.eclipse.wst.html.core/docInvalidChar=2
+/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.SelectionBackground=153,153,153
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+/instance/org.eclipse.wst.html.core/piUnclosed=1
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+/instance/org.eclipse.ui.views.log/orderValue=1
+/instance/org.eclipse.wst.jsdt.ui/java_string=0,170,0
+/instance/org.python.pydev/AUTOCOMPLETE_ON_DOT=false
+/instance/com.python.pydev.codecompletion/CHARS_FOR_CTX_INSENSITIVE_MODULES_COMPLETION=200
+/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.JRE_SRC=
+/instance/org.python.pydev/COMMENT_COLOR=84,84,84
+/instance/org.eclim/org.eclim.java.junit.command=
+@org.eclipse.ui=3.6.0.I20100603-1100
+/instance/org.eclipse.wst.html.core/elemUnnecessaryEnd=2
+@org.eclipse.wst.css.ui=1.0.500.v201004290328
+/instance/org.eclim/org.eclim.java.junit.src_dir=
|
redjohn/misc
|
3580bfd7c51b861d88bdce9998d9b1122fba7d5f
|
Added .emacs file used at work
|
diff --git a/emacs-work b/emacs-work
new file mode 100644
index 0000000..9f962e6
--- /dev/null
+++ b/emacs-work
@@ -0,0 +1,44 @@
+(color-theme-select)
+;(color-theme-deep-blue)
+(load "~/.emacs.d/color-theme-tango.el")
+(color-theme-tango)
+
+(setq viper-mode t)
+(require 'viper)
+
+(setq make-backup-files nil)
+
+(require 'git)
+(require 'git-blame)
+
+(autoload 'python-mode "python-mode.el" "Python mode." t)
+
+(set-frame-width (selected-frame) 120)
+(setq auto-save-default nil)
+
+(load "~/.emacs.d/js/javascript.el")
+(add-to-list 'auto-mode-alist '("\\.js$" . javascript-mode))
+(load "~/.emacs.d/nxhtml/autostart.el")
+(setq mumamo-background-colors nil)
+(add-to-list 'auto-mode-alist '("\\.html$" . django-html-mumamo-mode))
+
+(when (load "flymake" t)
+ (defun flymake-pyflakes-init ()
+ (let* ((temp-file (flymake-init-create-temp-buffer-copy
+ 'flymake-create-temp-inplace))
+ (local-file (file-relative-name
+ temp-file
+ (file-name-directory buffer-file-name))))
+ (list "pyflakes" (list local-file))))
+
+ (add-to-list 'flymake-allowed-file-name-masks
+ '("\\.py\\'" flymake-pyflakes-init)))
+
+(add-hook 'python-mode-hook 'flymake-mode)
+
+(defun vim-exit-shortcut ()
+ "Save and Exit"
+ (interactive)
+ (save-buffer)
+ (kill-buffer))
+(global-set-key [?\C-x ?\C-k] 'vim-exit-shortcut)
|
redjohn/misc
|
73fac54f7fe6e77a8271ee41f7f001fe90f4161c
|
Added file for bash aliases
|
diff --git a/aliases b/aliases
new file mode 100644
index 0000000..4658099
--- /dev/null
+++ b/aliases
@@ -0,0 +1 @@
+alias em='emacs -nw -q -l ~/.emacs-cl'
|
redjohn/misc
|
9da31f3f88bc2a6b72cde256cb95a704bd4cf5d9
|
Stupid fix cause the symlink wasn't working
|
diff --git a/emacs-home b/emacs-home
new file mode 100644
index 0000000..fecdd5d
--- /dev/null
+++ b/emacs-home
@@ -0,0 +1,18 @@
+(autoload 'python-mode "python-mode.el" "Python mode." t)
+(setq auto-mode-alist (append '(("/*.\.py$" . python-mode)) auto-mode-alist))
+
+(setq erlang-root-dir "/usr/lib/erlang")
+(setq exec-path (cons "/usr/lib/erlang/bin" exec-path))
+(require 'erlang-start)
+
+(require 'color-theme)
+(color-theme-select)
+(color-theme-deep-blue)
+
+(add-to-list 'load-path "/usr/share/emacs/site-lisp/clojure-mode")
+(require 'clojure-mode)
+
+(setq make-backup-files nil)
+
+(setq viper-mode t)
+(require 'viper)
diff --git a/emacs-home.txt b/emacs-home.txt
deleted file mode 120000
index 6f2e8f3..0000000
--- a/emacs-home.txt
+++ /dev/null
@@ -1 +0,0 @@
-/home/redjohn/.emacs
\ No newline at end of file
|
simosx/myname
|
2a5ab250cc2f94a79148913e57ba6e944a506d63
|
Added more
|
diff --git a/README b/README
index ca0e44c..f8e7ff3 100644
--- a/README
+++ b/README
@@ -1,2 +1,3 @@
This is the best readme file.
And another test.
+And more.
|
simosx/myname
|
f9c57cca3e4a69dfb9ec6e2b86d55d9f6e5ee163
|
Added zz
|
diff --git a/Makefile.am b/Makefile.am
index ba26731..d84e526 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1 @@
-DOC_LINGUAS = am el en es fr sl zh
+DOC_LINGUAS = am el en es fr sl zh zz
|
simosx/myname
|
983b8f3737422ddbb21f3d0a7c43b2165ba8a3ae
|
Added sl to DOC_LINGUAS
|
diff --git a/Makefile.am b/Makefile.am
index 49977b5..ba26731 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1 @@
-DOC_LINGUAS = am el en es fr zh
+DOC_LINGUAS = am el en es fr sl zh
|
simosx/myname
|
16cad25be3b00d3d3e917487964ae1df563b91da
|
Added zh to DOC_LINGUAS
|
diff --git a/Makefile.am b/Makefile.am
index c366ea3..49977b5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1 @@
-DOC_LINGUAS = am el en es fr
+DOC_LINGUAS = am el en es fr zh
|
simosx/myname
|
2e91fe2ea1b75175d45e17f57364414769450a99
|
Added Makefile.am
|
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..c366ea3
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1 @@
+DOC_LINGUAS = am el en es fr
|
simosx/myname
|
8efa98dcec3c18e217eab8e45c1357765d942b4b
|
Added Greek
|
diff --git a/el.po b/el.po
new file mode 100644
index 0000000..ccac651
--- /dev/null
+++ b/el.po
@@ -0,0 +1,2 @@
+msgid "Hello"
+msgstr "Îεια ÏοÏ
"
|
simosx/myname
|
5e0a8793d129e3b0db367c8c3f2a8ca9774edd32
|
Modifications
|
diff --git a/README b/README
index 0db0fe1..ca0e44c 100644
--- a/README
+++ b/README
@@ -1,2 +1,2 @@
-This is the readme file.
-And a test.
+This is the best readme file.
+And another test.
|
simosx/myname
|
eba82c1eb1e1944cc822f22d5b096a3939ab53d9
|
more text
|
diff --git a/text b/text
index e69de29..fd1b6cc 100644
--- a/text
+++ b/text
@@ -0,0 +1 @@
+hejsdfljsjkl
|
simosx/myname
|
f1dfa91a3d49b2efd0c5f1a4f152dbcb2f8aaec2
|
a text file
|
diff --git a/text b/text
new file mode 100644
index 0000000..e69de29
|
simosx/myname
|
0f1eafb0eb18bf047aafb81b6b53a512cf3e57fa
|
Added README
|
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
|
bld/bld-dyn
|
52ac273e0269aa6d1a92eff70c8158b80263b74a
|
Added cartesian state class & equations of motion.
|
diff --git a/orbit.lisp b/orbit.lisp
index 31d4efa..579b426 100644
--- a/orbit.lisp
+++ b/orbit.lisp
@@ -1,344 +1,356 @@
#|
Orbital Mechanics Library
=========================
Includes:
* Cartesian coordinate equations of motion
* Kustaanheimo-Stiefel equations of motion cast into geometric algebra by Hestenes
* Simple Keplerian trajectories
* Solar sail trajectories
|#
(in-package :bld-orbit)
;; Define infinity norm method for BLD-ODE Runge-Kutta method
(defmethod norminfx ((x g))
(norminf x))
;; Sail force functions
(defvar *lightness* 0.1 "Sail lightness number")
(defvar *mu* 1 "Gravitational parameter")
(defmethod sail-normal-force ((rv g) mu lightness)
"Solar sail force function when sail normal to the sun. RV is the position vector from the sun to the sail."
(* (unitg rv) (/ (* lightness mu) (norme2 rv))))
;; Cartesian equations of motion
(defvar *cart-forcefun* #'(lambda (tm x) (ve3)) "Cartesian coordinate force function")
(defvar *cart-forcefun-sail-normal*
#'(lambda (tm x)
- (sail-normal-force (slot-valuegethash :r x) *mu* *lightness*)) "Cartesian coordinate force function with sail normal to the sun")
+ (sail-normal-force (gethash :r x) *mu* *lightness*)) "Cartesian coordinate force function with sail normal to the sun")
(defmethod dvdt ((r g))
"Cartesian gravitational acceleration"
(- (* r (/ *mu* (expt (norme r) 3)))))
(defclass cartstate ()
- ((r :initarg r :documentation "Position vector")
- (v :initarg v :documentation "Velocity vector"))
+ ((r :initarg :r :documentation "Position vector")
+ (v :initarg :v :documentation "Velocity vector"))
(:documentation "Cartesian coordinate state"))
+(defmethod print-object ((x cartstate) stream)
+ (format stream "#<CARTSTATE :r ~a :v ~a>" (slot-value x 'r) (slot-value x 'v)))
+
(defstatearithmetic cartstate (r v))
-(defun carteom (tm x)
+(defmethod carteom ((tm number) (x hash-table))
+ "Cartesian orbital equations of motion"
+ (with-keys (r v) x
+ (make-hash
+ :r v
+ :v (+ (dvdt r) (funcall *cart-forcefun* tm x)))))
+
+(defmethod carteom ((tm number) (x cartstate))
"Cartesian orbital equations of motion"
(with-slots (r v) x
- (make-instance 'cartstate
- :r v
- :v (+ (dvdt r) (funcall *cart-forcefun* tm x)))))
+ (make-instance
+ 'cartstate
+ :r v
+ :v (+ (dvdt r) (funcall *cart-forcefun* tm x)))))
+
;; Kustaanheimo-Stiefel-Hestenes (KSH) equations of motion
(defclass kshstate ()
((alpha :initarg :alpha :accessor alpha :type re3 :initform (re3) :documentation "Initial orbit spinor")
(beta :initarg :beta :accessor beta :type re3 :initform (re3) :documentation "Initial ")
(e :initarg :e :accessor e :type number :initform -0.5d0 :documentation "Specific Kepler orbit energy")
(tm :initarg :tm :accessor tm :type number :initform 0d0 :documentation "Time")))
;; Define ODE state arithmetic on KSHSTATE class
(defstatearithmetic kshstate (alpha beta e tm))
(defvar *ksh-forcefun* #'(lambda (s x) (ve3)) "KSH force function")
(defvar *ksh-sigma0* (ve3 :c1 1) "KSH reference unit position vector")
(defun w0 (e)
"Average orbit angular velocity given energy"
(sqrt (- (/ e 2))))
(defmethod u ((alpha g) (beta g) w0 s)
"Orbit spinor given ALPHA, BETA, W0, and S"
(+ (* alpha (cos (* w0 s)))
(* beta (sin (* w0 s)))))
#+nil(defmethod alpha ((u g) (duds g) w0 s)
"Alpha (U0) given U, DUDS, W0, and S"
(- (* u (cos (* w0 s)))
(* duds (/ (sin (* w0 s))
w0))))
#+nil(defmethod beta ((u g) (duds g) w0 s)
"Beta (dU0/ds/w0) given U, DUDS, w0, and s"
(+ (* u (sin (* w0 s)))
(* duds (/ (cos (* w0 s))
w0))))
(defmethod duds ((beta g) w0)
"s-derivative of spinor given BETA and W0"
(* beta w0))
(defmethod dalphads ((ff g) w0 s)
"s-derivative of alpha given FF, W0, and S"
(* ff (- (/ (sin (* w0 s)) w0))))
(defmethod dbetads ((ff g) w0 s)
"s-derivative of beta given FF, W0, and S"
(* ff (/ (cos (* w0 s)) w0)))
(defmethod deds ((f g) (duds g) (sigma g) (u g))
"s-derivative of energy"
(scalar (*i f (*g3 duds sigma (revg u)))))
(defmethod dtmds ((u g))
"s-derivative of time"
(norme2 u))
(defun ksheom (s x)
"KS equations of motion in Hestenes GA form.
Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
(with-keys (alpha beta e tm) x
(let* ((w0 (w0 e))
(u (u alpha beta w0 s))
(duds (duds beta w0))
(sigma (spin *ksh-sigma0* alpha))
(r (spin sigma u))
(f (funcall *ksh-forcefun* s x))
(ff (*g3 f r u)))
(make-hash
:alpha (dalphads ff w0 s)
:beta (dbetads ff w0 s)
:e (deds f duds sigma u)
:tm (dtmds u)))))
;; Spinor functions
(defun recoverrotor3d (fs es)
"Recover a basis given new and original bases"
(let ((psi (+ (apply #'+ (mapcar #'*g fs (apply #'recipbvs es))) 1)))
(if (zerogp psi)
(error "zero psi (180 deg rotation) unsupported")
(unitg psi))))
(defun recoverspinor3d (r fs es)
"Recover a spinor given radius, new basis, and original basis"
(* (recoverrotor3d fs es) (sqrt r)))
(defun rvbasis (rv vv)
"Return a set of basis vectors derived from position and velocity"
(let* ((mombv (*o rv vv))
(x (unitg rv))
(y (unitg (*i rv mombv)))
(z (when (= 3 (dimension rv) (dimension vv))
(*x2 x y))))
(if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
(list x y)
(list x y z))))
(defmethod rv2u ((rv g) (vv g) (basis list))
(recoverspinor3d (norme rv) (rvbasis rv vv) basis))
(defmethod rv2dudt ((vv g) (u g) (basis1 g))
(* (*g3 vv u basis1)
(/ (* 2 (norme2 u)))))
(defun rv2spinors (rv vv basis)
"Convert position and velocity vectors to spinor and spinor time derivative"
(let ((u (rv2u rv vv basis)))
(make-hash
:u u
:dudt (rv2dudt vv u (first basis)))))
(defun duds2dt (duds u)
"Convert spinor time derivative (also given spinor) to s derivative"
(/ duds (norme2 u)))
(defun dudt2ds (dudt u)
"Convert spinor s derivative (also given spinor) to t derivative"
(* dudt (norme2 u)))
(defun spinor2r (u basis1)
"Given spinor and 1st basis vector, return corresponding position vector"
(spin basis1 u))
(defmethod spinors2v ((dudt g) (u g) (basisx g))
"Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
(graden (* (*g3 dudt basisx (revg u)) 2d0) 1))
(defun spinors2energy (u duds mu)
"Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
(/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
;; KSH conversion functions
(defun rv2ksh (rv vv basis mu)
"Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
(with-keys (u dudt) (rv2spinors rv vv basis)
(let* ((duds (dudt2ds dudt u))
(e (spinors2energy u duds mu)))
(make-hash
:alpha u
:beta (/ duds (sqrt (- (/ e 2))))
:e e
:tm 0))))
(defun ksh2spinors (x s)
"Convert KSH state to spinor & spinor s-derivative"
(with-keys (alpha beta e tm) x
(let ((w0 (w0 e)))
(make-hash
:u (u alpha beta w0 s) ; spinor
:duds (duds beta w0))))) ; spinor s-derivative
(defun ksh2rv (x s sigma0)
"Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
(with-keys (alpha beta e tm) x
(with-keys (u duds) (ksh2spinors x s)
(let ((sigma (spin sigma0 alpha)))
(make-hash
:r (spinor2r u sigma) ; position
:v (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
;; Classical orbit elements
(defun coe2rv (sma ecc inc raan aop truan mu basis)
"Convert cassical orbital elements to position & velocity vectors.
SMA semi major axis
ECC eccentricity
INC inclination
RAAN right ascension of ascending node
AOP argument of perigee
TRUAN true anomaly
MU gravitational parameter
BASIS list of 3 orthogonal basis vectors to express position & velocity in"
(let* ((r-raan (rotor (*o (first basis) (second basis)) raan))
(basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
(r-inc (rotor (*o (second basis-raan) (third basis-raan)) inc))
(basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
(r-aop (rotor (*o (first basis-inc) (second basis-inc)) aop))
(basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
(r-truan (rotor (*o (first basis-aop) (second basis-aop)) truan))
(basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
(p (* sma (- 1 (* ecc ecc))))
(r (/ p (+ 1 (* ecc (cos truan)))))
(ruv (first basis-truan))
(rv (* ruv r))
(angm (sqrt (/ p mu)))
(angmbv (* (*o (first basis-truan) (second basis-truan)) angm))
(eccuv (first basis-aop))
(eccv (* eccuv ecc))
(vv (* (*g (invv angmbv) (+ eccv ruv))
mu)))
(values (graden rv 1) (graden vv 1))))
;; position & velocity to classical orbit elements
(defun energy-rv (r v mu)
"Orbit energy from position, velocity, & gravitational parameter"
(- (/ (* v v) 2)
(/ mu r)))
(defun sma-rv (r v mu)
"semi-major axis from position, velocity, & gravitational parameter"
(/ mu (* -2 (energy-rv r v mu))))
(defun eccv-rv (rv vv mu)
"eccentricity vector from position, velocity, & gravitational parameter"
(/ (- (* rv (- (norme2 vv) (/ mu (norme rv))))
(* vv (scalar (*i rv vv))))
mu))
(defun mombv-rv (rv vv)
"orbital momentum bivector from position & velocity"
(*o rv vv))
(defun nodev-rv (mombv basis)
"ascending node vector from momentum and basis"
(- (*i (third basis) mombv)))
(defun inc-rv (mombv basis)
"inclination from momentum bivector and basis"
(acos (/ (scalar (*i (third basis) (dual mombv)))
(norme mombv))))
(defun raan-rv (nodev basis)
"right ascension of ascending node from node vector and basis"
(let ((tmp (acos (scalar (*i (first basis) (unitg nodev))))))
(if (< 0 (scalar (*i (second basis) nodev)))
(- (* 2 pi) tmp)
tmp)))
(defun aop-rv (nodev eccv basis)
"argument of perigee from node vector, eccentricity vector, and basis"
(let ((tmp (acos (scalar (*i (unitg nodev) (unitg eccv))))))
(if (< 0 (scalar (*i (third basis) eccv)))
(- (* 2 pi) tmp)
tmp)))
(defun truan-rv (eccv rv vv)
"true anomaly from eccentricity, position, and velocity vectors"
(let ((tmp (acos (scalar (*i (unitg eccv) (unitg rv))))))
(if (< 0 (scalar (*i rv vv)))
(- (* 2 pi) tmp)
tmp)))
(defun rv2coe (rv vv mu basis)
"Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
(let* ((mombv (mombv-rv rv vv))
(nodev (nodev-rv mombv basis))
(eccv (eccv-rv rv vv mu)))
(make-hash
:sma (sma-rv (norme rv) (norme vv) mu)
:ecc (norme eccv)
:inc (inc-rv mombv basis)
:raan (raan-rv nodev basis)
:aop (aop-rv nodev eccv basis)
:truan (truan-rv eccv rv vv))))
;; Test KSH equations of motion
(defparameter *kshtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
forcefun #'(lambda (s x) (ve3))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1.1)
mu 1
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion")
(defun testksh (data)
"Propagate an orbit from test data"
(with-keys (s0 sf x0 forcefun sigma0) data
(let ((*ksh-sigma0* sigma0)
(*ksh-forcefun* forcefun))
(rka #'ksheom s0 sf x0))))
#|
(defun sail-ideal-forcefun (s x)
(with-keys (r v) (ksh2rv x s sigma0)
(destructuring-bind (posuv tanuv orbuv) (rvbasis r v)
(let ((normuv (+ (* posuv (cos alpha))
(* orbuv (* (sin alpha) (cos delta)))
(* tanuv (* (sin alpha) (sin delta))))))
(* normuv
(/ (* beta mu (expt (scalar (*i posuv normuv)) 2))
(norme2 r)))))))
|#
(defparameter *kshsailtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
alpha 0
delta 0
mu 1
beta 0.1
forcefun #'(lambda (s x)
(with-keys (r v) (ksh2rv x s sigma0)
(destructuring-bind (posuv tanuv orbuv) (rvbasis r v)
(let ((normuv (+ (* posuv (cos alpha))
(* orbuv (* (sin alpha) (cos delta)))
(* tanuv (* (sin alpha) (sin delta))))))
(* normuv
(/ (* beta mu (expt (scalar (*i posuv normuv)) 2))
(norme2 r)))))))
;; forcefun #'sail-ideal-forcefun
r0 (ve3 :c1 1)
v0 (ve3 :c10 1)
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion with solar sail")
(defparameter *ksh-forcefun-sail-normal*
#'(lambda (s x)
(with-keys (r v) (ksh2rv x s *ksh-sigma0*)
(sail-normal-force r *mu* *lightness*))))
(defvar *ephemeris*
(make-hash
:alpha (re2 :c0 1)
:beta (re2 :c11 -1)
:e -0.5)
"Ephemeris of a planet")
(defun planet-ksh-eom (s x)
(with-keys (alpha beta e) *ephemeris*
(dtmds (u alpha beta (w0 e) s))))
|
bld/bld-dyn
|
e94591b31f70c5d2a90a343100a471098d44af13
|
starting work on adding genetic algorithm calculation of solar sail trajectories
|
diff --git a/sailgeco.lisp b/sailgeco.lisp
new file mode 100644
index 0000000..8ebd93d
--- /dev/null
+++ b/sailgeco.lisp
@@ -0,0 +1,7 @@
+;; Solar sail trajectory optimization via genetic algorithm as implemented in Genetic Evolution through Combination of Objects (GECO)
+
+(asdf:load-system :geco)
+(asdf:load-system :bld-orbit)
+
+(in-package :bld-orbit)
+
|
bld/bld-dyn
|
a04382692f88736e2eb20dd044ae00d2362c1979
|
changing to use user defined classes for states
|
diff --git a/orbit.lisp b/orbit.lisp
index 7aa4b3f..31d4efa 100644
--- a/orbit.lisp
+++ b/orbit.lisp
@@ -1,314 +1,344 @@
+#|
+
+Orbital Mechanics Library
+=========================
+
+Includes:
+* Cartesian coordinate equations of motion
+* Kustaanheimo-Stiefel equations of motion cast into geometric algebra by Hestenes
+* Simple Keplerian trajectories
+* Solar sail trajectories
+
+|#
+
(in-package :bld-orbit)
;; Define infinity norm method for BLD-ODE Runge-Kutta method
(defmethod norminfx ((x g))
(norminf x))
;; Sail force functions
(defvar *lightness* 0.1 "Sail lightness number")
(defvar *mu* 1 "Gravitational parameter")
(defmethod sail-normal-force ((rv g) mu lightness)
"Solar sail force function when sail normal to the sun. RV is the position vector from the sun to the sail."
(* (unitg rv) (/ (* lightness mu) (norme2 rv))))
;; Cartesian equations of motion
(defvar *cart-forcefun* #'(lambda (tm x) (ve3)) "Cartesian coordinate force function")
(defvar *cart-forcefun-sail-normal*
#'(lambda (tm x)
- (sail-normal-force (gethash :r x) *mu* *lightness*)) "Cartesian coordinate force function with sail normal to the sun")
+ (sail-normal-force (slot-valuegethash :r x) *mu* *lightness*)) "Cartesian coordinate force function with sail normal to the sun")
(defmethod dvdt ((r g))
"Cartesian gravitational acceleration"
- (* r (/ -1 (expt (norme r) 3))))
+ (- (* r (/ *mu* (expt (norme r) 3)))))
+
+(defclass cartstate ()
+ ((r :initarg r :documentation "Position vector")
+ (v :initarg v :documentation "Velocity vector"))
+ (:documentation "Cartesian coordinate state"))
+
+(defstatearithmetic cartstate (r v))
(defun carteom (tm x)
"Cartesian orbital equations of motion"
- (with-keys (r v) x
- (make-hash
- :r v
- :v (+ (dvdt r) (funcall *cart-forcefun* tm x)))))
+ (with-slots (r v) x
+ (make-instance 'cartstate
+ :r v
+ :v (+ (dvdt r) (funcall *cart-forcefun* tm x)))))
;; Kustaanheimo-Stiefel-Hestenes (KSH) equations of motion
+(defclass kshstate ()
+ ((alpha :initarg :alpha :accessor alpha :type re3 :initform (re3) :documentation "Initial orbit spinor")
+ (beta :initarg :beta :accessor beta :type re3 :initform (re3) :documentation "Initial ")
+ (e :initarg :e :accessor e :type number :initform -0.5d0 :documentation "Specific Kepler orbit energy")
+ (tm :initarg :tm :accessor tm :type number :initform 0d0 :documentation "Time")))
+
+;; Define ODE state arithmetic on KSHSTATE class
+(defstatearithmetic kshstate (alpha beta e tm))
+
(defvar *ksh-forcefun* #'(lambda (s x) (ve3)) "KSH force function")
(defvar *ksh-sigma0* (ve3 :c1 1) "KSH reference unit position vector")
(defun w0 (e)
"Average orbit angular velocity given energy"
(sqrt (- (/ e 2))))
(defmethod u ((alpha g) (beta g) w0 s)
"Orbit spinor given ALPHA, BETA, W0, and S"
(+ (* alpha (cos (* w0 s)))
(* beta (sin (* w0 s)))))
-(defmethod alpha ((u g) (duds g) w0 s)
+#+nil(defmethod alpha ((u g) (duds g) w0 s)
"Alpha (U0) given U, DUDS, W0, and S"
(- (* u (cos (* w0 s)))
(* duds (/ (sin (* w0 s))
w0))))
-(defmethod beta ((u g) (duds g) w0 s)
- "Beta (dU/ds/w0) given U, DUDS, w0, and s"
+#+nil(defmethod beta ((u g) (duds g) w0 s)
+ "Beta (dU0/ds/w0) given U, DUDS, w0, and s"
(+ (* u (sin (* w0 s)))
(* duds (/ (cos (* w0 s))
w0))))
(defmethod duds ((beta g) w0)
- "s-derivative of spinor"
+ "s-derivative of spinor given BETA and W0"
(* beta w0))
(defmethod dalphads ((ff g) w0 s)
- "s-derivative of alpha"
+ "s-derivative of alpha given FF, W0, and S"
(* ff (- (/ (sin (* w0 s)) w0))))
(defmethod dbetads ((ff g) w0 s)
- "s-derivative of beta"
+ "s-derivative of beta given FF, W0, and S"
(* ff (/ (cos (* w0 s)) w0)))
(defmethod deds ((f g) (duds g) (sigma g) (u g))
"s-derivative of energy"
(scalar (*i f (*g3 duds sigma (revg u)))))
(defmethod dtmds ((u g))
"s-derivative of time"
(norme2 u))
(defun ksheom (s x)
"KS equations of motion in Hestenes GA form.
Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
(with-keys (alpha beta e tm) x
(let* ((w0 (w0 e))
(u (u alpha beta w0 s))
(duds (duds beta w0))
(sigma (spin *ksh-sigma0* alpha))
(r (spin sigma u))
(f (funcall *ksh-forcefun* s x))
(ff (*g3 f r u)))
(make-hash
:alpha (dalphads ff w0 s)
:beta (dbetads ff w0 s)
:e (deds f duds sigma u)
:tm (dtmds u)))))
;; Spinor functions
(defun recoverrotor3d (fs es)
"Recover a basis given new and original bases"
(let ((psi (+ (apply #'+ (mapcar #'*g fs (apply #'recipbvs es))) 1)))
(if (zerogp psi)
(error "zero psi (180 deg rotation) unsupported")
(unitg psi))))
(defun recoverspinor3d (r fs es)
"Recover a spinor given radius, new basis, and original basis"
(* (recoverrotor3d fs es) (sqrt r)))
(defun rvbasis (rv vv)
"Return a set of basis vectors derived from position and velocity"
(let* ((mombv (*o rv vv))
(x (unitg rv))
(y (unitg (*i rv mombv)))
(z (when (= 3 (dimension rv) (dimension vv))
(*x2 x y))))
(if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
(list x y)
(list x y z))))
(defmethod rv2u ((rv g) (vv g) (basis list))
(recoverspinor3d (norme rv) (rvbasis rv vv) basis))
(defmethod rv2dudt ((vv g) (u g) (basis1 g))
(* (*g3 vv u basis1)
(/ (* 2 (norme2 u)))))
(defun rv2spinors (rv vv basis)
"Convert position and velocity vectors to spinor and spinor time derivative"
(let ((u (rv2u rv vv basis)))
(make-hash
:u u
:dudt (rv2dudt vv u (first basis)))))
(defun duds2dt (duds u)
"Convert spinor time derivative (also given spinor) to s derivative"
(/ duds (norme2 u)))
(defun dudt2ds (dudt u)
"Convert spinor s derivative (also given spinor) to t derivative"
(* dudt (norme2 u)))
(defun spinor2r (u basis1)
"Given spinor and 1st basis vector, return corresponding position vector"
(spin basis1 u))
(defmethod spinors2v ((dudt g) (u g) (basisx g))
"Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
(graden (* (*g3 dudt basisx (revg u)) 2d0) 1))
(defun spinors2energy (u duds mu)
"Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
(/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
;; KSH conversion functions
(defun rv2ksh (rv vv basis mu)
"Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
(with-keys (u dudt) (rv2spinors rv vv basis)
(let* ((duds (dudt2ds dudt u))
(e (spinors2energy u duds mu)))
(make-hash
:alpha u
:beta (/ duds (sqrt (- (/ e 2))))
:e e
:tm 0))))
(defun ksh2spinors (x s)
"Convert KSH state to spinor & spinor s-derivative"
(with-keys (alpha beta e tm) x
(let ((w0 (w0 e)))
(make-hash
:u (u alpha beta w0 s) ; spinor
:duds (duds beta w0))))) ; spinor s-derivative
(defun ksh2rv (x s sigma0)
"Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
(with-keys (alpha beta e tm) x
(with-keys (u duds) (ksh2spinors x s)
(let ((sigma (spin sigma0 alpha)))
(make-hash
:r (spinor2r u sigma) ; position
:v (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
;; Classical orbit elements
(defun coe2rv (sma ecc inc raan aop truan mu basis)
"Convert cassical orbital elements to position & velocity vectors.
SMA semi major axis
ECC eccentricity
INC inclination
RAAN right ascension of ascending node
AOP argument of perigee
TRUAN true anomaly
MU gravitational parameter
BASIS list of 3 orthogonal basis vectors to express position & velocity in"
(let* ((r-raan (rotor (*o (first basis) (second basis)) raan))
(basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
(r-inc (rotor (*o (second basis-raan) (third basis-raan)) inc))
(basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
(r-aop (rotor (*o (first basis-inc) (second basis-inc)) aop))
(basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
(r-truan (rotor (*o (first basis-aop) (second basis-aop)) truan))
(basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
(p (* sma (- 1 (* ecc ecc))))
(r (/ p (+ 1 (* ecc (cos truan)))))
(ruv (first basis-truan))
(rv (* ruv r))
(angm (sqrt (/ p mu)))
(angmbv (* (*o (first basis-truan) (second basis-truan)) angm))
(eccuv (first basis-aop))
(eccv (* eccuv ecc))
(vv (* (*g (invv angmbv) (+ eccv ruv))
mu)))
(values (graden rv 1) (graden vv 1))))
;; position & velocity to classical orbit elements
(defun energy-rv (r v mu)
"Orbit energy from position, velocity, & gravitational parameter"
(- (/ (* v v) 2)
(/ mu r)))
(defun sma-rv (r v mu)
"semi-major axis from position, velocity, & gravitational parameter"
(/ mu (* -2 (energy-rv r v mu))))
(defun eccv-rv (rv vv mu)
"eccentricity vector from position, velocity, & gravitational parameter"
(/ (- (* rv (- (norme2 vv) (/ mu (norme rv))))
(* vv (scalar (*i rv vv))))
mu))
(defun mombv-rv (rv vv)
"orbital momentum bivector from position & velocity"
(*o rv vv))
(defun nodev-rv (mombv basis)
"ascending node vector from momentum and basis"
(- (*i (third basis) mombv)))
(defun inc-rv (mombv basis)
"inclination from momentum bivector and basis"
(acos (/ (scalar (*i (third basis) (dual mombv)))
(norme mombv))))
(defun raan-rv (nodev basis)
"right ascension of ascending node from node vector and basis"
(let ((tmp (acos (scalar (*i (first basis) (unitg nodev))))))
(if (< 0 (scalar (*i (second basis) nodev)))
(- (* 2 pi) tmp)
tmp)))
(defun aop-rv (nodev eccv basis)
"argument of perigee from node vector, eccentricity vector, and basis"
(let ((tmp (acos (scalar (*i (unitg nodev) (unitg eccv))))))
(if (< 0 (scalar (*i (third basis) eccv)))
(- (* 2 pi) tmp)
tmp)))
(defun truan-rv (eccv rv vv)
"true anomaly from eccentricity, position, and velocity vectors"
(let ((tmp (acos (scalar (*i (unitg eccv) (unitg rv))))))
(if (< 0 (scalar (*i rv vv)))
(- (* 2 pi) tmp)
tmp)))
(defun rv2coe (rv vv mu basis)
"Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
(let* ((mombv (mombv-rv rv vv))
(nodev (nodev-rv mombv basis))
(eccv (eccv-rv rv vv mu)))
(make-hash
:sma (sma-rv (norme rv) (norme vv) mu)
:ecc (norme eccv)
:inc (inc-rv mombv basis)
:raan (raan-rv nodev basis)
:aop (aop-rv nodev eccv basis)
:truan (truan-rv eccv rv vv))))
;; Test KSH equations of motion
(defparameter *kshtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
forcefun #'(lambda (s x) (ve3))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1.1)
mu 1
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion")
(defun testksh (data)
+ "Propagate an orbit from test data"
(with-keys (s0 sf x0 forcefun sigma0) data
(let ((*ksh-sigma0* sigma0)
(*ksh-forcefun* forcefun))
(rka #'ksheom s0 sf x0))))
#|
(defun sail-ideal-forcefun (s x)
(with-keys (r v) (ksh2rv x s sigma0)
(destructuring-bind (posuv tanuv orbuv) (rvbasis r v)
(let ((normuv (+ (* posuv (cos alpha))
(* orbuv (* (sin alpha) (cos delta)))
(* tanuv (* (sin alpha) (sin delta))))))
(* normuv
(/ (* beta mu (expt (scalar (*i posuv normuv)) 2))
(norme2 r)))))))
|#
(defparameter *kshsailtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
alpha 0
delta 0
mu 1
beta 0.1
forcefun #'(lambda (s x)
(with-keys (r v) (ksh2rv x s sigma0)
(destructuring-bind (posuv tanuv orbuv) (rvbasis r v)
(let ((normuv (+ (* posuv (cos alpha))
(* orbuv (* (sin alpha) (cos delta)))
(* tanuv (* (sin alpha) (sin delta))))))
(* normuv
(/ (* beta mu (expt (scalar (*i posuv normuv)) 2))
(norme2 r)))))))
;; forcefun #'sail-ideal-forcefun
r0 (ve3 :c1 1)
v0 (ve3 :c10 1)
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion with solar sail")
(defparameter *ksh-forcefun-sail-normal*
#'(lambda (s x)
(with-keys (r v) (ksh2rv x s *ksh-sigma0*)
(sail-normal-force r *mu* *lightness*))))
(defvar *ephemeris*
(make-hash
:alpha (re2 :c0 1)
:beta (re2 :c11 -1)
- :e -0.5))
+ :e -0.5)
+ "Ephemeris of a planet")
(defun planet-ksh-eom (s x)
(with-keys (alpha beta e) *ephemeris*
(dtmds (u alpha beta (w0 e) s))))
-
|
bld/bld-dyn
|
bc9e8619fe463e46779fa298bedd2b16c7673002
|
Added *forcefun* and *sigma0* variables for KSHEOM to use so TESTKSH now works using the solar sail force function defined in *KSHSAILTEST*
|
diff --git a/orbit.lisp b/orbit.lisp
index bcad480..7aa4b3f 100644
--- a/orbit.lisp
+++ b/orbit.lisp
@@ -1,300 +1,314 @@
(in-package :bld-orbit)
;; Define infinity norm method for BLD-ODE Runge-Kutta method
(defmethod norminfx ((x g))
(norminf x))
;; Sail force functions
(defvar *lightness* 0.1 "Sail lightness number")
(defvar *mu* 1 "Gravitational parameter")
(defmethod sail-normal-force ((rv g) mu lightness)
+ "Solar sail force function when sail normal to the sun. RV is the position vector from the sun to the sail."
(* (unitg rv) (/ (* lightness mu) (norme2 rv))))
;; Cartesian equations of motion
-(defvar *cart-forcefun* #'(lambda (tm x) (ve3)))
+(defvar *cart-forcefun* #'(lambda (tm x) (ve3)) "Cartesian coordinate force function")
(defvar *cart-forcefun-sail-normal*
#'(lambda (tm x)
- (sail-normal-force (gethash :r x) *mu* *lightness*)))
+ (sail-normal-force (gethash :r x) *mu* *lightness*)) "Cartesian coordinate force function with sail normal to the sun")
(defmethod dvdt ((r g))
"Cartesian gravitational acceleration"
(* r (/ -1 (expt (norme r) 3))))
(defun carteom (tm x)
"Cartesian orbital equations of motion"
(with-keys (r v) x
(make-hash
:r v
:v (+ (dvdt r) (funcall *cart-forcefun* tm x)))))
-;; KS equations of motion
+;; Kustaanheimo-Stiefel-Hestenes (KSH) equations of motion
(defvar *ksh-forcefun* #'(lambda (s x) (ve3)) "KSH force function")
(defvar *ksh-sigma0* (ve3 :c1 1) "KSH reference unit position vector")
(defun w0 (e)
"Average orbit angular velocity given energy"
(sqrt (- (/ e 2))))
(defmethod u ((alpha g) (beta g) w0 s)
- "Spinor"
+ "Orbit spinor given ALPHA, BETA, W0, and S"
(+ (* alpha (cos (* w0 s)))
(* beta (sin (* w0 s)))))
(defmethod alpha ((u g) (duds g) w0 s)
"Alpha (U0) given U, DUDS, W0, and S"
(- (* u (cos (* w0 s)))
(* duds (/ (sin (* w0 s))
w0))))
(defmethod beta ((u g) (duds g) w0 s)
"Beta (dU/ds/w0) given U, DUDS, w0, and s"
(+ (* u (sin (* w0 s)))
(* duds (/ (cos (* w0 s))
w0))))
(defmethod duds ((beta g) w0)
"s-derivative of spinor"
(* beta w0))
(defmethod dalphads ((ff g) w0 s)
"s-derivative of alpha"
(* ff (- (/ (sin (* w0 s)) w0))))
(defmethod dbetads ((ff g) w0 s)
"s-derivative of beta"
(* ff (/ (cos (* w0 s)) w0)))
(defmethod deds ((f g) (duds g) (sigma g) (u g))
"s-derivative of energy"
(scalar (*i f (*g3 duds sigma (revg u)))))
(defmethod dtmds ((u g))
"s-derivative of time"
(norme2 u))
(defun ksheom (s x)
"KS equations of motion in Hestenes GA form.
Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
(with-keys (alpha beta e tm) x
(let* ((w0 (w0 e))
(u (u alpha beta w0 s))
(duds (duds beta w0))
(sigma (spin *ksh-sigma0* alpha))
(r (spin sigma u))
(f (funcall *ksh-forcefun* s x))
(ff (*g3 f r u)))
(make-hash
:alpha (dalphads ff w0 s)
:beta (dbetads ff w0 s)
:e (deds f duds sigma u)
:tm (dtmds u)))))
;; Spinor functions
(defun recoverrotor3d (fs es)
"Recover a basis given new and original bases"
(let ((psi (+ (apply #'+ (mapcar #'*g fs (apply #'recipbvs es))) 1)))
(if (zerogp psi)
(error "zero psi (180 deg rotation) unsupported")
(unitg psi))))
(defun recoverspinor3d (r fs es)
"Recover a spinor given radius, new basis, and original basis"
(* (recoverrotor3d fs es) (sqrt r)))
(defun rvbasis (rv vv)
"Return a set of basis vectors derived from position and velocity"
(let* ((mombv (*o rv vv))
(x (unitg rv))
(y (unitg (*i rv mombv)))
(z (when (= 3 (dimension rv) (dimension vv))
(*x2 x y))))
(if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
(list x y)
(list x y z))))
(defmethod rv2u ((rv g) (vv g) (basis list))
(recoverspinor3d (norme rv) (rvbasis rv vv) basis))
(defmethod rv2dudt ((vv g) (u g) (basis1 g))
(* (*g3 vv u basis1)
(/ (* 2 (norme2 u)))))
(defun rv2spinors (rv vv basis)
"Convert position and velocity vectors to spinor and spinor time derivative"
(let ((u (rv2u rv vv basis)))
(make-hash
:u u
:dudt (rv2dudt vv u (first basis)))))
(defun duds2dt (duds u)
"Convert spinor time derivative (also given spinor) to s derivative"
(/ duds (norme2 u)))
(defun dudt2ds (dudt u)
"Convert spinor s derivative (also given spinor) to t derivative"
(* dudt (norme2 u)))
(defun spinor2r (u basis1)
"Given spinor and 1st basis vector, return corresponding position vector"
(spin basis1 u))
-(defun spinors2v (dudt u basis1)
+(defmethod spinors2v ((dudt g) (u g) (basisx g))
"Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
- (* (*g3 dudt basis1 (revg u)) 2d0))
+ (graden (* (*g3 dudt basisx (revg u)) 2d0) 1))
(defun spinors2energy (u duds mu)
"Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
(/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
;; KSH conversion functions
(defun rv2ksh (rv vv basis mu)
"Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
(with-keys (u dudt) (rv2spinors rv vv basis)
(let* ((duds (dudt2ds dudt u))
(e (spinors2energy u duds mu)))
(make-hash
:alpha u
:beta (/ duds (sqrt (- (/ e 2))))
:e e
:tm 0))))
(defun ksh2spinors (x s)
"Convert KSH state to spinor & spinor s-derivative"
(with-keys (alpha beta e tm) x
(let ((w0 (w0 e)))
(make-hash
:u (u alpha beta w0 s) ; spinor
:duds (duds beta w0))))) ; spinor s-derivative
(defun ksh2rv (x s sigma0)
"Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
(with-keys (alpha beta e tm) x
(with-keys (u duds) (ksh2spinors x s)
(let ((sigma (spin sigma0 alpha)))
(make-hash
:r (spinor2r u sigma) ; position
:v (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
;; Classical orbit elements
(defun coe2rv (sma ecc inc raan aop truan mu basis)
"Convert cassical orbital elements to position & velocity vectors.
SMA semi major axis
ECC eccentricity
INC inclination
RAAN right ascension of ascending node
AOP argument of perigee
TRUAN true anomaly
MU gravitational parameter
BASIS list of 3 orthogonal basis vectors to express position & velocity in"
(let* ((r-raan (rotor (*o (first basis) (second basis)) raan))
(basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
(r-inc (rotor (*o (second basis-raan) (third basis-raan)) inc))
(basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
(r-aop (rotor (*o (first basis-inc) (second basis-inc)) aop))
(basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
(r-truan (rotor (*o (first basis-aop) (second basis-aop)) truan))
(basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
(p (* sma (- 1 (* ecc ecc))))
(r (/ p (+ 1 (* ecc (cos truan)))))
(ruv (first basis-truan))
(rv (* ruv r))
(angm (sqrt (/ p mu)))
(angmbv (* (*o (first basis-truan) (second basis-truan)) angm))
(eccuv (first basis-aop))
(eccv (* eccuv ecc))
(vv (* (*g (invv angmbv) (+ eccv ruv))
mu)))
(values (graden rv 1) (graden vv 1))))
;; position & velocity to classical orbit elements
(defun energy-rv (r v mu)
"Orbit energy from position, velocity, & gravitational parameter"
(- (/ (* v v) 2)
(/ mu r)))
(defun sma-rv (r v mu)
"semi-major axis from position, velocity, & gravitational parameter"
(/ mu (* -2 (energy-rv r v mu))))
(defun eccv-rv (rv vv mu)
"eccentricity vector from position, velocity, & gravitational parameter"
(/ (- (* rv (- (norme2 vv) (/ mu (norme rv))))
(* vv (scalar (*i rv vv))))
mu))
(defun mombv-rv (rv vv)
"orbital momentum bivector from position & velocity"
(*o rv vv))
(defun nodev-rv (mombv basis)
"ascending node vector from momentum and basis"
(- (*i (third basis) mombv)))
(defun inc-rv (mombv basis)
"inclination from momentum bivector and basis"
(acos (/ (scalar (*i (third basis) (dual mombv)))
(norme mombv))))
(defun raan-rv (nodev basis)
"right ascension of ascending node from node vector and basis"
(let ((tmp (acos (scalar (*i (first basis) (unitg nodev))))))
(if (< 0 (scalar (*i (second basis) nodev)))
(- (* 2 pi) tmp)
tmp)))
(defun aop-rv (nodev eccv basis)
"argument of perigee from node vector, eccentricity vector, and basis"
(let ((tmp (acos (scalar (*i (unitg nodev) (unitg eccv))))))
(if (< 0 (scalar (*i (third basis) eccv)))
(- (* 2 pi) tmp)
tmp)))
(defun truan-rv (eccv rv vv)
"true anomaly from eccentricity, position, and velocity vectors"
(let ((tmp (acos (scalar (*i (unitg eccv) (unitg rv))))))
(if (< 0 (scalar (*i rv vv)))
(- (* 2 pi) tmp)
tmp)))
(defun rv2coe (rv vv mu basis)
"Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
(let* ((mombv (mombv-rv rv vv))
(nodev (nodev-rv mombv basis))
(eccv (eccv-rv rv vv mu)))
(make-hash
:sma (sma-rv (norme rv) (norme vv) mu)
:ecc (norme eccv)
:inc (inc-rv mombv basis)
:raan (raan-rv nodev basis)
:aop (aop-rv nodev eccv basis)
:truan (truan-rv eccv rv vv))))
;; Test KSH equations of motion
(defparameter *kshtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
forcefun #'(lambda (s x) (ve3))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1.1)
mu 1
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion")
(defun testksh (data)
- (with-keys (s0 sf x0) data
- (let ((*kshparam* data))
+ (with-keys (s0 sf x0 forcefun sigma0) data
+ (let ((*ksh-sigma0* sigma0)
+ (*ksh-forcefun* forcefun))
(rka #'ksheom s0 sf x0))))
+#|
+(defun sail-ideal-forcefun (s x)
+ (with-keys (r v) (ksh2rv x s sigma0)
+ (destructuring-bind (posuv tanuv orbuv) (rvbasis r v)
+ (let ((normuv (+ (* posuv (cos alpha))
+ (* orbuv (* (sin alpha) (cos delta)))
+ (* tanuv (* (sin alpha) (sin delta))))))
+ (* normuv
+ (/ (* beta mu (expt (scalar (*i posuv normuv)) 2))
+ (norme2 r)))))))
+|#
(defparameter *kshsailtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
alpha 0
delta 0
mu 1
beta 0.1
forcefun #'(lambda (s x)
(with-keys (r v) (ksh2rv x s sigma0)
(destructuring-bind (posuv tanuv orbuv) (rvbasis r v)
(let ((normuv (+ (* posuv (cos alpha))
(* orbuv (* (sin alpha) (cos delta)))
(* tanuv (* (sin alpha) (sin delta))))))
(* normuv
(/ (* beta mu (expt (scalar (*i posuv normuv)) 2))
(norme2 r)))))))
+;; forcefun #'sail-ideal-forcefun
r0 (ve3 :c1 1)
v0 (ve3 :c10 1)
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion with solar sail")
(defparameter *ksh-forcefun-sail-normal*
#'(lambda (s x)
(with-keys (r v) (ksh2rv x s *ksh-sigma0*)
(sail-normal-force r *mu* *lightness*))))
(defvar *ephemeris*
(make-hash
:alpha (re2 :c0 1)
:beta (re2 :c11 -1)
:e -0.5))
(defun planet-ksh-eom (s x)
(with-keys (alpha beta e) *ephemeris*
(dtmds (u alpha beta (w0 e) s))))
|
bld/bld-dyn
|
b9cce1a8a9237b89d264853a1db6970904be1e14
|
put orbit dynamics into it's own system. Working on rigid body dynamics for BLD-DYN now. Work in progress.
|
diff --git a/bld-dyn.asd b/bld-dyn.asd
index 7994c50..deed766 100644
--- a/bld-dyn.asd
+++ b/bld-dyn.asd
@@ -1,14 +1,8 @@
-(defpackage :bld.dyn.system
- (:use :asdf :cl))
-(in-package :bld.dyn.system)
-(defsystem :bld-dyn
- :name "bld-dyn"
+(asdf:defsystem :bld-dyn
:author "Ben Diedrich"
- :version "0.0.1"
- :maintainer "Ben Diedrich"
:license "MIT"
:description "Dynamics library employing geometric algebra"
:components
((:file "package")
(:file "dyn" :depends-on ("package")))
:depends-on ("bld-ga" "bld-e2" "bld-e3" "bld-ode" "bld-utils" "bld-gen"))
diff --git a/bld-orbit.asd b/bld-orbit.asd
new file mode 100644
index 0000000..d44e4b1
--- /dev/null
+++ b/bld-orbit.asd
@@ -0,0 +1,9 @@
+(asdf:defsystem :bld-orbit
+ :author "Ben Diedrich"
+ :version "0.0.1"
+ :license "MIT"
+ :description "Dynamics library employing geometric algebra"
+ :components
+ ((:file "package-orbit")
+ (:file "orbit" :depends-on ("package-orbit")))
+ :depends-on ("bld-ga" "bld-e2" "bld-e3" "bld-ode" "bld-utils" "bld-gen"))
diff --git a/dyn.lisp b/dyn.lisp
index 389363a..496be7b 100644
--- a/dyn.lisp
+++ b/dyn.lisp
@@ -1,300 +1,51 @@
(in-package :bld-dyn)
;; Define infinity norm method for BLD-ODE Runge-Kutta method
(defmethod norminfx ((x g))
(norminf x))
-;; Sail force functions
-(defvar *lightness* 0.1 "Sail lightness number")
-(defvar *mu* 1 "Gravitational parameter")
-(defmethod sail-normal-force ((rv g) mu lightness)
- (* (unitg rv) (/ (* lightness mu) (norme2 rv))))
-
-;; Cartesian equations of motion
-(defvar *cart-forcefun* #'(lambda (tm x) (ve3)))
-(defvar *cart-forcefun-sail-normal*
- #'(lambda (tm x)
- (sail-normal-force (gethash :r x) *mu* *lightness*)))
-(defmethod dvdt ((r g))
- "Cartesian gravitational acceleration"
- (* r (/ -1 (expt (norme r) 3))))
-
-(defun carteom (tm x)
- "Cartesian orbital equations of motion"
- (with-keys (r v) x
- (make-hash
- :r v
- :v (+ (dvdt r) (funcall *cart-forcefun* tm x)))))
-
-;; KS equations of motion
-
-(defvar *ksh-forcefun* #'(lambda (s x) (ve3)) "KSH force function")
-(defvar *ksh-sigma0* (ve3 :c1 1) "KSH reference unit position vector")
-
-(defun w0 (e)
- "Average orbit angular velocity given energy"
- (sqrt (- (/ e 2))))
-(defmethod u ((alpha g) (beta g) w0 s)
- "Spinor"
- (+ (* alpha (cos (* w0 s)))
- (* beta (sin (* w0 s)))))
-(defmethod alpha ((u g) (duds g) w0 s)
- "Alpha (U0) given U, DUDS, W0, and S"
- (- (* u (cos (* w0 s)))
- (* duds (/ (sin (* w0 s))
- w0))))
-(defmethod beta ((u g) (duds g) w0 s)
- "Beta (dU/ds/w0) given U, DUDS, w0, and s"
- (+ (* u (sin (* w0 s)))
- (* duds (/ (cos (* w0 s))
- w0))))
-(defmethod duds ((beta g) w0)
- "s-derivative of spinor"
- (* beta w0))
-(defmethod dalphads ((ff g) w0 s)
- "s-derivative of alpha"
- (* ff (- (/ (sin (* w0 s)) w0))))
-(defmethod dbetads ((ff g) w0 s)
- "s-derivative of beta"
- (* ff (/ (cos (* w0 s)) w0)))
-(defmethod deds ((f g) (duds g) (sigma g) (u g))
- "s-derivative of energy"
- (scalar (*i f (*g3 duds sigma (revg u)))))
-(defmethod dtmds ((u g))
- "s-derivative of time"
- (norme2 u))
-(defun ksheom (s x)
- "KS equations of motion in Hestenes GA form.
-Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
-Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
- (with-keys (alpha beta e tm) x
- (let* ((w0 (w0 e))
- (u (u alpha beta w0 s))
- (duds (duds beta w0))
- (sigma (spin *ksh-sigma0* alpha))
- (r (spin sigma u))
- (f (funcall *ksh-forcefun* s x))
- (ff (*g3 f r u)))
- (make-hash
- :alpha (dalphads ff w0 s)
- :beta (dbetads ff w0 s)
- :e (deds f duds sigma u)
- :tm (dtmds u)))))
-
-;; Spinor functions
-(defun recoverrotor3d (fs es)
- "Recover a basis given new and original bases"
- (let ((psi (+ (apply #'+ (mapcar #'*g fs (apply #'recipbvs es))) 1)))
- (if (zerogp psi)
- (error "zero psi (180 deg rotation) unsupported")
- (unitg psi))))
-(defun recoverspinor3d (r fs es)
- "Recover a spinor given radius, new basis, and original basis"
- (* (recoverrotor3d fs es) (sqrt r)))
-(defun rvbasis (rv vv)
- "Return a set of basis vectors derived from position and velocity"
- (let* ((mombv (*o rv vv))
- (x (unitg rv))
- (y (unitg (*i rv mombv)))
- (z (when (= 3 (dimension rv) (dimension vv))
- (*x2 x y))))
- (if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
- (list x y)
- (list x y z))))
-(defmethod rv2u ((rv g) (vv g) (basis list))
- (recoverspinor3d (norme rv) (rvbasis rv vv) basis))
-(defmethod rv2dudt ((vv g) (u g) (basis1 g))
- (* (*g3 vv u basis1)
- (/ (* 2 (norme2 u)))))
-(defun rv2spinors (rv vv basis)
- "Convert position and velocity vectors to spinor and spinor time derivative"
- (let ((u (rv2u rv vv basis)))
- (make-hash
- :u u
- :dudt (rv2dudt vv u (first basis)))))
-(defun duds2dt (duds u)
- "Convert spinor time derivative (also given spinor) to s derivative"
- (/ duds (norme2 u)))
-(defun dudt2ds (dudt u)
- "Convert spinor s derivative (also given spinor) to t derivative"
- (* dudt (norme2 u)))
-(defun spinor2r (u basis1)
- "Given spinor and 1st basis vector, return corresponding position vector"
- (spin basis1 u))
-(defun spinors2v (dudt u basis1)
- "Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
- (* (*g3 dudt basis1 (revg u)) 2d0))
-(defun spinors2energy (u duds mu)
- "Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
- (/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
-
-;; KSH conversion functions
-(defun rv2ksh (rv vv basis mu)
- "Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
- (with-keys (u dudt) (rv2spinors rv vv basis)
- (let* ((duds (dudt2ds dudt u))
- (e (spinors2energy u duds mu)))
- (make-hash
- :alpha u
- :beta (/ duds (sqrt (- (/ e 2))))
- :e e
- :tm 0))))
-(defun ksh2spinors (x s)
- "Convert KSH state to spinor & spinor s-derivative"
- (with-keys (alpha beta e tm) x
- (let ((w0 (w0 e)))
- (make-hash
- :u (u alpha beta w0 s) ; spinor
- :duds (duds beta w0))))) ; spinor s-derivative
-(defun ksh2rv (x s sigma0)
- "Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
- (with-keys (alpha beta e tm) x
- (with-keys (u duds) (ksh2spinors x s)
- (let ((sigma (spin sigma0 alpha)))
- (make-hash
- :r (spinor2r u sigma) ; position
- :v (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
-
-;; Classical orbit elements
-(defun coe2rv (sma ecc inc raan aop truan mu basis)
- "Convert cassical orbital elements to position & velocity vectors.
-SMA semi major axis
-ECC eccentricity
-INC inclination
-RAAN right ascension of ascending node
-AOP argument of perigee
-TRUAN true anomaly
-MU gravitational parameter
-BASIS list of 3 orthogonal basis vectors to express position & velocity in"
- (let* ((r-raan (rotor (*o (first basis) (second basis)) raan))
- (basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
- (r-inc (rotor (*o (second basis-raan) (third basis-raan)) inc))
- (basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
- (r-aop (rotor (*o (first basis-inc) (second basis-inc)) aop))
- (basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
- (r-truan (rotor (*o (first basis-aop) (second basis-aop)) truan))
- (basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
- (p (* sma (- 1 (* ecc ecc))))
- (r (/ p (+ 1 (* ecc (cos truan)))))
- (ruv (first basis-truan))
- (rv (* ruv r))
- (angm (sqrt (/ p mu)))
- (angmbv (* (*o (first basis-truan) (second basis-truan)) angm))
- (eccuv (first basis-aop))
- (eccv (* eccuv ecc))
- (vv (* (*g (invv angmbv) (+ eccv ruv))
- mu)))
- (values (graden rv 1) (graden vv 1))))
-
-;; position & velocity to classical orbit elements
-(defun energy-rv (r v mu)
- "Orbit energy from position, velocity, & gravitational parameter"
- (- (/ (* v v) 2)
- (/ mu r)))
-(defun sma-rv (r v mu)
- "semi-major axis from position, velocity, & gravitational parameter"
- (/ mu (* -2 (energy-rv r v mu))))
-(defun eccv-rv (rv vv mu)
- "eccentricity vector from position, velocity, & gravitational parameter"
- (/ (- (* rv (- (norme2 vv) (/ mu (norme rv))))
- (* vv (scalar (*i rv vv))))
- mu))
-(defun mombv-rv (rv vv)
- "orbital momentum bivector from position & velocity"
- (*o rv vv))
-(defun nodev-rv (mombv basis)
- "ascending node vector from momentum and basis"
- (- (*i (third basis) mombv)))
-(defun inc-rv (mombv basis)
- "inclination from momentum bivector and basis"
- (acos (/ (scalar (*i (third basis) (dual mombv)))
- (norme mombv))))
-(defun raan-rv (nodev basis)
- "right ascension of ascending node from node vector and basis"
- (let ((tmp (acos (scalar (*i (first basis) (unitg nodev))))))
- (if (< 0 (scalar (*i (second basis) nodev)))
- (- (* 2 pi) tmp)
- tmp)))
-(defun aop-rv (nodev eccv basis)
- "argument of perigee from node vector, eccentricity vector, and basis"
- (let ((tmp (acos (scalar (*i (unitg nodev) (unitg eccv))))))
- (if (< 0 (scalar (*i (third basis) eccv)))
- (- (* 2 pi) tmp)
- tmp)))
-(defun truan-rv (eccv rv vv)
- "true anomaly from eccentricity, position, and velocity vectors"
- (let ((tmp (acos (scalar (*i (unitg eccv) (unitg rv))))))
- (if (< 0 (scalar (*i rv vv)))
- (- (* 2 pi) tmp)
- tmp)))
-(defun rv2coe (rv vv mu basis)
- "Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
- (let* ((mombv (mombv-rv rv vv))
- (nodev (nodev-rv mombv basis))
- (eccv (eccv-rv rv vv mu)))
- (make-hash
- :sma (sma-rv (norme rv) (norme vv) mu)
- :ecc (norme eccv)
- :inc (inc-rv mombv basis)
- :raan (raan-rv nodev basis)
- :aop (aop-rv nodev eccv basis)
- :truan (truan-rv eccv rv vv))))
-
-;; Test KSH equations of motion
-(defparameter *kshtest*
- (make-hash*
- basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
- sigma0 (first basis)
- forcefun #'(lambda (s x) (ve3))
- r0 (ve3 :c1 1)
- v0 (ve3 :c10 1.1)
- mu 1
- x0 (rv2ksh r0 v0 basis mu)
- s0 0
- sf (* pi 2))
- "Test data for KSH equations of motion")
-
-(defun testksh (data)
- (with-keys (s0 sf x0) data
- (let ((*kshparam* data))
- (rka #'ksheom s0 sf x0))))
-
-(defparameter *kshsailtest*
- (make-hash*
- basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
- sigma0 (first basis)
- alpha 0
- delta 0
- mu 1
- beta 0.1
- forcefun #'(lambda (s x)
- (with-keys (r v) (ksh2rv x s sigma0)
- (destructuring-bind (posuv tanuv orbuv) (rvbasis r v)
- (let ((normuv (+ (* posuv (cos alpha))
- (* orbuv (* (sin alpha) (cos delta)))
- (* tanuv (* (sin alpha) (sin delta))))))
- (* normuv
- (/ (* beta mu (expt (scalar (*i posuv normuv)) 2))
- (norme2 r)))))))
- r0 (ve3 :c1 1)
- v0 (ve3 :c10 1)
- x0 (rv2ksh r0 v0 basis mu)
- s0 0
- sf (* pi 2))
- "Test data for KSH equations of motion with solar sail")
-
-(defparameter *ksh-forcefun-sail-normal*
- #'(lambda (s x)
- (with-keys (r v) (ksh2rv x s *ksh-sigma0*)
- (sail-normal-force r *mu* *lightness*))))
-
-(defvar *ephemeris*
- (make-hash
- :alpha (re2 :c0 1)
- :beta (re2 :c11 -1)
- :e -0.5))
-
-(defun planet-ksh-eom (s x)
- (with-keys (alpha beta e) *ephemeris*
- (dtmds (u alpha beta (w0 e) s))))
-
+;; Solar sail force functions
+(defun make-idealsail (&key (area 10000d0) (w 1368d0) (stype 'flat) (c 2.99792458d8) (du 1.49598d11))
+ "Make ideal solar sail force function of normal vector and position vector wrt the sun.
+AREA: sail area
+W: solar intensity (power/area) at distance unit
+STYPE: 'flat or 'compound
+C: speed of light
+DU: distance unit where intensity defined"
+ (assert (or (eql stype 'flat) (eql stype 'compound)) (stype) "Sail type must be one of 'FLAT or 'COMPOUND")
+ (let ((constant (* 2 area (/ w c) (expt du 2)))
+ (cosfn (case stype
+ ('flat (lambda (n rs) (expt (scalar (*i n (unitg rs))) 2d0)))
+ ('compound (lambda (n rs) (scalar (*i n (unitg rs))))))))
+ (lambda (n rs)
+ (* constant
+ (funcall cosfn n rs)
+ (/ (norme2 rs))
+ n))))
+
+;; 3D inertia linear function from inertia matrix
+(defun make-inertia (tensor basis)
+ "Make 3D inertia function of bivectors given inertia tensor and basis"
+ (lambda (bv)
+ (let ((result (bve3)))
+ (dotimes (j 3)
+ (dotimes (k 3)
+ (setf result (- result
+ (* (aref tensor j k)
+ (*s bv (dual (nth k basis)))
+ (dual (nth j basis)))))))
+ result)))
+
+(defun make-inertiav (tensor basis)
+ "Make an inertia linear function of a vector given the tensor (3x3 array) and basis (list of 3 E3 vectors)"
+ (lambda (v)
+ (let ((result (ve3)))
+ (dotimes (j 3)
+ (dotimes (k 3)
+ (setf result (+ result
+ (* (aref tensor j k) ; Ijk
+ (*s v (nth k basis)) ; vk = v . basisk
+ (nth j basis)))))) ; basisj
+ result)))
+
+;; Euler equations of motion
diff --git a/orbit.lisp b/orbit.lisp
new file mode 100644
index 0000000..bcad480
--- /dev/null
+++ b/orbit.lisp
@@ -0,0 +1,300 @@
+(in-package :bld-orbit)
+
+;; Define infinity norm method for BLD-ODE Runge-Kutta method
+(defmethod norminfx ((x g))
+ (norminf x))
+
+;; Sail force functions
+(defvar *lightness* 0.1 "Sail lightness number")
+(defvar *mu* 1 "Gravitational parameter")
+(defmethod sail-normal-force ((rv g) mu lightness)
+ (* (unitg rv) (/ (* lightness mu) (norme2 rv))))
+
+;; Cartesian equations of motion
+(defvar *cart-forcefun* #'(lambda (tm x) (ve3)))
+(defvar *cart-forcefun-sail-normal*
+ #'(lambda (tm x)
+ (sail-normal-force (gethash :r x) *mu* *lightness*)))
+(defmethod dvdt ((r g))
+ "Cartesian gravitational acceleration"
+ (* r (/ -1 (expt (norme r) 3))))
+
+(defun carteom (tm x)
+ "Cartesian orbital equations of motion"
+ (with-keys (r v) x
+ (make-hash
+ :r v
+ :v (+ (dvdt r) (funcall *cart-forcefun* tm x)))))
+
+;; KS equations of motion
+
+(defvar *ksh-forcefun* #'(lambda (s x) (ve3)) "KSH force function")
+(defvar *ksh-sigma0* (ve3 :c1 1) "KSH reference unit position vector")
+
+(defun w0 (e)
+ "Average orbit angular velocity given energy"
+ (sqrt (- (/ e 2))))
+(defmethod u ((alpha g) (beta g) w0 s)
+ "Spinor"
+ (+ (* alpha (cos (* w0 s)))
+ (* beta (sin (* w0 s)))))
+(defmethod alpha ((u g) (duds g) w0 s)
+ "Alpha (U0) given U, DUDS, W0, and S"
+ (- (* u (cos (* w0 s)))
+ (* duds (/ (sin (* w0 s))
+ w0))))
+(defmethod beta ((u g) (duds g) w0 s)
+ "Beta (dU/ds/w0) given U, DUDS, w0, and s"
+ (+ (* u (sin (* w0 s)))
+ (* duds (/ (cos (* w0 s))
+ w0))))
+(defmethod duds ((beta g) w0)
+ "s-derivative of spinor"
+ (* beta w0))
+(defmethod dalphads ((ff g) w0 s)
+ "s-derivative of alpha"
+ (* ff (- (/ (sin (* w0 s)) w0))))
+(defmethod dbetads ((ff g) w0 s)
+ "s-derivative of beta"
+ (* ff (/ (cos (* w0 s)) w0)))
+(defmethod deds ((f g) (duds g) (sigma g) (u g))
+ "s-derivative of energy"
+ (scalar (*i f (*g3 duds sigma (revg u)))))
+(defmethod dtmds ((u g))
+ "s-derivative of time"
+ (norme2 u))
+(defun ksheom (s x)
+ "KS equations of motion in Hestenes GA form.
+Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
+Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
+ (with-keys (alpha beta e tm) x
+ (let* ((w0 (w0 e))
+ (u (u alpha beta w0 s))
+ (duds (duds beta w0))
+ (sigma (spin *ksh-sigma0* alpha))
+ (r (spin sigma u))
+ (f (funcall *ksh-forcefun* s x))
+ (ff (*g3 f r u)))
+ (make-hash
+ :alpha (dalphads ff w0 s)
+ :beta (dbetads ff w0 s)
+ :e (deds f duds sigma u)
+ :tm (dtmds u)))))
+
+;; Spinor functions
+(defun recoverrotor3d (fs es)
+ "Recover a basis given new and original bases"
+ (let ((psi (+ (apply #'+ (mapcar #'*g fs (apply #'recipbvs es))) 1)))
+ (if (zerogp psi)
+ (error "zero psi (180 deg rotation) unsupported")
+ (unitg psi))))
+(defun recoverspinor3d (r fs es)
+ "Recover a spinor given radius, new basis, and original basis"
+ (* (recoverrotor3d fs es) (sqrt r)))
+(defun rvbasis (rv vv)
+ "Return a set of basis vectors derived from position and velocity"
+ (let* ((mombv (*o rv vv))
+ (x (unitg rv))
+ (y (unitg (*i rv mombv)))
+ (z (when (= 3 (dimension rv) (dimension vv))
+ (*x2 x y))))
+ (if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
+ (list x y)
+ (list x y z))))
+(defmethod rv2u ((rv g) (vv g) (basis list))
+ (recoverspinor3d (norme rv) (rvbasis rv vv) basis))
+(defmethod rv2dudt ((vv g) (u g) (basis1 g))
+ (* (*g3 vv u basis1)
+ (/ (* 2 (norme2 u)))))
+(defun rv2spinors (rv vv basis)
+ "Convert position and velocity vectors to spinor and spinor time derivative"
+ (let ((u (rv2u rv vv basis)))
+ (make-hash
+ :u u
+ :dudt (rv2dudt vv u (first basis)))))
+(defun duds2dt (duds u)
+ "Convert spinor time derivative (also given spinor) to s derivative"
+ (/ duds (norme2 u)))
+(defun dudt2ds (dudt u)
+ "Convert spinor s derivative (also given spinor) to t derivative"
+ (* dudt (norme2 u)))
+(defun spinor2r (u basis1)
+ "Given spinor and 1st basis vector, return corresponding position vector"
+ (spin basis1 u))
+(defun spinors2v (dudt u basis1)
+ "Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
+ (* (*g3 dudt basis1 (revg u)) 2d0))
+(defun spinors2energy (u duds mu)
+ "Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
+ (/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
+
+;; KSH conversion functions
+(defun rv2ksh (rv vv basis mu)
+ "Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
+ (with-keys (u dudt) (rv2spinors rv vv basis)
+ (let* ((duds (dudt2ds dudt u))
+ (e (spinors2energy u duds mu)))
+ (make-hash
+ :alpha u
+ :beta (/ duds (sqrt (- (/ e 2))))
+ :e e
+ :tm 0))))
+(defun ksh2spinors (x s)
+ "Convert KSH state to spinor & spinor s-derivative"
+ (with-keys (alpha beta e tm) x
+ (let ((w0 (w0 e)))
+ (make-hash
+ :u (u alpha beta w0 s) ; spinor
+ :duds (duds beta w0))))) ; spinor s-derivative
+(defun ksh2rv (x s sigma0)
+ "Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
+ (with-keys (alpha beta e tm) x
+ (with-keys (u duds) (ksh2spinors x s)
+ (let ((sigma (spin sigma0 alpha)))
+ (make-hash
+ :r (spinor2r u sigma) ; position
+ :v (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
+
+;; Classical orbit elements
+(defun coe2rv (sma ecc inc raan aop truan mu basis)
+ "Convert cassical orbital elements to position & velocity vectors.
+SMA semi major axis
+ECC eccentricity
+INC inclination
+RAAN right ascension of ascending node
+AOP argument of perigee
+TRUAN true anomaly
+MU gravitational parameter
+BASIS list of 3 orthogonal basis vectors to express position & velocity in"
+ (let* ((r-raan (rotor (*o (first basis) (second basis)) raan))
+ (basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
+ (r-inc (rotor (*o (second basis-raan) (third basis-raan)) inc))
+ (basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
+ (r-aop (rotor (*o (first basis-inc) (second basis-inc)) aop))
+ (basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
+ (r-truan (rotor (*o (first basis-aop) (second basis-aop)) truan))
+ (basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
+ (p (* sma (- 1 (* ecc ecc))))
+ (r (/ p (+ 1 (* ecc (cos truan)))))
+ (ruv (first basis-truan))
+ (rv (* ruv r))
+ (angm (sqrt (/ p mu)))
+ (angmbv (* (*o (first basis-truan) (second basis-truan)) angm))
+ (eccuv (first basis-aop))
+ (eccv (* eccuv ecc))
+ (vv (* (*g (invv angmbv) (+ eccv ruv))
+ mu)))
+ (values (graden rv 1) (graden vv 1))))
+
+;; position & velocity to classical orbit elements
+(defun energy-rv (r v mu)
+ "Orbit energy from position, velocity, & gravitational parameter"
+ (- (/ (* v v) 2)
+ (/ mu r)))
+(defun sma-rv (r v mu)
+ "semi-major axis from position, velocity, & gravitational parameter"
+ (/ mu (* -2 (energy-rv r v mu))))
+(defun eccv-rv (rv vv mu)
+ "eccentricity vector from position, velocity, & gravitational parameter"
+ (/ (- (* rv (- (norme2 vv) (/ mu (norme rv))))
+ (* vv (scalar (*i rv vv))))
+ mu))
+(defun mombv-rv (rv vv)
+ "orbital momentum bivector from position & velocity"
+ (*o rv vv))
+(defun nodev-rv (mombv basis)
+ "ascending node vector from momentum and basis"
+ (- (*i (third basis) mombv)))
+(defun inc-rv (mombv basis)
+ "inclination from momentum bivector and basis"
+ (acos (/ (scalar (*i (third basis) (dual mombv)))
+ (norme mombv))))
+(defun raan-rv (nodev basis)
+ "right ascension of ascending node from node vector and basis"
+ (let ((tmp (acos (scalar (*i (first basis) (unitg nodev))))))
+ (if (< 0 (scalar (*i (second basis) nodev)))
+ (- (* 2 pi) tmp)
+ tmp)))
+(defun aop-rv (nodev eccv basis)
+ "argument of perigee from node vector, eccentricity vector, and basis"
+ (let ((tmp (acos (scalar (*i (unitg nodev) (unitg eccv))))))
+ (if (< 0 (scalar (*i (third basis) eccv)))
+ (- (* 2 pi) tmp)
+ tmp)))
+(defun truan-rv (eccv rv vv)
+ "true anomaly from eccentricity, position, and velocity vectors"
+ (let ((tmp (acos (scalar (*i (unitg eccv) (unitg rv))))))
+ (if (< 0 (scalar (*i rv vv)))
+ (- (* 2 pi) tmp)
+ tmp)))
+(defun rv2coe (rv vv mu basis)
+ "Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
+ (let* ((mombv (mombv-rv rv vv))
+ (nodev (nodev-rv mombv basis))
+ (eccv (eccv-rv rv vv mu)))
+ (make-hash
+ :sma (sma-rv (norme rv) (norme vv) mu)
+ :ecc (norme eccv)
+ :inc (inc-rv mombv basis)
+ :raan (raan-rv nodev basis)
+ :aop (aop-rv nodev eccv basis)
+ :truan (truan-rv eccv rv vv))))
+
+;; Test KSH equations of motion
+(defparameter *kshtest*
+ (make-hash*
+ basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
+ sigma0 (first basis)
+ forcefun #'(lambda (s x) (ve3))
+ r0 (ve3 :c1 1)
+ v0 (ve3 :c10 1.1)
+ mu 1
+ x0 (rv2ksh r0 v0 basis mu)
+ s0 0
+ sf (* pi 2))
+ "Test data for KSH equations of motion")
+
+(defun testksh (data)
+ (with-keys (s0 sf x0) data
+ (let ((*kshparam* data))
+ (rka #'ksheom s0 sf x0))))
+
+(defparameter *kshsailtest*
+ (make-hash*
+ basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
+ sigma0 (first basis)
+ alpha 0
+ delta 0
+ mu 1
+ beta 0.1
+ forcefun #'(lambda (s x)
+ (with-keys (r v) (ksh2rv x s sigma0)
+ (destructuring-bind (posuv tanuv orbuv) (rvbasis r v)
+ (let ((normuv (+ (* posuv (cos alpha))
+ (* orbuv (* (sin alpha) (cos delta)))
+ (* tanuv (* (sin alpha) (sin delta))))))
+ (* normuv
+ (/ (* beta mu (expt (scalar (*i posuv normuv)) 2))
+ (norme2 r)))))))
+ r0 (ve3 :c1 1)
+ v0 (ve3 :c10 1)
+ x0 (rv2ksh r0 v0 basis mu)
+ s0 0
+ sf (* pi 2))
+ "Test data for KSH equations of motion with solar sail")
+
+(defparameter *ksh-forcefun-sail-normal*
+ #'(lambda (s x)
+ (with-keys (r v) (ksh2rv x s *ksh-sigma0*)
+ (sail-normal-force r *mu* *lightness*))))
+
+(defvar *ephemeris*
+ (make-hash
+ :alpha (re2 :c0 1)
+ :beta (re2 :c11 -1)
+ :e -0.5))
+
+(defun planet-ksh-eom (s x)
+ (with-keys (alpha beta e) *ephemeris*
+ (dtmds (u alpha beta (w0 e) s))))
+
diff --git a/package-orbit.lisp b/package-orbit.lisp
new file mode 100644
index 0000000..6b2bab4
--- /dev/null
+++ b/package-orbit.lisp
@@ -0,0 +1,11 @@
+(defpackage :bld-orbit
+ (:use :cl :bld-ga :bld-e3 :bld-e2 :bld-ode)
+ (:shadowing-import-from :bld-gen
+ + - * / expt
+ sin cos tan
+ atan asin acos
+ sinh cosh tanh
+ asinh acosh atanh
+ log exp sqrt abs
+ min max signum)
+ (:import-from :bld-utils :make-hash :make-hash* :with-keys :maphash2))
|
bld/bld-dyn
|
83b60ba2d29511bcccde77ce610c3d3dc88c0d92
|
deleted PRINT-OBJECT method for hash tables because it's already defined in BLD-ODE
|
diff --git a/dyn.lisp b/dyn.lisp
index 43fb4c1..389363a 100644
--- a/dyn.lisp
+++ b/dyn.lisp
@@ -1,306 +1,300 @@
(in-package :bld-dyn)
-;; Infinity norm
+;; Define infinity norm method for BLD-ODE Runge-Kutta method
(defmethod norminfx ((x g))
(norminf x))
-;; Print hash table entries
-(defmethod print-object ((object hash-table) stream)
- (format stream "#<HASH-TABLE")
- (maphash #'(lambda (k v) (format stream " :~a ~a" k v)) object)
- (format stream ">"))
-
;; Sail force functions
(defvar *lightness* 0.1 "Sail lightness number")
(defvar *mu* 1 "Gravitational parameter")
(defmethod sail-normal-force ((rv g) mu lightness)
(* (unitg rv) (/ (* lightness mu) (norme2 rv))))
;; Cartesian equations of motion
(defvar *cart-forcefun* #'(lambda (tm x) (ve3)))
(defvar *cart-forcefun-sail-normal*
#'(lambda (tm x)
(sail-normal-force (gethash :r x) *mu* *lightness*)))
(defmethod dvdt ((r g))
"Cartesian gravitational acceleration"
(* r (/ -1 (expt (norme r) 3))))
(defun carteom (tm x)
"Cartesian orbital equations of motion"
(with-keys (r v) x
(make-hash
:r v
:v (+ (dvdt r) (funcall *cart-forcefun* tm x)))))
;; KS equations of motion
(defvar *ksh-forcefun* #'(lambda (s x) (ve3)) "KSH force function")
(defvar *ksh-sigma0* (ve3 :c1 1) "KSH reference unit position vector")
(defun w0 (e)
"Average orbit angular velocity given energy"
(sqrt (- (/ e 2))))
(defmethod u ((alpha g) (beta g) w0 s)
"Spinor"
(+ (* alpha (cos (* w0 s)))
(* beta (sin (* w0 s)))))
(defmethod alpha ((u g) (duds g) w0 s)
"Alpha (U0) given U, DUDS, W0, and S"
(- (* u (cos (* w0 s)))
(* duds (/ (sin (* w0 s))
w0))))
(defmethod beta ((u g) (duds g) w0 s)
"Beta (dU/ds/w0) given U, DUDS, w0, and s"
(+ (* u (sin (* w0 s)))
(* duds (/ (cos (* w0 s))
w0))))
(defmethod duds ((beta g) w0)
"s-derivative of spinor"
(* beta w0))
(defmethod dalphads ((ff g) w0 s)
"s-derivative of alpha"
(* ff (- (/ (sin (* w0 s)) w0))))
(defmethod dbetads ((ff g) w0 s)
"s-derivative of beta"
(* ff (/ (cos (* w0 s)) w0)))
(defmethod deds ((f g) (duds g) (sigma g) (u g))
"s-derivative of energy"
(scalar (*i f (*g3 duds sigma (revg u)))))
(defmethod dtmds ((u g))
"s-derivative of time"
(norme2 u))
(defun ksheom (s x)
"KS equations of motion in Hestenes GA form.
Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
(with-keys (alpha beta e tm) x
(let* ((w0 (w0 e))
(u (u alpha beta w0 s))
(duds (duds beta w0))
(sigma (spin *ksh-sigma0* alpha))
(r (spin sigma u))
(f (funcall *ksh-forcefun* s x))
(ff (*g3 f r u)))
(make-hash
:alpha (dalphads ff w0 s)
:beta (dbetads ff w0 s)
:e (deds f duds sigma u)
:tm (dtmds u)))))
;; Spinor functions
(defun recoverrotor3d (fs es)
"Recover a basis given new and original bases"
(let ((psi (+ (apply #'+ (mapcar #'*g fs (apply #'recipbvs es))) 1)))
(if (zerogp psi)
(error "zero psi (180 deg rotation) unsupported")
(unitg psi))))
(defun recoverspinor3d (r fs es)
"Recover a spinor given radius, new basis, and original basis"
(* (recoverrotor3d fs es) (sqrt r)))
(defun rvbasis (rv vv)
"Return a set of basis vectors derived from position and velocity"
(let* ((mombv (*o rv vv))
(x (unitg rv))
(y (unitg (*i rv mombv)))
(z (when (= 3 (dimension rv) (dimension vv))
(*x2 x y))))
(if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
(list x y)
(list x y z))))
(defmethod rv2u ((rv g) (vv g) (basis list))
(recoverspinor3d (norme rv) (rvbasis rv vv) basis))
(defmethod rv2dudt ((vv g) (u g) (basis1 g))
(* (*g3 vv u basis1)
(/ (* 2 (norme2 u)))))
(defun rv2spinors (rv vv basis)
"Convert position and velocity vectors to spinor and spinor time derivative"
(let ((u (rv2u rv vv basis)))
(make-hash
:u u
:dudt (rv2dudt vv u (first basis)))))
(defun duds2dt (duds u)
"Convert spinor time derivative (also given spinor) to s derivative"
(/ duds (norme2 u)))
(defun dudt2ds (dudt u)
"Convert spinor s derivative (also given spinor) to t derivative"
(* dudt (norme2 u)))
(defun spinor2r (u basis1)
"Given spinor and 1st basis vector, return corresponding position vector"
(spin basis1 u))
(defun spinors2v (dudt u basis1)
"Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
(* (*g3 dudt basis1 (revg u)) 2d0))
(defun spinors2energy (u duds mu)
"Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
(/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
;; KSH conversion functions
(defun rv2ksh (rv vv basis mu)
"Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
(with-keys (u dudt) (rv2spinors rv vv basis)
(let* ((duds (dudt2ds dudt u))
(e (spinors2energy u duds mu)))
(make-hash
:alpha u
:beta (/ duds (sqrt (- (/ e 2))))
:e e
:tm 0))))
(defun ksh2spinors (x s)
"Convert KSH state to spinor & spinor s-derivative"
(with-keys (alpha beta e tm) x
(let ((w0 (w0 e)))
(make-hash
:u (u alpha beta w0 s) ; spinor
:duds (duds beta w0))))) ; spinor s-derivative
(defun ksh2rv (x s sigma0)
"Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
(with-keys (alpha beta e tm) x
(with-keys (u duds) (ksh2spinors x s)
(let ((sigma (spin sigma0 alpha)))
(make-hash
:r (spinor2r u sigma) ; position
:v (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
;; Classical orbit elements
(defun coe2rv (sma ecc inc raan aop truan mu basis)
"Convert cassical orbital elements to position & velocity vectors.
SMA semi major axis
ECC eccentricity
INC inclination
RAAN right ascension of ascending node
AOP argument of perigee
TRUAN true anomaly
MU gravitational parameter
BASIS list of 3 orthogonal basis vectors to express position & velocity in"
(let* ((r-raan (rotor (*o (first basis) (second basis)) raan))
(basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
(r-inc (rotor (*o (second basis-raan) (third basis-raan)) inc))
(basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
(r-aop (rotor (*o (first basis-inc) (second basis-inc)) aop))
(basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
(r-truan (rotor (*o (first basis-aop) (second basis-aop)) truan))
(basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
(p (* sma (- 1 (* ecc ecc))))
(r (/ p (+ 1 (* ecc (cos truan)))))
(ruv (first basis-truan))
(rv (* ruv r))
(angm (sqrt (/ p mu)))
(angmbv (* (*o (first basis-truan) (second basis-truan)) angm))
(eccuv (first basis-aop))
(eccv (* eccuv ecc))
(vv (* (*g (invv angmbv) (+ eccv ruv))
mu)))
(values (graden rv 1) (graden vv 1))))
;; position & velocity to classical orbit elements
(defun energy-rv (r v mu)
"Orbit energy from position, velocity, & gravitational parameter"
(- (/ (* v v) 2)
(/ mu r)))
(defun sma-rv (r v mu)
"semi-major axis from position, velocity, & gravitational parameter"
(/ mu (* -2 (energy-rv r v mu))))
(defun eccv-rv (rv vv mu)
"eccentricity vector from position, velocity, & gravitational parameter"
(/ (- (* rv (- (norme2 vv) (/ mu (norme rv))))
(* vv (scalar (*i rv vv))))
mu))
(defun mombv-rv (rv vv)
"orbital momentum bivector from position & velocity"
(*o rv vv))
(defun nodev-rv (mombv basis)
"ascending node vector from momentum and basis"
(- (*i (third basis) mombv)))
(defun inc-rv (mombv basis)
"inclination from momentum bivector and basis"
(acos (/ (scalar (*i (third basis) (dual mombv)))
(norme mombv))))
(defun raan-rv (nodev basis)
"right ascension of ascending node from node vector and basis"
(let ((tmp (acos (scalar (*i (first basis) (unitg nodev))))))
(if (< 0 (scalar (*i (second basis) nodev)))
(- (* 2 pi) tmp)
tmp)))
(defun aop-rv (nodev eccv basis)
"argument of perigee from node vector, eccentricity vector, and basis"
(let ((tmp (acos (scalar (*i (unitg nodev) (unitg eccv))))))
(if (< 0 (scalar (*i (third basis) eccv)))
(- (* 2 pi) tmp)
tmp)))
(defun truan-rv (eccv rv vv)
"true anomaly from eccentricity, position, and velocity vectors"
(let ((tmp (acos (scalar (*i (unitg eccv) (unitg rv))))))
(if (< 0 (scalar (*i rv vv)))
(- (* 2 pi) tmp)
tmp)))
(defun rv2coe (rv vv mu basis)
"Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
(let* ((mombv (mombv-rv rv vv))
(nodev (nodev-rv mombv basis))
(eccv (eccv-rv rv vv mu)))
(make-hash
:sma (sma-rv (norme rv) (norme vv) mu)
:ecc (norme eccv)
:inc (inc-rv mombv basis)
:raan (raan-rv nodev basis)
:aop (aop-rv nodev eccv basis)
:truan (truan-rv eccv rv vv))))
;; Test KSH equations of motion
(defparameter *kshtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
forcefun #'(lambda (s x) (ve3))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1.1)
mu 1
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion")
(defun testksh (data)
(with-keys (s0 sf x0) data
(let ((*kshparam* data))
(rka #'ksheom s0 sf x0))))
(defparameter *kshsailtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
alpha 0
delta 0
mu 1
beta 0.1
forcefun #'(lambda (s x)
(with-keys (r v) (ksh2rv x s sigma0)
(destructuring-bind (posuv tanuv orbuv) (rvbasis r v)
(let ((normuv (+ (* posuv (cos alpha))
(* orbuv (* (sin alpha) (cos delta)))
(* tanuv (* (sin alpha) (sin delta))))))
(* normuv
(/ (* beta mu (expt (scalar (*i posuv normuv)) 2))
(norme2 r)))))))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1)
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion with solar sail")
(defparameter *ksh-forcefun-sail-normal*
#'(lambda (s x)
(with-keys (r v) (ksh2rv x s *ksh-sigma0*)
(sail-normal-force r *mu* *lightness*))))
(defvar *ephemeris*
(make-hash
:alpha (re2 :c0 1)
:beta (re2 :c11 -1)
:e -0.5))
(defun planet-ksh-eom (s x)
(with-keys (alpha beta e) *ephemeris*
(dtmds (u alpha beta (w0 e) s))))
|
bld/bld-dyn
|
478f143174d390747286994eb689ee99cb3365e2
|
changed to use generic arithmetic from BLD-GEN. Fixed some other changes leaving it non-functional. Uses *G3 method for vector-bivector-vector->rotor multiplications.
|
diff --git a/bld-dyn.asd b/bld-dyn.asd
index 486caf3..7994c50 100644
--- a/bld-dyn.asd
+++ b/bld-dyn.asd
@@ -1,15 +1,14 @@
(defpackage :bld.dyn.system
(:use :asdf :cl))
(in-package :bld.dyn.system)
(defsystem :bld-dyn
:name "bld-dyn"
:author "Ben Diedrich"
:version "0.0.1"
:maintainer "Ben Diedrich"
:license "MIT"
:description "Dynamics library employing geometric algebra"
:components
((:file "package")
- (:file "dyn" :depends-on ("package"))
- (:file "opt" :depends-on ("dyn")))
- :depends-on ("bld-ga" "bld-e2" "bld-e3" "bld-ode" "bld-utils" "bld-sym" "bld-gagen"))
+ (:file "dyn" :depends-on ("package")))
+ :depends-on ("bld-ga" "bld-e2" "bld-e3" "bld-ode" "bld-utils" "bld-gen"))
diff --git a/dyn.lisp b/dyn.lisp
index 2831730..43fb4c1 100644
--- a/dyn.lisp
+++ b/dyn.lisp
@@ -1,312 +1,306 @@
(in-package :bld-dyn)
-;; State algebra methods
-(defmethod +x2 ((a g) (b g))
- (g2+ a b))
-(defmethod -x2 ((a g) (b g))
- (g2- a b))
-(defmethod *xs ((x g) (s number))
- (*gs x s))
+;; Infinity norm
(defmethod norminfx ((x g))
(norminf x))
;; Print hash table entries
(defmethod print-object ((object hash-table) stream)
(format stream "#<HASH-TABLE")
(maphash #'(lambda (k v) (format stream " :~a ~a" k v)) object)
(format stream ">"))
;; Sail force functions
(defvar *lightness* 0.1 "Sail lightness number")
(defvar *mu* 1 "Gravitational parameter")
(defmethod sail-normal-force ((rv g) mu lightness)
- (*gs (unitg rv) (/n2 (*n2 lightness mu) (norme2 rv))))
+ (* (unitg rv) (/ (* lightness mu) (norme2 rv))))
;; Cartesian equations of motion
(defvar *cart-forcefun* #'(lambda (tm x) (ve3)))
(defvar *cart-forcefun-sail-normal*
#'(lambda (tm x)
(sail-normal-force (gethash :r x) *mu* *lightness*)))
(defmethod dvdt ((r g))
"Cartesian gravitational acceleration"
- (*gs r (/n2 -1 (exptn (norme r) 3))))
+ (* r (/ -1 (expt (norme r) 3))))
(defun carteom (tm x)
"Cartesian orbital equations of motion"
(with-keys (r v) x
(make-hash
:r v
- :v (g2+ (dvdt r) (funcall *cart-forcefun* tm x)))))
+ :v (+ (dvdt r) (funcall *cart-forcefun* tm x)))))
;; KS equations of motion
(defvar *ksh-forcefun* #'(lambda (s x) (ve3)) "KSH force function")
(defvar *ksh-sigma0* (ve3 :c1 1) "KSH reference unit position vector")
(defun w0 (e)
"Average orbit angular velocity given energy"
(sqrt (- (/ e 2))))
(defmethod u ((alpha g) (beta g) w0 s)
"Spinor"
- (g2+ (*gs alpha (cosn (*n2 w0 s)))
- (*gs beta (sinn (*n2 w0 s)))))
+ (+ (* alpha (cos (* w0 s)))
+ (* beta (sin (* w0 s)))))
(defmethod alpha ((u g) (duds g) w0 s)
"Alpha (U0) given U, DUDS, W0, and S"
- (g2- (*gs u (cosn (*n2 w0 s)))
- (*gs duds (/n2 (sinn (*n2 w0 s))
- w0))))
+ (- (* u (cos (* w0 s)))
+ (* duds (/ (sin (* w0 s))
+ w0))))
(defmethod beta ((u g) (duds g) w0 s)
"Beta (dU/ds/w0) given U, DUDS, w0, and s"
- (g2+ (*gs u (sinn (*n2 w0 s)))
- (*gs duds (/n2 (cosn (*n2 w0 s))
- w0))))
+ (+ (* u (sin (* w0 s)))
+ (* duds (/ (cos (* w0 s))
+ w0))))
(defmethod duds ((beta g) w0)
"s-derivative of spinor"
- (*gs beta w0))
+ (* beta w0))
(defmethod dalphads ((ff g) w0 s)
"s-derivative of alpha"
- (*gs ff (negn (/n2 (sinn (*n2 w0 s)) w0))))
+ (* ff (- (/ (sin (* w0 s)) w0))))
(defmethod dbetads ((ff g) w0 s)
"s-derivative of beta"
- (*gs ff (/n2 (cosn (*n2 w0 s)) w0)))
+ (* ff (/ (cos (* w0 s)) w0)))
(defmethod deds ((f g) (duds g) (sigma g) (u g))
"s-derivative of energy"
- (scalar (*i2 f (*g3 duds sigma (revg u)))))
+ (scalar (*i f (*g3 duds sigma (revg u)))))
(defmethod dtmds ((u g))
"s-derivative of time"
(norme2 u))
(defun ksheom (s x)
"KS equations of motion in Hestenes GA form.
Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
(with-keys (alpha beta e tm) x
(let* ((w0 (w0 e))
(u (u alpha beta w0 s))
- (duds (duds alpha beta w0 s))
+ (duds (duds beta w0))
(sigma (spin *ksh-sigma0* alpha))
(r (spin sigma u))
(f (funcall *ksh-forcefun* s x))
(ff (*g3 f r u)))
(make-hash
:alpha (dalphads ff w0 s)
:beta (dbetads ff w0 s)
:e (deds f duds sigma u)
:tm (dtmds u)))))
;; Spinor functions
(defun recoverrotor3d (fs es)
"Recover a basis given new and original bases"
- (let ((psi (gbc+ (apply #'g+ (mapcar #'*g2 fs (apply #'recipbvs es))) 0 1)))
+ (let ((psi (+ (apply #'+ (mapcar #'*g fs (apply #'recipbvs es))) 1)))
(if (zerogp psi)
(error "zero psi (180 deg rotation) unsupported")
(unitg psi))))
(defun recoverspinor3d (r fs es)
"Recover a spinor given radius, new basis, and original basis"
- (*gs (recoverrotor3d fs es) (sqrt r)))
+ (* (recoverrotor3d fs es) (sqrt r)))
(defun rvbasis (rv vv)
"Return a set of basis vectors derived from position and velocity"
- (let* ((mombv (*o2 rv vv))
+ (let* ((mombv (*o rv vv))
(x (unitg rv))
- (y (unitg (*i2 rv mombv)))
+ (y (unitg (*i rv mombv)))
(z (when (= 3 (dimension rv) (dimension vv))
(*x2 x y))))
(if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
(list x y)
(list x y z))))
(defmethod rv2u ((rv g) (vv g) (basis list))
(recoverspinor3d (norme rv) (rvbasis rv vv) basis))
(defmethod rv2dudt ((vv g) (u g) (basis1 g))
- (*gs (*g vv u basis1)
- (/n1 (*n2 2 (norme2 u)))))
+ (* (*g3 vv u basis1)
+ (/ (* 2 (norme2 u)))))
(defun rv2spinors (rv vv basis)
"Convert position and velocity vectors to spinor and spinor time derivative"
(let ((u (rv2u rv vv basis)))
(make-hash
:u u
:dudt (rv2dudt vv u (first basis)))))
(defun duds2dt (duds u)
"Convert spinor time derivative (also given spinor) to s derivative"
- (/gs duds (norme2 u)))
+ (/ duds (norme2 u)))
(defun dudt2ds (dudt u)
"Convert spinor s derivative (also given spinor) to t derivative"
- (*gs dudt (norme2 u)))
+ (* dudt (norme2 u)))
(defun spinor2r (u basis1)
"Given spinor and 1st basis vector, return corresponding position vector"
(spin basis1 u))
(defun spinors2v (dudt u basis1)
"Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
- (*gs (*g3 dudt basis1 (revg u)) 2d0))
+ (* (*g3 dudt basis1 (revg u)) 2d0))
(defun spinors2energy (u duds mu)
"Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
(/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
;; KSH conversion functions
(defun rv2ksh (rv vv basis mu)
"Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
(with-keys (u dudt) (rv2spinors rv vv basis)
(let* ((duds (dudt2ds dudt u))
(e (spinors2energy u duds mu)))
(make-hash
:alpha u
- :beta (/gs duds (sqrtn (negn (/n2 e 2))))
+ :beta (/ duds (sqrt (- (/ e 2))))
:e e
:tm 0))))
(defun ksh2spinors (x s)
"Convert KSH state to spinor & spinor s-derivative"
(with-keys (alpha beta e tm) x
(let ((w0 (w0 e)))
(make-hash
:u (u alpha beta w0 s) ; spinor
- :duds (duds alpha beta w0 s))))) ; spinor s-derivative
+ :duds (duds beta w0))))) ; spinor s-derivative
(defun ksh2rv (x s sigma0)
"Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
(with-keys (alpha beta e tm) x
(with-keys (u duds) (ksh2spinors x s)
(let ((sigma (spin sigma0 alpha)))
(make-hash
:r (spinor2r u sigma) ; position
:v (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
;; Classical orbit elements
(defun coe2rv (sma ecc inc raan aop truan mu basis)
"Convert cassical orbital elements to position & velocity vectors.
SMA semi major axis
ECC eccentricity
INC inclination
RAAN right ascension of ascending node
AOP argument of perigee
TRUAN true anomaly
MU gravitational parameter
BASIS list of 3 orthogonal basis vectors to express position & velocity in"
- (let* ((r-raan (rotor (*o2 (first basis) (second basis)) raan))
+ (let* ((r-raan (rotor (*o (first basis) (second basis)) raan))
(basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
- (r-inc (rotor (*o2 (second basis-raan) (third basis-raan)) inc))
+ (r-inc (rotor (*o (second basis-raan) (third basis-raan)) inc))
(basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
- (r-aop (rotor (*o2 (first basis-inc) (second basis-inc)) aop))
+ (r-aop (rotor (*o (first basis-inc) (second basis-inc)) aop))
(basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
- (r-truan (rotor (*o2 (first basis-aop) (second basis-aop)) truan))
+ (r-truan (rotor (*o (first basis-aop) (second basis-aop)) truan))
(basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
(p (* sma (- 1 (* ecc ecc))))
(r (/ p (+ 1 (* ecc (cos truan)))))
(ruv (first basis-truan))
- (rv (*gs ruv r))
+ (rv (* ruv r))
(angm (sqrt (/ p mu)))
- (angmbv (*gs (*o2 (first basis-truan) (second basis-truan)) angm))
+ (angmbv (* (*o (first basis-truan) (second basis-truan)) angm))
(eccuv (first basis-aop))
- (eccv (*gs eccuv ecc))
- (vv (*gs (*g2 (invv angmbv) (g+ eccv ruv))
+ (eccv (* eccuv ecc))
+ (vv (* (*g (invv angmbv) (+ eccv ruv))
mu)))
(values (graden rv 1) (graden vv 1))))
;; position & velocity to classical orbit elements
(defun energy-rv (r v mu)
"Orbit energy from position, velocity, & gravitational parameter"
(- (/ (* v v) 2)
(/ mu r)))
(defun sma-rv (r v mu)
"semi-major axis from position, velocity, & gravitational parameter"
(/ mu (* -2 (energy-rv r v mu))))
(defun eccv-rv (rv vv mu)
"eccentricity vector from position, velocity, & gravitational parameter"
- (/gs (g2- (*gs rv (- (norme2 vv) (/ mu (norme rv))))
- (*gs vv (scalar (*i2 rv vv))))
+ (/ (- (* rv (- (norme2 vv) (/ mu (norme rv))))
+ (* vv (scalar (*i rv vv))))
mu))
(defun mombv-rv (rv vv)
"orbital momentum bivector from position & velocity"
- (*o2 rv vv))
+ (*o rv vv))
(defun nodev-rv (mombv basis)
"ascending node vector from momentum and basis"
- (g- (*i2 (third basis) mombv)))
+ (- (*i (third basis) mombv)))
(defun inc-rv (mombv basis)
"inclination from momentum bivector and basis"
- (acos (/ (scalar (*i2 (third basis) (dual mombv)))
+ (acos (/ (scalar (*i (third basis) (dual mombv)))
(norme mombv))))
(defun raan-rv (nodev basis)
"right ascension of ascending node from node vector and basis"
- (let ((tmp (acos (scalar (*i2 (first basis) (unitg nodev))))))
- (if (< 0 (scalar (*i2 (second basis) nodev)))
+ (let ((tmp (acos (scalar (*i (first basis) (unitg nodev))))))
+ (if (< 0 (scalar (*i (second basis) nodev)))
(- (* 2 pi) tmp)
tmp)))
(defun aop-rv (nodev eccv basis)
"argument of perigee from node vector, eccentricity vector, and basis"
- (let ((tmp (acos (scalar (*i2 (unitg nodev) (unitg eccv))))))
- (if (< 0 (scalar (*i2 (third basis) eccv)))
+ (let ((tmp (acos (scalar (*i (unitg nodev) (unitg eccv))))))
+ (if (< 0 (scalar (*i (third basis) eccv)))
(- (* 2 pi) tmp)
tmp)))
(defun truan-rv (eccv rv vv)
"true anomaly from eccentricity, position, and velocity vectors"
- (let ((tmp (acos (scalar (*i2 (unitg eccv) (unitg rv))))))
- (if (< 0 (scalar (*i2 rv vv)))
+ (let ((tmp (acos (scalar (*i (unitg eccv) (unitg rv))))))
+ (if (< 0 (scalar (*i rv vv)))
(- (* 2 pi) tmp)
tmp)))
(defun rv2coe (rv vv mu basis)
"Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
(let* ((mombv (mombv-rv rv vv))
(nodev (nodev-rv mombv basis))
(eccv (eccv-rv rv vv mu)))
(make-hash
:sma (sma-rv (norme rv) (norme vv) mu)
:ecc (norme eccv)
:inc (inc-rv mombv basis)
:raan (raan-rv nodev basis)
:aop (aop-rv nodev eccv basis)
:truan (truan-rv eccv rv vv))))
;; Test KSH equations of motion
(defparameter *kshtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
forcefun #'(lambda (s x) (ve3))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1.1)
mu 1
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion")
(defun testksh (data)
(with-keys (s0 sf x0) data
(let ((*kshparam* data))
(rka #'ksheom s0 sf x0))))
(defparameter *kshsailtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
alpha 0
delta 0
mu 1
beta 0.1
forcefun #'(lambda (s x)
(with-keys (r v) (ksh2rv x s sigma0)
(destructuring-bind (posuv tanuv orbuv) (rvbasis r v)
- (let ((normuv (g+ (*gs posuv (cos alpha))
- (*gs orbuv (* (sin alpha) (cos delta)))
- (*gs tanuv (* (sin alpha) (sin delta))))))
- (*gs normuv
- (/ (* beta mu (expt (scalar (*i2 posuv normuv)) 2))
- (norme2 r)))))))
+ (let ((normuv (+ (* posuv (cos alpha))
+ (* orbuv (* (sin alpha) (cos delta)))
+ (* tanuv (* (sin alpha) (sin delta))))))
+ (* normuv
+ (/ (* beta mu (expt (scalar (*i posuv normuv)) 2))
+ (norme2 r)))))))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1)
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion with solar sail")
(defparameter *ksh-forcefun-sail-normal*
#'(lambda (s x)
(with-keys (r v) (ksh2rv x s *ksh-sigma0*)
(sail-normal-force r *mu* *lightness*))))
(defvar *ephemeris*
(make-hash
:alpha (re2 :c0 1)
:beta (re2 :c11 -1)
:e -0.5))
(defun planet-ksh-eom (s x)
(with-keys (alpha beta e) *ephemeris*
(dtmds (u alpha beta (w0 e) s))))
diff --git a/package.lisp b/package.lisp
index 6580e48..d2f7f1a 100644
--- a/package.lisp
+++ b/package.lisp
@@ -1,4 +1,11 @@
(defpackage :bld-dyn
- (:use :cl :bld-ga :bld-e3 :bld-e2 :bld-ode :bld-sym)
- (:import-from :bld-utils :make-hash :make-hash* :with-keys :maphash2)
- (:import-from :bld-gagen :defgamethod))
+ (:use :cl :bld-ga :bld-e3 :bld-e2 :bld-ode)
+ (:shadowing-import-from :bld-gen
+ + - * / expt
+ sin cos tan
+ atan asin acos
+ sinh cosh tanh
+ asinh acosh atanh
+ log exp sqrt abs
+ min max signum)
+ (:import-from :bld-utils :make-hash :make-hash* :with-keys :maphash2))
|
bld/bld-dyn
|
ab908787044856579d0cb4b5f6b8c5055ec44a11
|
bunch of changes. not everything's working. still need to verify correctness of Kustannheimo-Stiefel equations.
|
diff --git a/bld-dyn.asd b/bld-dyn.asd
index 8308710..486caf3 100644
--- a/bld-dyn.asd
+++ b/bld-dyn.asd
@@ -1,14 +1,15 @@
(defpackage :bld.dyn.system
(:use :asdf :cl))
(in-package :bld.dyn.system)
(defsystem :bld-dyn
:name "bld-dyn"
:author "Ben Diedrich"
:version "0.0.1"
:maintainer "Ben Diedrich"
:license "MIT"
- :description "Dynamics library"
+ :description "Dynamics library employing geometric algebra"
:components
((:file "package")
- (:file "dyn" :depends-on ("package")))
- :depends-on ("bld-ga" "bld-e2" "bld-e3" "bld-ode" "bld-utils"))
+ (:file "dyn" :depends-on ("package"))
+ (:file "opt" :depends-on ("dyn")))
+ :depends-on ("bld-ga" "bld-e2" "bld-e3" "bld-ode" "bld-utils" "bld-sym" "bld-gagen"))
diff --git a/dyn.lisp b/dyn.lisp
old mode 100755
new mode 100644
index ad7dfc4..2831730
--- a/dyn.lisp
+++ b/dyn.lisp
@@ -1,266 +1,312 @@
(in-package :bld-dyn)
;; State algebra methods
(defmethod +x2 ((a g) (b g))
(g2+ a b))
(defmethod -x2 ((a g) (b g))
(g2- a b))
(defmethod *xs ((x g) (s number))
(*gs x s))
(defmethod norminfx ((x g))
(norminf x))
+;; Print hash table entries
+(defmethod print-object ((object hash-table) stream)
+ (format stream "#<HASH-TABLE")
+ (maphash #'(lambda (k v) (format stream " :~a ~a" k v)) object)
+ (format stream ">"))
+
+;; Sail force functions
+(defvar *lightness* 0.1 "Sail lightness number")
+(defvar *mu* 1 "Gravitational parameter")
+(defmethod sail-normal-force ((rv g) mu lightness)
+ (*gs (unitg rv) (/n2 (*n2 lightness mu) (norme2 rv))))
+
;; Cartesian equations of motion
-;;(defstate cartx (r v))
-;;(defstatemethods cartx (r v))
+(defvar *cart-forcefun* #'(lambda (tm x) (ve3)))
+(defvar *cart-forcefun-sail-normal*
+ #'(lambda (tm x)
+ (sail-normal-force (gethash :r x) *mu* *lightness*)))
+(defmethod dvdt ((r g))
+ "Cartesian gravitational acceleration"
+ (*gs r (/n2 -1 (exptn (norme r) 3))))
+
(defun carteom (tm x)
"Cartesian orbital equations of motion"
(with-keys (r v) x
(make-hash
:r v
- :v (*gs r (/ -1 (expt (norme r) 3))))))
+ :v (g2+ (dvdt r) (funcall *cart-forcefun* tm x)))))
+
+;; KS equations of motion
+
+(defvar *ksh-forcefun* #'(lambda (s x) (ve3)) "KSH force function")
+(defvar *ksh-sigma0* (ve3 :c1 1) "KSH reference unit position vector")
-;; Kustaanheimo-Stiefel-Hestenes Equations of Planetary Motion
-;;(defstate kshx (alpha beta e tm))
-;;(defstatemethods kshx (alpha beta e tm))
-(defvar *kshparam* (make-hash :forcefun #'(lambda (s x) 0) :sigma0 (ve3 :c1 1)))
(defun w0 (e)
"Average orbit angular velocity given energy"
(sqrt (- (/ e 2))))
-(defun u (alpha beta w0 s)
+(defmethod u ((alpha g) (beta g) w0 s)
"Spinor"
- (g2+ (*gs alpha (cos (* w0 s)))
- (*gs beta (sin (* w0 s)))))
-(defun duds (alpha beta w0 s)
+ (g2+ (*gs alpha (cosn (*n2 w0 s)))
+ (*gs beta (sinn (*n2 w0 s)))))
+(defmethod alpha ((u g) (duds g) w0 s)
+ "Alpha (U0) given U, DUDS, W0, and S"
+ (g2- (*gs u (cosn (*n2 w0 s)))
+ (*gs duds (/n2 (sinn (*n2 w0 s))
+ w0))))
+(defmethod beta ((u g) (duds g) w0 s)
+ "Beta (dU/ds/w0) given U, DUDS, w0, and s"
+ (g2+ (*gs u (sinn (*n2 w0 s)))
+ (*gs duds (/n2 (cosn (*n2 w0 s))
+ w0))))
+(defmethod duds ((beta g) w0)
"s-derivative of spinor"
- (*gs (g2- (*gs beta (cos (* w0 s)))
- (*gs alpha (sin (* w0 s))))
- w0))
-(defun dalphads (ff w0 s)
+ (*gs beta w0))
+(defmethod dalphads ((ff g) w0 s)
"s-derivative of alpha"
- (*gs ff (- (/ (sin (* w0 s)) w0))))
-(defun dbetads (ff w0 s)
+ (*gs ff (negn (/n2 (sinn (*n2 w0 s)) w0))))
+(defmethod dbetads ((ff g) w0 s)
"s-derivative of beta"
- (*gs ff (/ (cos (* w0 s)) w0)))
-(defun deds (f duds sigma u)
+ (*gs ff (/n2 (cosn (*n2 w0 s)) w0)))
+(defmethod deds ((f g) (duds g) (sigma g) (u g))
"s-derivative of energy"
(scalar (*i2 f (*g3 duds sigma (revg u)))))
-(defun dtmds (u)
+(defmethod dtmds ((u g))
"s-derivative of time"
(norme2 u))
(defun ksheom (s x)
"KS equations of motion in Hestenes GA form.
Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
(with-keys (alpha beta e tm) x
(let* ((w0 (w0 e))
(u (u alpha beta w0 s))
(duds (duds alpha beta w0 s))
- (sigma (spin (gethash :sigma0 *kshparam*) alpha))
+ (sigma (spin *ksh-sigma0* alpha))
(r (spin sigma u))
- (f (funcall (gethash :forcefun *kshparam*) s x))
+ (f (funcall *ksh-forcefun* s x))
(ff (*g3 f r u)))
(make-hash
:alpha (dalphads ff w0 s)
:beta (dbetads ff w0 s)
:e (deds f duds sigma u)
:tm (dtmds u)))))
;; Spinor functions
(defun recoverrotor3d (fs es)
"Recover a basis given new and original bases"
(let ((psi (gbc+ (apply #'g+ (mapcar #'*g2 fs (apply #'recipbvs es))) 0 1)))
(if (zerogp psi)
(error "zero psi (180 deg rotation) unsupported")
(unitg psi))))
(defun recoverspinor3d (r fs es)
"Recover a spinor given radius, new basis, and original basis"
(*gs (recoverrotor3d fs es) (sqrt r)))
(defun rvbasis (rv vv)
"Return a set of basis vectors derived from position and velocity"
(let* ((mombv (*o2 rv vv))
(x (unitg rv))
(y (unitg (*i2 rv mombv)))
(z (when (= 3 (dimension rv) (dimension vv))
(*x2 x y))))
(if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
(list x y)
(list x y z))))
+(defmethod rv2u ((rv g) (vv g) (basis list))
+ (recoverspinor3d (norme rv) (rvbasis rv vv) basis))
+(defmethod rv2dudt ((vv g) (u g) (basis1 g))
+ (*gs (*g vv u basis1)
+ (/n1 (*n2 2 (norme2 u)))))
(defun rv2spinors (rv vv basis)
"Convert position and velocity vectors to spinor and spinor time derivative"
- (let* ((r (norme rv))
- (u (recoverspinor3d r (rvbasis rv vv) basis)))
+ (let ((u (rv2u rv vv basis)))
(make-hash
:u u
- :dudt (*gs (*g3 vv u (first basis))
- (/ 1 2 r)))))
+ :dudt (rv2dudt vv u (first basis)))))
(defun duds2dt (duds u)
"Convert spinor time derivative (also given spinor) to s derivative"
(/gs duds (norme2 u)))
(defun dudt2ds (dudt u)
"Convert spinor s derivative (also given spinor) to t derivative"
(*gs dudt (norme2 u)))
(defun spinor2r (u basis1)
"Given spinor and 1st basis vector, return corresponding position vector"
(spin basis1 u))
(defun spinors2v (dudt u basis1)
"Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
(*gs (*g3 dudt basis1 (revg u)) 2d0))
(defun spinors2energy (u duds mu)
"Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
(/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
;; KSH conversion functions
(defun rv2ksh (rv vv basis mu)
"Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
(with-keys (u dudt) (rv2spinors rv vv basis)
(let* ((duds (dudt2ds dudt u))
(e (spinors2energy u duds mu)))
(make-hash
:alpha u
- :beta (/gs duds (sqrt (- (/ e 2))))
+ :beta (/gs duds (sqrtn (negn (/n2 e 2))))
:e e
:tm 0))))
(defun ksh2spinors (x s)
"Convert KSH state to spinor & spinor s-derivative"
(with-keys (alpha beta e tm) x
(let ((w0 (w0 e)))
(make-hash
:u (u alpha beta w0 s) ; spinor
:duds (duds alpha beta w0 s))))) ; spinor s-derivative
(defun ksh2rv (x s sigma0)
"Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
(with-keys (alpha beta e tm) x
(with-keys (u duds) (ksh2spinors x s)
(let ((sigma (spin sigma0 alpha)))
(make-hash
:r (spinor2r u sigma) ; position
:v (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
;; Classical orbit elements
(defun coe2rv (sma ecc inc raan aop truan mu basis)
"Convert cassical orbital elements to position & velocity vectors.
SMA semi major axis
ECC eccentricity
INC inclination
RAAN right ascension of ascending node
AOP argument of perigee
TRUAN true anomaly
MU gravitational parameter
BASIS list of 3 orthogonal basis vectors to express position & velocity in"
(let* ((r-raan (rotor (*o2 (first basis) (second basis)) raan))
(basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
(r-inc (rotor (*o2 (second basis-raan) (third basis-raan)) inc))
(basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
(r-aop (rotor (*o2 (first basis-inc) (second basis-inc)) aop))
(basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
(r-truan (rotor (*o2 (first basis-aop) (second basis-aop)) truan))
(basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
(p (* sma (- 1 (* ecc ecc))))
(r (/ p (+ 1 (* ecc (cos truan)))))
(ruv (first basis-truan))
(rv (*gs ruv r))
(angm (sqrt (/ p mu)))
(angmbv (*gs (*o2 (first basis-truan) (second basis-truan)) angm))
(eccuv (first basis-aop))
(eccv (*gs eccuv ecc))
- (vv (*gs (*g2 (invv angmbv) (+g eccv ruv))
+ (vv (*gs (*g2 (invv angmbv) (g+ eccv ruv))
mu)))
(values (graden rv 1) (graden vv 1))))
;; position & velocity to classical orbit elements
(defun energy-rv (r v mu)
"Orbit energy from position, velocity, & gravitational parameter"
(- (/ (* v v) 2)
(/ mu r)))
(defun sma-rv (r v mu)
"semi-major axis from position, velocity, & gravitational parameter"
(/ mu (* -2 (energy-rv r v mu))))
(defun eccv-rv (rv vv mu)
"eccentricity vector from position, velocity, & gravitational parameter"
(/gs (g2- (*gs rv (- (norme2 vv) (/ mu (norme rv))))
(*gs vv (scalar (*i2 rv vv))))
mu))
(defun mombv-rv (rv vv)
"orbital momentum bivector from position & velocity"
(*o2 rv vv))
(defun nodev-rv (mombv basis)
"ascending node vector from momentum and basis"
- (-g (*i2 (third basis) mombv)))
+ (g- (*i2 (third basis) mombv)))
(defun inc-rv (mombv basis)
"inclination from momentum bivector and basis"
(acos (/ (scalar (*i2 (third basis) (dual mombv)))
(norme mombv))))
(defun raan-rv (nodev basis)
"right ascension of ascending node from node vector and basis"
(let ((tmp (acos (scalar (*i2 (first basis) (unitg nodev))))))
(if (< 0 (scalar (*i2 (second basis) nodev)))
(- (* 2 pi) tmp)
tmp)))
(defun aop-rv (nodev eccv basis)
"argument of perigee from node vector, eccentricity vector, and basis"
(let ((tmp (acos (scalar (*i2 (unitg nodev) (unitg eccv))))))
(if (< 0 (scalar (*i2 (third basis) eccv)))
(- (* 2 pi) tmp)
tmp)))
(defun truan-rv (eccv rv vv)
"true anomaly from eccentricity, position, and velocity vectors"
(let ((tmp (acos (scalar (*i2 (unitg eccv) (unitg rv))))))
(if (< 0 (scalar (*i2 rv vv)))
(- (* 2 pi) tmp)
tmp)))
(defun rv2coe (rv vv mu basis)
"Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
(let* ((mombv (mombv-rv rv vv))
(nodev (nodev-rv mombv basis))
(eccv (eccv-rv rv vv mu)))
(make-hash
:sma (sma-rv (norme rv) (norme vv) mu)
:ecc (norme eccv)
:inc (inc-rv mombv basis)
:raan (raan-rv nodev basis)
:aop (aop-rv nodev eccv basis)
- :truan (truan eccv rv vv))))
+ :truan (truan-rv eccv rv vv))))
;; Test KSH equations of motion
(defparameter *kshtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
forcefun #'(lambda (s x) (ve3))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1.1)
mu 1
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion")
(defun testksh (data)
(with-keys (s0 sf x0) data
(let ((*kshparam* data))
(rka #'ksheom s0 sf x0))))
(defparameter *kshsailtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
alpha 0
delta 0
mu 1
beta 0.1
forcefun #'(lambda (s x)
(with-keys (r v) (ksh2rv x s sigma0)
(destructuring-bind (posuv tanuv orbuv) (rvbasis r v)
(let ((normuv (g+ (*gs posuv (cos alpha))
(*gs orbuv (* (sin alpha) (cos delta)))
(*gs tanuv (* (sin alpha) (sin delta))))))
(*gs normuv
(/ (* beta mu (expt (scalar (*i2 posuv normuv)) 2))
(norme2 r)))))))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1)
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion with solar sail")
+
+(defparameter *ksh-forcefun-sail-normal*
+ #'(lambda (s x)
+ (with-keys (r v) (ksh2rv x s *ksh-sigma0*)
+ (sail-normal-force r *mu* *lightness*))))
+
+(defvar *ephemeris*
+ (make-hash
+ :alpha (re2 :c0 1)
+ :beta (re2 :c11 -1)
+ :e -0.5))
+
+(defun planet-ksh-eom (s x)
+ (with-keys (alpha beta e) *ephemeris*
+ (dtmds (u alpha beta (w0 e) s))))
+
diff --git a/opt.lisp b/opt.lisp
new file mode 100644
index 0000000..9487503
--- /dev/null
+++ b/opt.lisp
@@ -0,0 +1,14 @@
+;; Optimized BLD-DYN functions
+(in-package :bld-dyn)
+
+;; Ensure rv2dudt returns an RE3 for 3D problem
+(defgamethod e3 rv2dudt bld-e3::*spec* ve3 re3 ve3)
+
+;; Optimize KSHEOM sub-functions
+#|(defgamethod e3 u bld-e3::*spec* re3 re3 number number)
+(defgamethod e3 duds bld-e3::*spec* re3 re3 number number)
+(defgamethod e3 dalphads bld-e3::*spec* ve3 number number)
+(defgamethod e3 dbetads bld-e3::*spec* ve3 number number)
+(defgamethod e3 deds bld-e3::*spec* ve3 re3 ve3 re3)
+(defgamethod e3 dtmds bld-e3::*spec* re3)
+|#
\ No newline at end of file
diff --git a/package.lisp b/package.lisp
old mode 100755
new mode 100644
index e025758..6580e48
--- a/package.lisp
+++ b/package.lisp
@@ -1,3 +1,4 @@
(defpackage :bld-dyn
- (:use :cl :bld-ga :bld-e3 :bld-e2 :bld-ode)
- (:import-from :bld-utils :make-hash :make-hash* :with-keys))
+ (:use :cl :bld-ga :bld-e3 :bld-e2 :bld-ode :bld-sym)
+ (:import-from :bld-utils :make-hash :make-hash* :with-keys :maphash2)
+ (:import-from :bld-gagen :defgamethod))
|
bld/bld-dyn
|
747d86a45fe75d1a13451086fec2c3f1468f8d0f
|
added simple solar sail test case for KS equations
|
diff --git a/dyn.lisp b/dyn.lisp
index 5fad240..ad7dfc4 100755
--- a/dyn.lisp
+++ b/dyn.lisp
@@ -1,242 +1,266 @@
(in-package :bld-dyn)
;; State algebra methods
(defmethod +x2 ((a g) (b g))
(g2+ a b))
(defmethod -x2 ((a g) (b g))
(g2- a b))
(defmethod *xs ((x g) (s number))
(*gs x s))
(defmethod norminfx ((x g))
(norminf x))
;; Cartesian equations of motion
;;(defstate cartx (r v))
;;(defstatemethods cartx (r v))
(defun carteom (tm x)
"Cartesian orbital equations of motion"
(with-keys (r v) x
(make-hash
:r v
:v (*gs r (/ -1 (expt (norme r) 3))))))
;; Kustaanheimo-Stiefel-Hestenes Equations of Planetary Motion
;;(defstate kshx (alpha beta e tm))
;;(defstatemethods kshx (alpha beta e tm))
(defvar *kshparam* (make-hash :forcefun #'(lambda (s x) 0) :sigma0 (ve3 :c1 1)))
(defun w0 (e)
"Average orbit angular velocity given energy"
(sqrt (- (/ e 2))))
(defun u (alpha beta w0 s)
"Spinor"
(g2+ (*gs alpha (cos (* w0 s)))
(*gs beta (sin (* w0 s)))))
(defun duds (alpha beta w0 s)
"s-derivative of spinor"
(*gs (g2- (*gs beta (cos (* w0 s)))
(*gs alpha (sin (* w0 s))))
w0))
(defun dalphads (ff w0 s)
"s-derivative of alpha"
(*gs ff (- (/ (sin (* w0 s)) w0))))
(defun dbetads (ff w0 s)
"s-derivative of beta"
(*gs ff (/ (cos (* w0 s)) w0)))
(defun deds (f duds sigma u)
"s-derivative of energy"
(scalar (*i2 f (*g3 duds sigma (revg u)))))
(defun dtmds (u)
"s-derivative of time"
(norme2 u))
(defun ksheom (s x)
"KS equations of motion in Hestenes GA form.
Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
(with-keys (alpha beta e tm) x
(let* ((w0 (w0 e))
(u (u alpha beta w0 s))
(duds (duds alpha beta w0 s))
(sigma (spin (gethash :sigma0 *kshparam*) alpha))
(r (spin sigma u))
(f (funcall (gethash :forcefun *kshparam*) s x))
(ff (*g3 f r u)))
(make-hash
:alpha (dalphads ff w0 s)
:beta (dbetads ff w0 s)
:e (deds f duds sigma u)
:tm (dtmds u)))))
;; Spinor functions
(defun recoverrotor3d (fs es)
"Recover a basis given new and original bases"
(let ((psi (gbc+ (apply #'g+ (mapcar #'*g2 fs (apply #'recipbvs es))) 0 1)))
(if (zerogp psi)
(error "zero psi (180 deg rotation) unsupported")
(unitg psi))))
(defun recoverspinor3d (r fs es)
"Recover a spinor given radius, new basis, and original basis"
(*gs (recoverrotor3d fs es) (sqrt r)))
(defun rvbasis (rv vv)
"Return a set of basis vectors derived from position and velocity"
(let* ((mombv (*o2 rv vv))
(x (unitg rv))
(y (unitg (*i2 rv mombv)))
(z (when (= 3 (dimension rv) (dimension vv))
(*x2 x y))))
(if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
(list x y)
(list x y z))))
(defun rv2spinors (rv vv basis)
"Convert position and velocity vectors to spinor and spinor time derivative"
(let* ((r (norme rv))
(u (recoverspinor3d r (rvbasis rv vv) basis)))
(make-hash
:u u
:dudt (*gs (*g3 vv u (first basis))
(/ 1 2 r)))))
(defun duds2dt (duds u)
"Convert spinor time derivative (also given spinor) to s derivative"
(/gs duds (norme2 u)))
(defun dudt2ds (dudt u)
"Convert spinor s derivative (also given spinor) to t derivative"
(*gs dudt (norme2 u)))
(defun spinor2r (u basis1)
"Given spinor and 1st basis vector, return corresponding position vector"
(spin basis1 u))
(defun spinors2v (dudt u basis1)
"Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
(*gs (*g3 dudt basis1 (revg u)) 2d0))
(defun spinors2energy (u duds mu)
"Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
(/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
;; KSH conversion functions
(defun rv2ksh (rv vv basis mu)
"Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
(with-keys (u dudt) (rv2spinors rv vv basis)
(let* ((duds (dudt2ds dudt u))
(e (spinors2energy u duds mu)))
(make-hash
:alpha u
:beta (/gs duds (sqrt (- (/ e 2))))
:e e
:tm 0))))
(defun ksh2spinors (x s)
"Convert KSH state to spinor & spinor s-derivative"
(with-keys (alpha beta e tm) x
(let ((w0 (w0 e)))
(make-hash
:u (u alpha beta w0 s) ; spinor
:duds (duds alpha beta w0 s))))) ; spinor s-derivative
(defun ksh2rv (x s sigma0)
"Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
(with-keys (alpha beta e tm) x
(with-keys (u duds) (ksh2spinors x s)
(let ((sigma (spin sigma0 alpha)))
(make-hash
:r (spinor2r u sigma) ; position
:v (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
;; Classical orbit elements
(defun coe2rv (sma ecc inc raan aop truan mu basis)
"Convert cassical orbital elements to position & velocity vectors.
SMA semi major axis
ECC eccentricity
INC inclination
RAAN right ascension of ascending node
AOP argument of perigee
TRUAN true anomaly
MU gravitational parameter
BASIS list of 3 orthogonal basis vectors to express position & velocity in"
(let* ((r-raan (rotor (*o2 (first basis) (second basis)) raan))
(basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
(r-inc (rotor (*o2 (second basis-raan) (third basis-raan)) inc))
(basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
(r-aop (rotor (*o2 (first basis-inc) (second basis-inc)) aop))
(basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
(r-truan (rotor (*o2 (first basis-aop) (second basis-aop)) truan))
(basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
(p (* sma (- 1 (* ecc ecc))))
(r (/ p (+ 1 (* ecc (cos truan)))))
(ruv (first basis-truan))
(rv (*gs ruv r))
(angm (sqrt (/ p mu)))
(angmbv (*gs (*o2 (first basis-truan) (second basis-truan)) angm))
(eccuv (first basis-aop))
(eccv (*gs eccuv ecc))
(vv (*gs (*g2 (invv angmbv) (+g eccv ruv))
mu)))
(values (graden rv 1) (graden vv 1))))
;; position & velocity to classical orbit elements
(defun energy-rv (r v mu)
"Orbit energy from position, velocity, & gravitational parameter"
(- (/ (* v v) 2)
(/ mu r)))
(defun sma-rv (r v mu)
"semi-major axis from position, velocity, & gravitational parameter"
(/ mu (* -2 (energy-rv r v mu))))
(defun eccv-rv (rv vv mu)
"eccentricity vector from position, velocity, & gravitational parameter"
(/gs (g2- (*gs rv (- (norme2 vv) (/ mu (norme rv))))
(*gs vv (scalar (*i2 rv vv))))
mu))
(defun mombv-rv (rv vv)
"orbital momentum bivector from position & velocity"
(*o2 rv vv))
(defun nodev-rv (mombv basis)
"ascending node vector from momentum and basis"
(-g (*i2 (third basis) mombv)))
(defun inc-rv (mombv basis)
"inclination from momentum bivector and basis"
(acos (/ (scalar (*i2 (third basis) (dual mombv)))
(norme mombv))))
(defun raan-rv (nodev basis)
"right ascension of ascending node from node vector and basis"
(let ((tmp (acos (scalar (*i2 (first basis) (unitg nodev))))))
(if (< 0 (scalar (*i2 (second basis) nodev)))
(- (* 2 pi) tmp)
tmp)))
(defun aop-rv (nodev eccv basis)
"argument of perigee from node vector, eccentricity vector, and basis"
(let ((tmp (acos (scalar (*i2 (unitg nodev) (unitg eccv))))))
(if (< 0 (scalar (*i2 (third basis) eccv)))
(- (* 2 pi) tmp)
tmp)))
(defun truan-rv (eccv rv vv)
"true anomaly from eccentricity, position, and velocity vectors"
(let ((tmp (acos (scalar (*i2 (unitg eccv) (unitg rv))))))
(if (< 0 (scalar (*i2 rv vv)))
(- (* 2 pi) tmp)
tmp)))
(defun rv2coe (rv vv mu basis)
"Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
(let* ((mombv (mombv-rv rv vv))
(nodev (nodev-rv mombv basis))
(eccv (eccv-rv rv vv mu)))
(make-hash
:sma (sma-rv (norme rv) (norme vv) mu)
:ecc (norme eccv)
:inc (inc-rv mombv basis)
:raan (raan-rv nodev basis)
:aop (aop-rv nodev eccv basis)
:truan (truan eccv rv vv))))
;; Test KSH equations of motion
(defparameter *kshtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
forcefun #'(lambda (s x) (ve3))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1.1)
mu 1
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion")
(defun testksh (data)
(with-keys (s0 sf x0) data
(let ((*kshparam* data))
(rka #'ksheom s0 sf x0))))
+
+(defparameter *kshsailtest*
+ (make-hash*
+ basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
+ sigma0 (first basis)
+ alpha 0
+ delta 0
+ mu 1
+ beta 0.1
+ forcefun #'(lambda (s x)
+ (with-keys (r v) (ksh2rv x s sigma0)
+ (destructuring-bind (posuv tanuv orbuv) (rvbasis r v)
+ (let ((normuv (g+ (*gs posuv (cos alpha))
+ (*gs orbuv (* (sin alpha) (cos delta)))
+ (*gs tanuv (* (sin alpha) (sin delta))))))
+ (*gs normuv
+ (/ (* beta mu (expt (scalar (*i2 posuv normuv)) 2))
+ (norme2 r)))))))
+ r0 (ve3 :c1 1)
+ v0 (ve3 :c10 1)
+ x0 (rv2ksh r0 v0 basis mu)
+ s0 0
+ sf (* pi 2))
+ "Test data for KSH equations of motion with solar sail")
|
bld/bld-dyn
|
63257fee04d17917f0a886c227bb212446da8f3e
|
replaced LETHASH with WITH-KEYS
|
diff --git a/dyn.lisp b/dyn.lisp
index 3d7ac07..5fad240 100755
--- a/dyn.lisp
+++ b/dyn.lisp
@@ -1,242 +1,242 @@
(in-package :bld-dyn)
;; State algebra methods
(defmethod +x2 ((a g) (b g))
(g2+ a b))
(defmethod -x2 ((a g) (b g))
(g2- a b))
(defmethod *xs ((x g) (s number))
(*gs x s))
(defmethod norminfx ((x g))
(norminf x))
;; Cartesian equations of motion
;;(defstate cartx (r v))
;;(defstatemethods cartx (r v))
(defun carteom (tm x)
"Cartesian orbital equations of motion"
- (lethash x (r v)
+ (with-keys (r v) x
(make-hash
:r v
:v (*gs r (/ -1 (expt (norme r) 3))))))
;; Kustaanheimo-Stiefel-Hestenes Equations of Planetary Motion
;;(defstate kshx (alpha beta e tm))
;;(defstatemethods kshx (alpha beta e tm))
(defvar *kshparam* (make-hash :forcefun #'(lambda (s x) 0) :sigma0 (ve3 :c1 1)))
(defun w0 (e)
"Average orbit angular velocity given energy"
(sqrt (- (/ e 2))))
(defun u (alpha beta w0 s)
"Spinor"
(g2+ (*gs alpha (cos (* w0 s)))
(*gs beta (sin (* w0 s)))))
(defun duds (alpha beta w0 s)
"s-derivative of spinor"
(*gs (g2- (*gs beta (cos (* w0 s)))
(*gs alpha (sin (* w0 s))))
w0))
(defun dalphads (ff w0 s)
"s-derivative of alpha"
(*gs ff (- (/ (sin (* w0 s)) w0))))
(defun dbetads (ff w0 s)
"s-derivative of beta"
(*gs ff (/ (cos (* w0 s)) w0)))
(defun deds (f duds sigma u)
"s-derivative of energy"
(scalar (*i2 f (*g3 duds sigma (revg u)))))
(defun dtmds (u)
"s-derivative of time"
(norme2 u))
(defun ksheom (s x)
"KS equations of motion in Hestenes GA form.
Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
- (lethash x (alpha beta e tm) x
+ (with-keys (alpha beta e tm) x
(let* ((w0 (w0 e))
(u (u alpha beta w0 s))
(duds (duds alpha beta w0 s))
(sigma (spin (gethash :sigma0 *kshparam*) alpha))
(r (spin sigma u))
(f (funcall (gethash :forcefun *kshparam*) s x))
(ff (*g3 f r u)))
(make-hash
:alpha (dalphads ff w0 s)
:beta (dbetads ff w0 s)
:e (deds f duds sigma u)
:tm (dtmds u)))))
;; Spinor functions
(defun recoverrotor3d (fs es)
"Recover a basis given new and original bases"
(let ((psi (gbc+ (apply #'g+ (mapcar #'*g2 fs (apply #'recipbvs es))) 0 1)))
(if (zerogp psi)
(error "zero psi (180 deg rotation) unsupported")
(unitg psi))))
(defun recoverspinor3d (r fs es)
"Recover a spinor given radius, new basis, and original basis"
(*gs (recoverrotor3d fs es) (sqrt r)))
(defun rvbasis (rv vv)
"Return a set of basis vectors derived from position and velocity"
(let* ((mombv (*o2 rv vv))
(x (unitg rv))
(y (unitg (*i2 rv mombv)))
(z (when (= 3 (dimension rv) (dimension vv))
(*x2 x y))))
(if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
(list x y)
(list x y z))))
(defun rv2spinors (rv vv basis)
"Convert position and velocity vectors to spinor and spinor time derivative"
(let* ((r (norme rv))
(u (recoverspinor3d r (rvbasis rv vv) basis)))
(make-hash
:u u
:dudt (*gs (*g3 vv u (first basis))
(/ 1 2 r)))))
(defun duds2dt (duds u)
"Convert spinor time derivative (also given spinor) to s derivative"
(/gs duds (norme2 u)))
(defun dudt2ds (dudt u)
"Convert spinor s derivative (also given spinor) to t derivative"
(*gs dudt (norme2 u)))
(defun spinor2r (u basis1)
"Given spinor and 1st basis vector, return corresponding position vector"
(spin basis1 u))
(defun spinors2v (dudt u basis1)
"Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
(*gs (*g3 dudt basis1 (revg u)) 2d0))
(defun spinors2energy (u duds mu)
"Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
(/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
;; KSH conversion functions
(defun rv2ksh (rv vv basis mu)
"Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
- (lethash (rv2spinors rv vv basis) (u dudt)
+ (with-keys (u dudt) (rv2spinors rv vv basis)
(let* ((duds (dudt2ds dudt u))
(e (spinors2energy u duds mu)))
(make-hash
:alpha u
:beta (/gs duds (sqrt (- (/ e 2))))
:e e
:tm 0))))
(defun ksh2spinors (x s)
"Convert KSH state to spinor & spinor s-derivative"
- (lethash x (alpha beta e tm)
+ (with-keys (alpha beta e tm) x
(let ((w0 (w0 e)))
(make-hash
:u (u alpha beta w0 s) ; spinor
:duds (duds alpha beta w0 s))))) ; spinor s-derivative
(defun ksh2rv (x s sigma0)
"Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
- (lethash x (alpha beta e tm)
- (lethash (ksh2spinors x s) (u duds)
+ (with-keys (alpha beta e tm) x
+ (with-keys (u duds) (ksh2spinors x s)
(let ((sigma (spin sigma0 alpha)))
(make-hash
:r (spinor2r u sigma) ; position
:v (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
;; Classical orbit elements
(defun coe2rv (sma ecc inc raan aop truan mu basis)
"Convert cassical orbital elements to position & velocity vectors.
SMA semi major axis
ECC eccentricity
INC inclination
RAAN right ascension of ascending node
AOP argument of perigee
TRUAN true anomaly
MU gravitational parameter
BASIS list of 3 orthogonal basis vectors to express position & velocity in"
(let* ((r-raan (rotor (*o2 (first basis) (second basis)) raan))
(basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
(r-inc (rotor (*o2 (second basis-raan) (third basis-raan)) inc))
(basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
(r-aop (rotor (*o2 (first basis-inc) (second basis-inc)) aop))
(basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
(r-truan (rotor (*o2 (first basis-aop) (second basis-aop)) truan))
(basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
(p (* sma (- 1 (* ecc ecc))))
(r (/ p (+ 1 (* ecc (cos truan)))))
(ruv (first basis-truan))
(rv (*gs ruv r))
(angm (sqrt (/ p mu)))
(angmbv (*gs (*o2 (first basis-truan) (second basis-truan)) angm))
(eccuv (first basis-aop))
(eccv (*gs eccuv ecc))
(vv (*gs (*g2 (invv angmbv) (+g eccv ruv))
mu)))
(values (graden rv 1) (graden vv 1))))
;; position & velocity to classical orbit elements
(defun energy-rv (r v mu)
"Orbit energy from position, velocity, & gravitational parameter"
(- (/ (* v v) 2)
(/ mu r)))
(defun sma-rv (r v mu)
"semi-major axis from position, velocity, & gravitational parameter"
(/ mu (* -2 (energy-rv r v mu))))
(defun eccv-rv (rv vv mu)
"eccentricity vector from position, velocity, & gravitational parameter"
(/gs (g2- (*gs rv (- (norme2 vv) (/ mu (norme rv))))
(*gs vv (scalar (*i2 rv vv))))
mu))
(defun mombv-rv (rv vv)
"orbital momentum bivector from position & velocity"
(*o2 rv vv))
(defun nodev-rv (mombv basis)
"ascending node vector from momentum and basis"
(-g (*i2 (third basis) mombv)))
(defun inc-rv (mombv basis)
"inclination from momentum bivector and basis"
(acos (/ (scalar (*i2 (third basis) (dual mombv)))
(norme mombv))))
(defun raan-rv (nodev basis)
"right ascension of ascending node from node vector and basis"
(let ((tmp (acos (scalar (*i2 (first basis) (unitg nodev))))))
(if (< 0 (scalar (*i2 (second basis) nodev)))
(- (* 2 pi) tmp)
tmp)))
(defun aop-rv (nodev eccv basis)
"argument of perigee from node vector, eccentricity vector, and basis"
(let ((tmp (acos (scalar (*i2 (unitg nodev) (unitg eccv))))))
(if (< 0 (scalar (*i2 (third basis) eccv)))
(- (* 2 pi) tmp)
tmp)))
(defun truan-rv (eccv rv vv)
"true anomaly from eccentricity, position, and velocity vectors"
(let ((tmp (acos (scalar (*i2 (unitg eccv) (unitg rv))))))
(if (< 0 (scalar (*i2 rv vv)))
(- (* 2 pi) tmp)
tmp)))
(defun rv2coe (rv vv mu basis)
"Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
(let* ((mombv (mombv-rv rv vv))
(nodev (nodev-rv mombv basis))
(eccv (eccv-rv rv vv mu)))
(make-hash
:sma (sma-rv (norme rv) (norme vv) mu)
:ecc (norme eccv)
:inc (inc-rv mombv basis)
:raan (raan-rv nodev basis)
:aop (aop-rv nodev eccv basis)
:truan (truan eccv rv vv))))
;; Test KSH equations of motion
(defparameter *kshtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
forcefun #'(lambda (s x) (ve3))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1.1)
mu 1
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion")
(defun testksh (data)
- (lethash data (s0 sf x0)
+ (with-keys (s0 sf x0) data
(let ((*kshparam* data))
(rka #'ksheom s0 sf x0))))
diff --git a/package.lisp b/package.lisp
old mode 100644
new mode 100755
index 82982cf..e025758
--- a/package.lisp
+++ b/package.lisp
@@ -1,3 +1,3 @@
(defpackage :bld-dyn
(:use :cl :bld-ga :bld-e3 :bld-e2 :bld-ode)
- (:import-from :bld-utils :make-hash :make-hash* :lethash))
+ (:import-from :bld-utils :make-hash :make-hash* :with-keys))
|
bld/bld-dyn
|
e63830d3b3f80529ebc5fdfa0e147d730ccd6b78
|
changed use of *g to *g3 or *g2, because they return the correct object types
|
diff --git a/dyn.lisp b/dyn.lisp
index b5195d6..3d7ac07 100755
--- a/dyn.lisp
+++ b/dyn.lisp
@@ -1,242 +1,242 @@
(in-package :bld-dyn)
;; State algebra methods
(defmethod +x2 ((a g) (b g))
(g2+ a b))
(defmethod -x2 ((a g) (b g))
(g2- a b))
(defmethod *xs ((x g) (s number))
(*gs x s))
(defmethod norminfx ((x g))
(norminf x))
;; Cartesian equations of motion
;;(defstate cartx (r v))
;;(defstatemethods cartx (r v))
(defun carteom (tm x)
"Cartesian orbital equations of motion"
(lethash x (r v)
(make-hash
:r v
:v (*gs r (/ -1 (expt (norme r) 3))))))
;; Kustaanheimo-Stiefel-Hestenes Equations of Planetary Motion
;;(defstate kshx (alpha beta e tm))
;;(defstatemethods kshx (alpha beta e tm))
(defvar *kshparam* (make-hash :forcefun #'(lambda (s x) 0) :sigma0 (ve3 :c1 1)))
(defun w0 (e)
"Average orbit angular velocity given energy"
(sqrt (- (/ e 2))))
(defun u (alpha beta w0 s)
"Spinor"
(g2+ (*gs alpha (cos (* w0 s)))
(*gs beta (sin (* w0 s)))))
(defun duds (alpha beta w0 s)
"s-derivative of spinor"
(*gs (g2- (*gs beta (cos (* w0 s)))
(*gs alpha (sin (* w0 s))))
w0))
(defun dalphads (ff w0 s)
"s-derivative of alpha"
(*gs ff (- (/ (sin (* w0 s)) w0))))
(defun dbetads (ff w0 s)
"s-derivative of beta"
(*gs ff (/ (cos (* w0 s)) w0)))
(defun deds (f duds sigma u)
"s-derivative of energy"
- (scalar (*i2 f (*g duds sigma (revg u)))))
+ (scalar (*i2 f (*g3 duds sigma (revg u)))))
(defun dtmds (u)
"s-derivative of time"
(norme2 u))
(defun ksheom (s x)
"KS equations of motion in Hestenes GA form.
Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
(lethash x (alpha beta e tm) x
(let* ((w0 (w0 e))
(u (u alpha beta w0 s))
(duds (duds alpha beta w0 s))
(sigma (spin (gethash :sigma0 *kshparam*) alpha))
(r (spin sigma u))
(f (funcall (gethash :forcefun *kshparam*) s x))
- (ff (*g f r u)))
+ (ff (*g3 f r u)))
(make-hash
:alpha (dalphads ff w0 s)
:beta (dbetads ff w0 s)
:e (deds f duds sigma u)
:tm (dtmds u)))))
;; Spinor functions
(defun recoverrotor3d (fs es)
"Recover a basis given new and original bases"
(let ((psi (gbc+ (apply #'g+ (mapcar #'*g2 fs (apply #'recipbvs es))) 0 1)))
(if (zerogp psi)
(error "zero psi (180 deg rotation) unsupported")
(unitg psi))))
(defun recoverspinor3d (r fs es)
"Recover a spinor given radius, new basis, and original basis"
(*gs (recoverrotor3d fs es) (sqrt r)))
(defun rvbasis (rv vv)
"Return a set of basis vectors derived from position and velocity"
(let* ((mombv (*o2 rv vv))
(x (unitg rv))
(y (unitg (*i2 rv mombv)))
(z (when (= 3 (dimension rv) (dimension vv))
(*x2 x y))))
(if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
(list x y)
(list x y z))))
(defun rv2spinors (rv vv basis)
"Convert position and velocity vectors to spinor and spinor time derivative"
(let* ((r (norme rv))
(u (recoverspinor3d r (rvbasis rv vv) basis)))
(make-hash
:u u
- :dudt (*gs (*g2 (*i2 vv u) (first basis))
+ :dudt (*gs (*g3 vv u (first basis))
(/ 1 2 r)))))
(defun duds2dt (duds u)
"Convert spinor time derivative (also given spinor) to s derivative"
(/gs duds (norme2 u)))
(defun dudt2ds (dudt u)
"Convert spinor s derivative (also given spinor) to t derivative"
(*gs dudt (norme2 u)))
(defun spinor2r (u basis1)
"Given spinor and 1st basis vector, return corresponding position vector"
(spin basis1 u))
(defun spinors2v (dudt u basis1)
"Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
- (*gs (*g dudt basis1 (revg u)) 2d0))
+ (*gs (*g3 dudt basis1 (revg u)) 2d0))
(defun spinors2energy (u duds mu)
"Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
(/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
;; KSH conversion functions
(defun rv2ksh (rv vv basis mu)
"Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
(lethash (rv2spinors rv vv basis) (u dudt)
(let* ((duds (dudt2ds dudt u))
(e (spinors2energy u duds mu)))
(make-hash
:alpha u
:beta (/gs duds (sqrt (- (/ e 2))))
:e e
:tm 0))))
(defun ksh2spinors (x s)
"Convert KSH state to spinor & spinor s-derivative"
(lethash x (alpha beta e tm)
(let ((w0 (w0 e)))
(make-hash
:u (u alpha beta w0 s) ; spinor
:duds (duds alpha beta w0 s))))) ; spinor s-derivative
(defun ksh2rv (x s sigma0)
"Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
(lethash x (alpha beta e tm)
(lethash (ksh2spinors x s) (u duds)
(let ((sigma (spin sigma0 alpha)))
(make-hash
:r (spinor2r u sigma) ; position
:v (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
;; Classical orbit elements
(defun coe2rv (sma ecc inc raan aop truan mu basis)
"Convert cassical orbital elements to position & velocity vectors.
SMA semi major axis
ECC eccentricity
INC inclination
RAAN right ascension of ascending node
AOP argument of perigee
TRUAN true anomaly
MU gravitational parameter
BASIS list of 3 orthogonal basis vectors to express position & velocity in"
(let* ((r-raan (rotor (*o2 (first basis) (second basis)) raan))
(basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
(r-inc (rotor (*o2 (second basis-raan) (third basis-raan)) inc))
(basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
(r-aop (rotor (*o2 (first basis-inc) (second basis-inc)) aop))
(basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
(r-truan (rotor (*o2 (first basis-aop) (second basis-aop)) truan))
(basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
(p (* sma (- 1 (* ecc ecc))))
(r (/ p (+ 1 (* ecc (cos truan)))))
(ruv (first basis-truan))
(rv (*gs ruv r))
(angm (sqrt (/ p mu)))
(angmbv (*gs (*o2 (first basis-truan) (second basis-truan)) angm))
(eccuv (first basis-aop))
(eccv (*gs eccuv ecc))
- (vv (*gs (*g (invv angmbv) (+g eccv ruv))
+ (vv (*gs (*g2 (invv angmbv) (+g eccv ruv))
mu)))
(values (graden rv 1) (graden vv 1))))
;; position & velocity to classical orbit elements
(defun energy-rv (r v mu)
"Orbit energy from position, velocity, & gravitational parameter"
(- (/ (* v v) 2)
(/ mu r)))
(defun sma-rv (r v mu)
"semi-major axis from position, velocity, & gravitational parameter"
(/ mu (* -2 (energy-rv r v mu))))
(defun eccv-rv (rv vv mu)
"eccentricity vector from position, velocity, & gravitational parameter"
(/gs (g2- (*gs rv (- (norme2 vv) (/ mu (norme rv))))
(*gs vv (scalar (*i2 rv vv))))
mu))
(defun mombv-rv (rv vv)
"orbital momentum bivector from position & velocity"
(*o2 rv vv))
(defun nodev-rv (mombv basis)
"ascending node vector from momentum and basis"
(-g (*i2 (third basis) mombv)))
(defun inc-rv (mombv basis)
"inclination from momentum bivector and basis"
(acos (/ (scalar (*i2 (third basis) (dual mombv)))
(norme mombv))))
(defun raan-rv (nodev basis)
"right ascension of ascending node from node vector and basis"
(let ((tmp (acos (scalar (*i2 (first basis) (unitg nodev))))))
(if (< 0 (scalar (*i2 (second basis) nodev)))
(- (* 2 pi) tmp)
tmp)))
(defun aop-rv (nodev eccv basis)
"argument of perigee from node vector, eccentricity vector, and basis"
(let ((tmp (acos (scalar (*i2 (unitg nodev) (unitg eccv))))))
(if (< 0 (scalar (*i2 (third basis) eccv)))
(- (* 2 pi) tmp)
tmp)))
(defun truan-rv (eccv rv vv)
"true anomaly from eccentricity, position, and velocity vectors"
(let ((tmp (acos (scalar (*i2 (unitg eccv) (unitg rv))))))
(if (< 0 (scalar (*i2 rv vv)))
(- (* 2 pi) tmp)
tmp)))
(defun rv2coe (rv vv mu basis)
"Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
(let* ((mombv (mombv-rv rv vv))
(nodev (nodev-rv mombv basis))
(eccv (eccv-rv rv vv mu)))
(make-hash
:sma (sma-rv (norme rv) (norme vv) mu)
:ecc (norme eccv)
:inc (inc-rv mombv basis)
:raan (raan-rv nodev basis)
:aop (aop-rv nodev eccv basis)
:truan (truan eccv rv vv))))
;; Test KSH equations of motion
(defparameter *kshtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
forcefun #'(lambda (s x) (ve3))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1.1)
mu 1
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion")
(defun testksh (data)
(lethash data (s0 sf x0)
(let ((*kshparam* data))
(rka #'ksheom s0 sf x0))))
|
bld/bld-dyn
|
112b944e2e97846a07cf616e36dd14f7fc3039ee
|
changing email address
|
diff --git a/dyn.lisp b/dyn.lisp
old mode 100644
new mode 100755
index 8151ea5..b5195d6
--- a/dyn.lisp
+++ b/dyn.lisp
@@ -1,242 +1,242 @@
(in-package :bld-dyn)
;; State algebra methods
(defmethod +x2 ((a g) (b g))
(g2+ a b))
(defmethod -x2 ((a g) (b g))
(g2- a b))
(defmethod *xs ((x g) (s number))
(*gs x s))
(defmethod norminfx ((x g))
(norminf x))
;; Cartesian equations of motion
;;(defstate cartx (r v))
;;(defstatemethods cartx (r v))
(defun carteom (tm x)
"Cartesian orbital equations of motion"
(lethash x (r v)
(make-hash
:r v
:v (*gs r (/ -1 (expt (norme r) 3))))))
;; Kustaanheimo-Stiefel-Hestenes Equations of Planetary Motion
;;(defstate kshx (alpha beta e tm))
;;(defstatemethods kshx (alpha beta e tm))
(defvar *kshparam* (make-hash :forcefun #'(lambda (s x) 0) :sigma0 (ve3 :c1 1)))
(defun w0 (e)
"Average orbit angular velocity given energy"
(sqrt (- (/ e 2))))
(defun u (alpha beta w0 s)
"Spinor"
(g2+ (*gs alpha (cos (* w0 s)))
(*gs beta (sin (* w0 s)))))
(defun duds (alpha beta w0 s)
"s-derivative of spinor"
(*gs (g2- (*gs beta (cos (* w0 s)))
(*gs alpha (sin (* w0 s))))
w0))
(defun dalphads (ff w0 s)
"s-derivative of alpha"
(*gs ff (- (/ (sin (* w0 s)) w0))))
(defun dbetads (ff w0 s)
"s-derivative of beta"
(*gs ff (/ (cos (* w0 s)) w0)))
(defun deds (f duds sigma u)
"s-derivative of energy"
(scalar (*i2 f (*g duds sigma (revg u)))))
(defun dtmds (u)
"s-derivative of time"
(norme2 u))
(defun ksheom (s x)
"KS equations of motion in Hestenes GA form.
Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
(lethash x (alpha beta e tm) x
(let* ((w0 (w0 e))
(u (u alpha beta w0 s))
(duds (duds alpha beta w0 s))
(sigma (spin (gethash :sigma0 *kshparam*) alpha))
(r (spin sigma u))
(f (funcall (gethash :forcefun *kshparam*) s x))
(ff (*g f r u)))
(make-hash
:alpha (dalphads ff w0 s)
:beta (dbetads ff w0 s)
:e (deds f duds sigma u)
:tm (dtmds u)))))
;; Spinor functions
(defun recoverrotor3d (fs es)
"Recover a basis given new and original bases"
(let ((psi (gbc+ (apply #'g+ (mapcar #'*g2 fs (apply #'recipbvs es))) 0 1)))
(if (zerogp psi)
(error "zero psi (180 deg rotation) unsupported")
(unitg psi))))
(defun recoverspinor3d (r fs es)
"Recover a spinor given radius, new basis, and original basis"
(*gs (recoverrotor3d fs es) (sqrt r)))
(defun rvbasis (rv vv)
"Return a set of basis vectors derived from position and velocity"
(let* ((mombv (*o2 rv vv))
(x (unitg rv))
(y (unitg (*i2 rv mombv)))
(z (when (= 3 (dimension rv) (dimension vv))
(*x2 x y))))
(if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
(list x y)
(list x y z))))
(defun rv2spinors (rv vv basis)
"Convert position and velocity vectors to spinor and spinor time derivative"
(let* ((r (norme rv))
(u (recoverspinor3d r (rvbasis rv vv) basis)))
- (values
- u
- (*gs (*g2 (*i2 vv u) (first basis))
- (/ 1 2 r)))))
+ (make-hash
+ :u u
+ :dudt (*gs (*g2 (*i2 vv u) (first basis))
+ (/ 1 2 r)))))
(defun duds2dt (duds u)
"Convert spinor time derivative (also given spinor) to s derivative"
(/gs duds (norme2 u)))
(defun dudt2ds (dudt u)
"Convert spinor s derivative (also given spinor) to t derivative"
(*gs dudt (norme2 u)))
(defun spinor2r (u basis1)
"Given spinor and 1st basis vector, return corresponding position vector"
(spin basis1 u))
(defun spinors2v (dudt u basis1)
"Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
(*gs (*g dudt basis1 (revg u)) 2d0))
(defun spinors2energy (u duds mu)
"Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
(/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
;; KSH conversion functions
(defun rv2ksh (rv vv basis mu)
"Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
- (multiple-value-bind (u dudt) (rv2spinors rv vv basis)
+ (lethash (rv2spinors rv vv basis) (u dudt)
(let* ((duds (dudt2ds dudt u))
(e (spinors2energy u duds mu)))
(make-hash
:alpha u
:beta (/gs duds (sqrt (- (/ e 2))))
:e e
:tm 0))))
(defun ksh2spinors (x s)
"Convert KSH state to spinor & spinor s-derivative"
- (with-slots (alpha beta e tm) x
+ (lethash x (alpha beta e tm)
(let ((w0 (w0 e)))
- (values
- (u alpha beta w0 s) ; spinor
- (duds alpha beta w0 s))))) ; spinor s-derivative
+ (make-hash
+ :u (u alpha beta w0 s) ; spinor
+ :duds (duds alpha beta w0 s))))) ; spinor s-derivative
(defun ksh2rv (x s sigma0)
"Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
- (with-slots (alpha beta e tm) x
- (multiple-value-bind (u duds) (ksh2spinors x s)
+ (lethash x (alpha beta e tm)
+ (lethash (ksh2spinors x s) (u duds)
(let ((sigma (spin sigma0 alpha)))
- (values
- (spinor2r u sigma) ; position
- (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
+ (make-hash
+ :r (spinor2r u sigma) ; position
+ :v (spinors2v (duds2dt duds u) u sigma)))))) ; velocity
;; Classical orbit elements
(defun coe2rv (sma ecc inc raan aop truan mu basis)
"Convert cassical orbital elements to position & velocity vectors.
SMA semi major axis
ECC eccentricity
INC inclination
RAAN right ascension of ascending node
AOP argument of perigee
TRUAN true anomaly
MU gravitational parameter
BASIS list of 3 orthogonal basis vectors to express position & velocity in"
(let* ((r-raan (rotor (*o2 (first basis) (second basis)) raan))
(basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
(r-inc (rotor (*o2 (second basis-raan) (third basis-raan)) inc))
(basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
(r-aop (rotor (*o2 (first basis-inc) (second basis-inc)) aop))
(basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
(r-truan (rotor (*o2 (first basis-aop) (second basis-aop)) truan))
(basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
(p (* sma (- 1 (* ecc ecc))))
(r (/ p (+ 1 (* ecc (cos truan)))))
(ruv (first basis-truan))
(rv (*gs ruv r))
(angm (sqrt (/ p mu)))
(angmbv (*gs (*o2 (first basis-truan) (second basis-truan)) angm))
(eccuv (first basis-aop))
(eccv (*gs eccuv ecc))
(vv (*gs (*g (invv angmbv) (+g eccv ruv))
mu)))
(values (graden rv 1) (graden vv 1))))
;; position & velocity to classical orbit elements
(defun energy-rv (r v mu)
"Orbit energy from position, velocity, & gravitational parameter"
(- (/ (* v v) 2)
(/ mu r)))
(defun sma-rv (r v mu)
"semi-major axis from position, velocity, & gravitational parameter"
(/ mu (* -2 (energy-rv r v mu))))
(defun eccv-rv (rv vv mu)
"eccentricity vector from position, velocity, & gravitational parameter"
(/gs (g2- (*gs rv (- (norme2 vv) (/ mu (norme rv))))
(*gs vv (scalar (*i2 rv vv))))
mu))
(defun mombv-rv (rv vv)
"orbital momentum bivector from position & velocity"
(*o2 rv vv))
(defun nodev-rv (mombv basis)
"ascending node vector from momentum and basis"
(-g (*i2 (third basis) mombv)))
(defun inc-rv (mombv basis)
"inclination from momentum bivector and basis"
(acos (/ (scalar (*i2 (third basis) (dual mombv)))
(norme mombv))))
(defun raan-rv (nodev basis)
"right ascension of ascending node from node vector and basis"
(let ((tmp (acos (scalar (*i2 (first basis) (unitg nodev))))))
(if (< 0 (scalar (*i2 (second basis) nodev)))
(- (* 2 pi) tmp)
tmp)))
(defun aop-rv (nodev eccv basis)
"argument of perigee from node vector, eccentricity vector, and basis"
(let ((tmp (acos (scalar (*i2 (unitg nodev) (unitg eccv))))))
(if (< 0 (scalar (*i2 (third basis) eccv)))
(- (* 2 pi) tmp)
tmp)))
(defun truan-rv (eccv rv vv)
"true anomaly from eccentricity, position, and velocity vectors"
(let ((tmp (acos (scalar (*i2 (unitg eccv) (unitg rv))))))
(if (< 0 (scalar (*i2 rv vv)))
(- (* 2 pi) tmp)
tmp)))
(defun rv2coe (rv vv mu basis)
"Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
(let* ((mombv (mombv-rv rv vv))
(nodev (nodev-rv mombv basis))
(eccv (eccv-rv rv vv mu)))
(make-hash
:sma (sma-rv (norme rv) (norme vv) mu)
:ecc (norme eccv)
:inc (inc-rv mombv basis)
:raan (raan-rv nodev basis)
:aop (aop-rv nodev eccv basis)
:truan (truan eccv rv vv))))
;; Test KSH equations of motion
(defparameter *kshtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
forcefun #'(lambda (s x) (ve3))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1.1)
mu 1
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion")
(defun testksh (data)
(lethash data (s0 sf x0)
(let ((*kshparam* data))
(rka #'ksheom s0 sf x0))))
|
bld/bld-dyn
|
3ce972f0373a6f7b69dd212a32bbf0f58feabbde
|
changed class-states to hash-table states
|
diff --git a/dyn.lisp b/dyn.lisp
index 595f926..8151ea5 100644
--- a/dyn.lisp
+++ b/dyn.lisp
@@ -1,244 +1,242 @@
(in-package :bld-dyn)
;; State algebra methods
(defmethod +x2 ((a g) (b g))
(g2+ a b))
(defmethod -x2 ((a g) (b g))
(g2- a b))
(defmethod *xs ((x g) (s number))
(*gs x s))
(defmethod norminfx ((x g))
(norminf x))
;; Cartesian equations of motion
-(defstate cartx (r v))
-(defstatemethods cartx (r v))
+;;(defstate cartx (r v))
+;;(defstatemethods cartx (r v))
(defun carteom (tm x)
"Cartesian orbital equations of motion"
- (with-slots (r v) x
- (make-instance
- 'cartx
+ (lethash x (r v)
+ (make-hash
:r v
:v (*gs r (/ -1 (expt (norme r) 3))))))
;; Kustaanheimo-Stiefel-Hestenes Equations of Planetary Motion
-(defstate kshx (alpha beta e tm))
-(defstatemethods kshx (alpha beta e tm))
+;;(defstate kshx (alpha beta e tm))
+;;(defstatemethods kshx (alpha beta e tm))
(defvar *kshparam* (make-hash :forcefun #'(lambda (s x) 0) :sigma0 (ve3 :c1 1)))
(defun w0 (e)
"Average orbit angular velocity given energy"
(sqrt (- (/ e 2))))
(defun u (alpha beta w0 s)
"Spinor"
(g2+ (*gs alpha (cos (* w0 s)))
(*gs beta (sin (* w0 s)))))
(defun duds (alpha beta w0 s)
"s-derivative of spinor"
(*gs (g2- (*gs beta (cos (* w0 s)))
(*gs alpha (sin (* w0 s))))
w0))
(defun dalphads (ff w0 s)
"s-derivative of alpha"
(*gs ff (- (/ (sin (* w0 s)) w0))))
(defun dbetads (ff w0 s)
"s-derivative of beta"
(*gs ff (/ (cos (* w0 s)) w0)))
(defun deds (f duds sigma u)
"s-derivative of energy"
(scalar (*i2 f (*g duds sigma (revg u)))))
(defun dtmds (u)
"s-derivative of time"
(norme2 u))
(defun ksheom (s x)
"KS equations of motion in Hestenes GA form.
Orbit elements are: alpha (U0), beta (dU0/ds/w0), e (orbit energy), tm (time)
Expects a variable *data* containing sigma0 (initial orbit frame vector) and forcefun (force function of s, x, and *data*)"
- (with-slots (alpha beta e tm) x
+ (lethash x (alpha beta e tm) x
(let* ((w0 (w0 e))
(u (u alpha beta w0 s))
(duds (duds alpha beta w0 s))
(sigma (spin (gethash :sigma0 *kshparam*) alpha))
(r (spin sigma u))
(f (funcall (gethash :forcefun *kshparam*) s x))
(ff (*g f r u)))
- (make-instance
- 'kshx
+ (make-hash
:alpha (dalphads ff w0 s)
:beta (dbetads ff w0 s)
:e (deds f duds sigma u)
:tm (dtmds u)))))
;; Spinor functions
(defun recoverrotor3d (fs es)
"Recover a basis given new and original bases"
- (let ((psi (gbc+ (apply #'+g (mapcar #'*g2 fs (recipbvs es))) 0 1)))
+ (let ((psi (gbc+ (apply #'g+ (mapcar #'*g2 fs (apply #'recipbvs es))) 0 1)))
(if (zerogp psi)
(error "zero psi (180 deg rotation) unsupported")
(unitg psi))))
(defun recoverspinor3d (r fs es)
"Recover a spinor given radius, new basis, and original basis"
(*gs (recoverrotor3d fs es) (sqrt r)))
(defun rvbasis (rv vv)
"Return a set of basis vectors derived from position and velocity"
(let* ((mombv (*o2 rv vv))
(x (unitg rv))
- (y (unitg (*g2 rv mombv)))
+ (y (unitg (*i2 rv mombv)))
(z (when (= 3 (dimension rv) (dimension vv))
(*x2 x y))))
(if (= 2 (dimension rv) (dimension vv)) ; 2D or 3D?
(list x y)
(list x y z))))
(defun rv2spinors (rv vv basis)
"Convert position and velocity vectors to spinor and spinor time derivative"
(let* ((r (norme rv))
(u (recoverspinor3d r (rvbasis rv vv) basis)))
(values
u
- (*gs (*g vv u (first basis))
+ (*gs (*g2 (*i2 vv u) (first basis))
(/ 1 2 r)))))
(defun duds2dt (duds u)
"Convert spinor time derivative (also given spinor) to s derivative"
(/gs duds (norme2 u)))
(defun dudt2ds (dudt u)
"Convert spinor s derivative (also given spinor) to t derivative"
(*gs dudt (norme2 u)))
(defun spinor2r (u basis1)
"Given spinor and 1st basis vector, return corresponding position vector"
(spin basis1 u))
(defun spinors2v (dudt u basis1)
"Given spinor time derivative, spinor, and 1st basis vector, return corresponding velocity vector"
(*gs (*g dudt basis1 (revg u)) 2d0))
(defun spinors2energy (u duds mu)
"Given spinor, spinor s-derivative, and gravitational parameter, return orbit energy"
(/ (- (* 2 (norme2 duds)) mu) (norme2 u)))
;; KSH conversion functions
(defun rv2ksh (rv vv basis mu)
"Given position, velocity, list of basis vectors, and gravitational parameter, return KSH state initialized as time=0 and s=0"
(multiple-value-bind (u dudt) (rv2spinors rv vv basis)
(let* ((duds (dudt2ds dudt u))
(e (spinors2energy u duds mu)))
- (make-instance
- 'kshx
+ (make-hash
:alpha u
:beta (/gs duds (sqrt (- (/ e 2))))
:e e
:tm 0))))
(defun ksh2spinors (x s)
"Convert KSH state to spinor & spinor s-derivative"
(with-slots (alpha beta e tm) x
(let ((w0 (w0 e)))
(values
(u alpha beta w0 s) ; spinor
(duds alpha beta w0 s))))) ; spinor s-derivative
(defun ksh2rv (x s sigma0)
"Calculate position & velocity vectors from KSH state, s, and initial orbit position unit vector (sigma0)"
(with-slots (alpha beta e tm) x
(multiple-value-bind (u duds) (ksh2spinors x s)
(let ((sigma (spin sigma0 alpha)))
(values
(spinor2r u sigma) ; position
(spinors2v (duds2dt duds u) u sigma)))))) ; velocity
;; Classical orbit elements
(defun coe2rv (sma ecc inc raan aop truan mu basis)
"Convert cassical orbital elements to position & velocity vectors.
SMA semi major axis
ECC eccentricity
INC inclination
RAAN right ascension of ascending node
AOP argument of perigee
TRUAN true anomaly
MU gravitational parameter
BASIS list of 3 orthogonal basis vectors to express position & velocity in"
(let* ((r-raan (rotor (*o2 (first basis) (second basis)) raan))
(basis-raan (mapcar #'(lambda (x) (rot x r-raan)) basis))
(r-inc (rotor (*o2 (second basis-raan) (third basis-raan)) inc))
(basis-inc (mapcar #'(lambda (x) (rot x r-inc)) basis-raan))
(r-aop (rotor (*o2 (first basis-inc) (second basis-inc)) aop))
(basis-aop (mapcar #'(lambda (x) (rot x r-aop)) basis-inc))
(r-truan (rotor (*o2 (first basis-aop) (second basis-aop)) truan))
(basis-truan (mapcar #'(lambda (x) (rot x r-truan)) basis-aop))
(p (* sma (- 1 (* ecc ecc))))
(r (/ p (+ 1 (* ecc (cos truan)))))
(ruv (first basis-truan))
(rv (*gs ruv r))
(angm (sqrt (/ p mu)))
(angmbv (*gs (*o2 (first basis-truan) (second basis-truan)) angm))
(eccuv (first basis-aop))
(eccv (*gs eccuv ecc))
(vv (*gs (*g (invv angmbv) (+g eccv ruv))
mu)))
(values (graden rv 1) (graden vv 1))))
;; position & velocity to classical orbit elements
(defun energy-rv (r v mu)
"Orbit energy from position, velocity, & gravitational parameter"
(- (/ (* v v) 2)
(/ mu r)))
(defun sma-rv (r v mu)
"semi-major axis from position, velocity, & gravitational parameter"
(/ mu (* -2 (energy-rv r v mu))))
(defun eccv-rv (rv vv mu)
"eccentricity vector from position, velocity, & gravitational parameter"
- (/gs (-g (*gs rv (- (norme2 vv) (/ mu (norme rv))))
- (*gs vv (scalar (*i2 rv vv))))
+ (/gs (g2- (*gs rv (- (norme2 vv) (/ mu (norme rv))))
+ (*gs vv (scalar (*i2 rv vv))))
mu))
(defun mombv-rv (rv vv)
"orbital momentum bivector from position & velocity"
(*o2 rv vv))
(defun nodev-rv (mombv basis)
"ascending node vector from momentum and basis"
(-g (*i2 (third basis) mombv)))
(defun inc-rv (mombv basis)
"inclination from momentum bivector and basis"
(acos (/ (scalar (*i2 (third basis) (dual mombv)))
(norme mombv))))
(defun raan-rv (nodev basis)
"right ascension of ascending node from node vector and basis"
(let ((tmp (acos (scalar (*i2 (first basis) (unitg nodev))))))
(if (< 0 (scalar (*i2 (second basis) nodev)))
(- (* 2 pi) tmp)
tmp)))
(defun aop-rv (nodev eccv basis)
"argument of perigee from node vector, eccentricity vector, and basis"
(let ((tmp (acos (scalar (*i2 (unitg nodev) (unitg eccv))))))
(if (< 0 (scalar (*i2 (third basis) eccv)))
(- (* 2 pi) tmp)
tmp)))
(defun truan-rv (eccv rv vv)
"true anomaly from eccentricity, position, and velocity vectors"
(let ((tmp (acos (scalar (*i2 (unitg eccv) (unitg rv))))))
(if (< 0 (scalar (*i2 rv vv)))
(- (* 2 pi) tmp)
tmp)))
(defun rv2coe (rv vv mu basis)
"Return classical orbital elements given position & velocity vectors, gravitational parameter, and a list of 3 basis vectors"
(let* ((mombv (mombv-rv rv vv))
(nodev (nodev-rv mombv basis))
(eccv (eccv-rv rv vv mu)))
(make-hash
:sma (sma-rv (norme rv) (norme vv) mu)
:ecc (norme eccv)
:inc (inc-rv mombv basis)
:raan (raan-rv nodev basis)
:aop (aop-rv nodev eccv basis)
:truan (truan eccv rv vv))))
;; Test KSH equations of motion
(defparameter *kshtest*
(make-hash*
basis (list (ve3 :c1 1) (ve3 :c10 1) (ve3 :c100 1))
sigma0 (first basis)
forcefun #'(lambda (s x) (ve3))
r0 (ve3 :c1 1)
v0 (ve3 :c10 1.1)
mu 1
x0 (rv2ksh r0 v0 basis mu)
s0 0
sf (* pi 2))
"Test data for KSH equations of motion")
(defun testksh (data)
(lethash data (s0 sf x0)
- (rka #'ksheom s0 sf x0)))
+ (let ((*kshparam* data))
+ (rka #'ksheom s0 sf x0))))
|
svenfuchs/rack-cache-tags
|
21fcf3aaa2711288bf853b310ea4d3d418a50288
|
add gemfile and fix gemspec dependencies
|
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..677c465
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.bundle
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..e45e65f
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,2 @@
+source :rubygems
+gemspec
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 0000000..221d737
--- /dev/null
+++ b/Gemfile.lock
@@ -0,0 +1,44 @@
+PATH
+ remote: .
+ specs:
+ rack-cache-tags (0.0.6)
+ rack-cache-purge
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activemodel (3.0.0)
+ activesupport (= 3.0.0)
+ builder (~> 2.1.2)
+ i18n (~> 0.4.1)
+ activerecord (3.0.0)
+ activemodel (= 3.0.0)
+ activesupport (= 3.0.0)
+ arel (~> 1.0.0)
+ tzinfo (~> 0.3.23)
+ activesupport (3.0.0)
+ arel (1.0.1)
+ activesupport (~> 3.0.0)
+ builder (2.1.2)
+ database_cleaner (0.5.2)
+ i18n (0.4.1)
+ rack (1.2.1)
+ rack-cache (0.5.3)
+ rack (>= 0.4)
+ rack-cache-purge (0.0.2)
+ rack-cache (~> 0.5)
+ sqlite3-ruby (1.3.1)
+ test_declarative (0.0.4)
+ tzinfo (0.3.23)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activerecord
+ database_cleaner
+ rack
+ rack-cache-purge
+ rack-cache-tags!
+ sqlite3-ruby
+ test_declarative
diff --git a/rack-cache-tags.gemspec b/rack-cache-tags.gemspec
index c77b200..55a124f 100644
--- a/rack-cache-tags.gemspec
+++ b/rack-cache-tags.gemspec
@@ -1,19 +1,27 @@
# encoding: utf-8
$:.unshift File.expand_path('../lib', __FILE__)
require 'rack_cache_tags/version'
Gem::Specification.new do |s|
s.name = "rack-cache-tags"
s.version = RackCacheTags::VERSION
s.authors = ["Sven Fuchs"]
s.email = "svenfuchs@artweb-design.de"
s.homepage = "http://github.com/svenfuchs/rack-cache-tags"
s.summary = "[summary]"
s.description = "[description]"
s.files = Dir.glob("lib/**/**")
s.platform = Gem::Platform::RUBY
s.require_path = 'lib'
s.rubyforge_project = '[none]'
+
+ s.add_dependency 'rack-cache-purge'
+
+ s.add_development_dependency 'test_declarative'
+ s.add_development_dependency 'rack'
+ s.add_development_dependency 'activerecord'
+ s.add_development_dependency 'sqlite3-ruby'
+ s.add_development_dependency 'database_cleaner'
end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index c2254fa..23f5bd6 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,58 +1,59 @@
$:.unshift File.expand_path('../../lib', __FILE__)
require 'rubygems'
require 'test/unit'
-require 'test_declarative'
require 'fileutils'
-require 'active_record'
require 'logger'
+require 'bundler/setup'
+
+require 'test_declarative'
+require 'active_record'
require 'rack/mock'
require 'database_cleaner'
-
require 'rack_cache_tags'
log = '/tmp/rack_cache_tags.log'
FileUtils.touch(log) unless File.exists?(log)
ActiveRecord::Base.logger = Logger.new(log)
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
ActiveRecord::Migration.verbose = false
ActiveRecord::Schema.define :version => 0 do
create_table :cache_taggings, :force => true do |t|
t.string :url
t.string :tag
end
end
DatabaseCleaner.strategy = :truncation
class Test::Unit::TestCase
include Rack::Cache::Tags::Store
def setup
DatabaseCleaner.start
end
def teardown
DatabaseCleaner.clean
end
attr_reader :app
def create_tags(url, tags)
tags.each { |tag| ActiveRecord::Tagging.create!(:url => url, :tag => tag) }
end
def respond_with(status, headers, body)
@app = Rack::Cache::Tags.new(lambda { |env| [200, headers, ''] })
end
def get(url)
app.call(env_for(url))
end
def env_for(*args)
Rack::MockRequest.env_for(*args)
end
end
|
svenfuchs/rack-cache-tags
|
2a5a8c6e0a71abbbbb4fa0ff30045ba203aceb85
|
Bump to 0.0.6
|
diff --git a/lib/rack_cache_tags/version.rb b/lib/rack_cache_tags/version.rb
index 4543eab..948e95e 100644
--- a/lib/rack_cache_tags/version.rb
+++ b/lib/rack_cache_tags/version.rb
@@ -1,3 +1,3 @@
module RackCacheTags
- VERSION = "0.0.5"
+ VERSION = "0.0.6"
end
\ No newline at end of file
|
svenfuchs/rack-cache-tags
|
30cb0d212836aef2e5b942b6de0ebe7573a2b6c0
|
use less queries for storing taggings
|
diff --git a/lib/rack/cache/tags/store/active_record.rb b/lib/rack/cache/tags/store/active_record.rb
index 31416a9..4fe6c2e 100644
--- a/lib/rack/cache/tags/store/active_record.rb
+++ b/lib/rack/cache/tags/store/active_record.rb
@@ -1,32 +1,37 @@
require 'active_record'
module Rack
module Cache
class Tags
module Store
class ActiveRecord
class Tagging < ::ActiveRecord::Base
set_table_name 'cache_taggings'
end
def store(url, tags)
- tags.each { |tag| Tagging.find_or_create_by_url_and_tag(url, tag) }
+ tags -= taggings_by_url_and_tags(url, tags).map(&:tag)
+ tags.each { |tag| Tagging.create(:url => url, :tag => tag) }
end
def purge(tags)
urls_by_tags(tags).tap { |urls| Tagging.where(:url => urls).delete_all }
end
def urls_by_tags(tags)
taggings_by_tags(tags).map(&:url).uniq
end
def taggings_by_tags(tags)
sql = "tag IN (?) #{[' OR tag LIKE ?'] * tags.size}"
Tagging.where(sql, tags, *tags.map { |tag| "#{tag.split(':').first}%" })
end
+
+ def taggings_by_url_and_tags(url, tags)
+ Tagging.where("url = ? AND tag IN (?)", url, tags)
+ end
end
end
end
end
end
diff --git a/test/tags_test.rb b/test/tags_test.rb
index fe2d8f4..6747f24 100644
--- a/test/tags_test.rb
+++ b/test/tags_test.rb
@@ -1,45 +1,61 @@
require File.expand_path('../test_helper', __FILE__)
class TagsTest < Test::Unit::TestCase
include Rack::Cache::Tags::Store
attr_reader :store
def setup
@store = Rack::Cache::Tags::Store::ActiveRecord.new
end
+ def create_taggings(taggings)
+ taggings.each { |url, tags| tags.each { |tag| create_tagging(url, tag) } }
+ end
+
+ def create_tagging(url, tag)
+ ActiveRecord::Tagging.create!(:url => url, :tag => tag)
+ end
+
test 'stores tags for the current url' do
+ create_taggings('http://example.com/' => %w(bar-2), 'http://example.com/bar' => %w(bar-2))
respond_with 200, { Rack::Cache::Tags::TAGS_HEADER => %w(foo-1 bar-2) }, ''
-
get('http://example.com/')
- actual = ActiveRecord::Tagging.all.map { |tagging| [tagging.url, tagging.tag] }
- assert_equal [%W(http://example.com/ foo-1), %W(http://example.com/ bar-2)], actual
+
+ actual = ActiveRecord::Tagging.all.map { |tagging| [tagging.url, tagging.tag] }
+ expected = [%W(http://example.com/ foo-1), %W(http://example.com/ bar-2), %W(http://example.com/bar bar-2)]
+ assert_equal expected.sort, actual.sort
end
test 'expands tags to urls for purge headers and deletes the tagging' do
create_tags('http://example.com/foo', %w(foo-1 foo-2))
create_tags('http://example.com/bar', %w(foo-1))
create_tags('http://example.com/baz', %w(baz-1))
respond_with 200, { Rack::Cache::Tags::PURGE_TAGS_HEADER => %w(foo-1) }, ''
status, headers, body = get('http://example.com')
actual = ActiveRecord::Tagging.all.map { |tagging| [tagging.url, tagging.tag] }
assert_equal [%w(http://example.com/baz baz-1)], actual
assert_equal %w(http://example.com/foo http://example.com/bar), headers[Rack::Cache::Purge::PURGE_HEADER]
end
test 'active_record store finds tags w/o methods' do
tags = %w(foo-1 foo-2)
create_tags('http://example.com/foo', tags)
assert_equal tags, store.taggings_by_tags(tags).map(&:tag)
end
test 'active_record store finds tags w/ methods' do
tags = %w(foo-1:title foo-1:body)
create_tags('http://example.com/foo', tags)
assert_equal tags, store.taggings_by_tags(%w(foo-1)).map(&:tag)
end
+
+ test 'taggings_by_url_and_tags' do
+ create_taggings('/foo' => %w(tag-1 tag-2), '/bar' => %w(tag-1))
+ taggings = store.taggings_by_url_and_tags('/foo', %w(tag-1 tag-3))
+ assert_equal [['/foo', 'tag-1']], taggings.map { |tagging| [tagging.url, tagging.tag] }
+ end
end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index bd5083e..c2254fa 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,59 +1,58 @@
$:.unshift File.expand_path('../../lib', __FILE__)
require 'rubygems'
require 'test/unit'
require 'test_declarative'
require 'fileutils'
require 'active_record'
require 'logger'
require 'rack/mock'
require 'database_cleaner'
require 'rack_cache_tags'
log = '/tmp/rack_cache_tags.log'
FileUtils.touch(log) unless File.exists?(log)
ActiveRecord::Base.logger = Logger.new(log)
-ActiveRecord::LogSubscriber.attach_to(:active_record)
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
ActiveRecord::Migration.verbose = false
ActiveRecord::Schema.define :version => 0 do
create_table :cache_taggings, :force => true do |t|
t.string :url
t.string :tag
end
end
DatabaseCleaner.strategy = :truncation
class Test::Unit::TestCase
include Rack::Cache::Tags::Store
def setup
DatabaseCleaner.start
end
def teardown
DatabaseCleaner.clean
end
attr_reader :app
def create_tags(url, tags)
tags.each { |tag| ActiveRecord::Tagging.create!(:url => url, :tag => tag) }
end
def respond_with(status, headers, body)
@app = Rack::Cache::Tags.new(lambda { |env| [200, headers, ''] })
end
def get(url)
app.call(env_for(url))
end
def env_for(*args)
Rack::MockRequest.env_for(*args)
end
-end
\ No newline at end of file
+end
|
svenfuchs/rack-cache-tags
|
9e6a9e795fc9c2c18d47bfda0ea2b39c0e50e653
|
urls should be unique
|
diff --git a/lib/rack/cache/tags/store/active_record.rb b/lib/rack/cache/tags/store/active_record.rb
index fda5376..31416a9 100644
--- a/lib/rack/cache/tags/store/active_record.rb
+++ b/lib/rack/cache/tags/store/active_record.rb
@@ -1,32 +1,32 @@
require 'active_record'
module Rack
module Cache
class Tags
module Store
class ActiveRecord
class Tagging < ::ActiveRecord::Base
set_table_name 'cache_taggings'
end
def store(url, tags)
tags.each { |tag| Tagging.find_or_create_by_url_and_tag(url, tag) }
end
def purge(tags)
urls_by_tags(tags).tap { |urls| Tagging.where(:url => urls).delete_all }
end
def urls_by_tags(tags)
- taggings_by_tags(tags).map(&:url)
+ taggings_by_tags(tags).map(&:url).uniq
end
def taggings_by_tags(tags)
sql = "tag IN (?) #{[' OR tag LIKE ?'] * tags.size}"
Tagging.where(sql, tags, *tags.map { |tag| "#{tag.split(':').first}%" })
end
end
end
end
end
end
|
svenfuchs/rack-cache-tags
|
17c709dc244371763f85f5e8184adb6a70929f2a
|
Bump to 0.0.5
|
diff --git a/lib/rack_cache_tags/version.rb b/lib/rack_cache_tags/version.rb
index e1d954b..4543eab 100644
--- a/lib/rack_cache_tags/version.rb
+++ b/lib/rack_cache_tags/version.rb
@@ -1,3 +1,3 @@
module RackCacheTags
- VERSION = "0.0.4"
+ VERSION = "0.0.5"
end
\ No newline at end of file
|
svenfuchs/rack-cache-tags
|
36b4f74249e06d98f243e9918e83e4c5672e4c1a
|
fix taggings_by_tags to make a given tag "site-1:title" match an existing tagging for "site-1"
|
diff --git a/lib/rack/cache/tags/store/active_record.rb b/lib/rack/cache/tags/store/active_record.rb
index 1f02caa..fda5376 100644
--- a/lib/rack/cache/tags/store/active_record.rb
+++ b/lib/rack/cache/tags/store/active_record.rb
@@ -1,31 +1,32 @@
require 'active_record'
module Rack
module Cache
class Tags
module Store
class ActiveRecord
class Tagging < ::ActiveRecord::Base
set_table_name 'cache_taggings'
end
def store(url, tags)
tags.each { |tag| Tagging.find_or_create_by_url_and_tag(url, tag) }
end
def purge(tags)
urls_by_tags(tags).tap { |urls| Tagging.where(:url => urls).delete_all }
end
def urls_by_tags(tags)
taggings_by_tags(tags).map(&:url)
end
def taggings_by_tags(tags)
- Tagging.where((['tag LIKE ?'] * tags.size).join(' OR '), *tags.map { |tag| "#{tag}%" })
+ sql = "tag IN (?) #{[' OR tag LIKE ?'] * tags.size}"
+ Tagging.where(sql, tags, *tags.map { |tag| "#{tag.split(':').first}%" })
end
end
end
end
end
-end
\ No newline at end of file
+end
|
svenfuchs/rack-cache-tags
|
442333b525c57c0ecbfa7f58319cd1e1e9a8ff38
|
use already defined Purge::PURGE_HEADER constant
|
diff --git a/lib/rack/cache/tags.rb b/lib/rack/cache/tags.rb
index 06605e6..dc511c6 100644
--- a/lib/rack/cache/tags.rb
+++ b/lib/rack/cache/tags.rb
@@ -1,47 +1,47 @@
require 'rack/request'
+require 'rack/cache/purge'
module Rack
module Cache
class Tags
autoload :Store, 'rack/cache/tags/store'
class << self
def store
@store ||= Store::ActiveRecord.new
end
def store=(store)
@store ||= store
end
end
- TAGS_HEADER = 'rack-cache.tags'
- PURGE_HEADER = 'rack-cache.purge'
PURGE_TAGS_HEADER = 'rack-cache.purge-tags'
-
+ TAGS_HEADER = 'rack-cache.tags'
+
attr_reader :app
def initialize(app)
@app = app
end
def call(env)
status, headers, body = app.call(env)
store(Rack::Request.new(env).url, headers[TAGS_HEADER]) if status == 200 && headers.key?(TAGS_HEADER)
purge(headers) if headers.key?(PURGE_TAGS_HEADER)
[status, headers, body]
end
protected
def store(*args)
self.class.store.store(*args)
end
def purge(headers)
urls = self.class.store.purge(headers[PURGE_TAGS_HEADER])
- headers[PURGE_HEADER] = urls unless urls.empty?
+ headers[Purge::PURGE_HEADER] = urls unless urls.empty?
end
end
end
end
diff --git a/test/test_tags.rb b/test/test_tags.rb
index 937db7f..fe2d8f4 100644
--- a/test/test_tags.rb
+++ b/test/test_tags.rb
@@ -1,45 +1,45 @@
require File.expand_path('../test_helper', __FILE__)
class TagsTest < Test::Unit::TestCase
include Rack::Cache::Tags::Store
attr_reader :store
def setup
@store = Rack::Cache::Tags::Store::ActiveRecord.new
end
test 'stores tags for the current url' do
respond_with 200, { Rack::Cache::Tags::TAGS_HEADER => %w(foo-1 bar-2) }, ''
get('http://example.com/')
actual = ActiveRecord::Tagging.all.map { |tagging| [tagging.url, tagging.tag] }
assert_equal [%W(http://example.com/ foo-1), %W(http://example.com/ bar-2)], actual
end
test 'expands tags to urls for purge headers and deletes the tagging' do
create_tags('http://example.com/foo', %w(foo-1 foo-2))
create_tags('http://example.com/bar', %w(foo-1))
create_tags('http://example.com/baz', %w(baz-1))
respond_with 200, { Rack::Cache::Tags::PURGE_TAGS_HEADER => %w(foo-1) }, ''
status, headers, body = get('http://example.com')
actual = ActiveRecord::Tagging.all.map { |tagging| [tagging.url, tagging.tag] }
assert_equal [%w(http://example.com/baz baz-1)], actual
- assert_equal %w(http://example.com/foo http://example.com/bar), headers[Rack::Cache::Tags::PURGE_HEADER]
+ assert_equal %w(http://example.com/foo http://example.com/bar), headers[Rack::Cache::Purge::PURGE_HEADER]
end
test 'active_record store finds tags w/o methods' do
tags = %w(foo-1 foo-2)
create_tags('http://example.com/foo', tags)
assert_equal tags, store.taggings_by_tags(tags).map(&:tag)
end
test 'active_record store finds tags w/ methods' do
tags = %w(foo-1:title foo-1:body)
create_tags('http://example.com/foo', tags)
assert_equal tags, store.taggings_by_tags(%w(foo-1)).map(&:tag)
end
end
|
svenfuchs/rack-cache-tags
|
6851313ba0410339be00300d8a6b6769cb92bb28
|
don't delete purge tags header
|
diff --git a/lib/rack/cache/tags.rb b/lib/rack/cache/tags.rb
index a7315b6..06605e6 100644
--- a/lib/rack/cache/tags.rb
+++ b/lib/rack/cache/tags.rb
@@ -1,48 +1,47 @@
require 'rack/request'
module Rack
module Cache
class Tags
autoload :Store, 'rack/cache/tags/store'
class << self
def store
@store ||= Store::ActiveRecord.new
end
def store=(store)
@store ||= store
end
end
TAGS_HEADER = 'rack-cache.tags'
PURGE_HEADER = 'rack-cache.purge'
PURGE_TAGS_HEADER = 'rack-cache.purge-tags'
attr_reader :app
def initialize(app)
@app = app
end
def call(env)
status, headers, body = app.call(env)
store(Rack::Request.new(env).url, headers[TAGS_HEADER]) if status == 200 && headers.key?(TAGS_HEADER)
purge(headers) if headers.key?(PURGE_TAGS_HEADER)
[status, headers, body]
end
protected
-
+
def store(*args)
self.class.store.store(*args)
end
-
+
def purge(headers)
urls = self.class.store.purge(headers[PURGE_TAGS_HEADER])
headers[PURGE_HEADER] = urls unless urls.empty?
- headers.delete(PURGE_TAGS_HEADER)
end
end
end
-end
\ No newline at end of file
+end
|
svenfuchs/rack-cache-tags
|
9b4340073e0e3074cc263430f565ad4ace7da9df
|
bump to 0.0.4
|
diff --git a/lib/rack_cache_tags/version.rb b/lib/rack_cache_tags/version.rb
index cf72005..e1d954b 100644
--- a/lib/rack_cache_tags/version.rb
+++ b/lib/rack_cache_tags/version.rb
@@ -1,3 +1,3 @@
module RackCacheTags
- VERSION = "0.0.3"
+ VERSION = "0.0.4"
end
\ No newline at end of file
|
svenfuchs/rack-cache-tags
|
99aafb1421814c818f5578b14684931a9ea4a874
|
do purge when purge headers are present, no matter what status
|
diff --git a/lib/rack/cache/tags.rb b/lib/rack/cache/tags.rb
index 649f4a0..a7315b6 100644
--- a/lib/rack/cache/tags.rb
+++ b/lib/rack/cache/tags.rb
@@ -1,50 +1,48 @@
require 'rack/request'
module Rack
module Cache
class Tags
autoload :Store, 'rack/cache/tags/store'
class << self
def store
@store ||= Store::ActiveRecord.new
end
def store=(store)
@store ||= store
end
end
TAGS_HEADER = 'rack-cache.tags'
PURGE_HEADER = 'rack-cache.purge'
PURGE_TAGS_HEADER = 'rack-cache.purge-tags'
attr_reader :app
def initialize(app)
@app = app
end
def call(env)
status, headers, body = app.call(env)
- if status == 200
- store(Rack::Request.new(env).url, headers[TAGS_HEADER]) if headers.key?(TAGS_HEADER)
- purge(headers) if headers.key?(PURGE_TAGS_HEADER)
- end
+ store(Rack::Request.new(env).url, headers[TAGS_HEADER]) if status == 200 && headers.key?(TAGS_HEADER)
+ purge(headers) if headers.key?(PURGE_TAGS_HEADER)
[status, headers, body]
end
protected
def store(*args)
self.class.store.store(*args)
end
def purge(headers)
urls = self.class.store.purge(headers[PURGE_TAGS_HEADER])
headers[PURGE_HEADER] = urls unless urls.empty?
headers.delete(PURGE_TAGS_HEADER)
end
end
end
end
\ No newline at end of file
|
svenfuchs/rack-cache-tags
|
82ed3a8cec9524aea3fc4f271243ceb80a7e661b
|
bump to 0.0.3
|
diff --git a/lib/rack_cache_tags/version.rb b/lib/rack_cache_tags/version.rb
index 387da18..cf72005 100644
--- a/lib/rack_cache_tags/version.rb
+++ b/lib/rack_cache_tags/version.rb
@@ -1,3 +1,3 @@
module RackCacheTags
- VERSION = "0.0.2"
+ VERSION = "0.0.3"
end
\ No newline at end of file
|
svenfuchs/rack-cache-tags
|
e9692c0ebbc1152faa703351497a3537fddd6e8f
|
always use wildcard lookups
|
diff --git a/lib/rack/cache/tags/store/active_record.rb b/lib/rack/cache/tags/store/active_record.rb
index d3ab8fc..1f02caa 100644
--- a/lib/rack/cache/tags/store/active_record.rb
+++ b/lib/rack/cache/tags/store/active_record.rb
@@ -1,26 +1,31 @@
require 'active_record'
module Rack
module Cache
class Tags
module Store
class ActiveRecord
class Tagging < ::ActiveRecord::Base
set_table_name 'cache_taggings'
end
def store(url, tags)
tags.each { |tag| Tagging.find_or_create_by_url_and_tag(url, tag) }
end
-
+
def purge(tags)
- tags = Tagging.where(:tag => tags)
- urls = tags.map(&:url)
- Tagging.where(:url => urls).delete_all
- urls
+ urls_by_tags(tags).tap { |urls| Tagging.where(:url => urls).delete_all }
+ end
+
+ def urls_by_tags(tags)
+ taggings_by_tags(tags).map(&:url)
+ end
+
+ def taggings_by_tags(tags)
+ Tagging.where((['tag LIKE ?'] * tags.size).join(' OR '), *tags.map { |tag| "#{tag}%" })
end
end
end
end
end
end
\ No newline at end of file
diff --git a/test/test_tags.rb b/test/test_tags.rb
index d139f96..937db7f 100644
--- a/test/test_tags.rb
+++ b/test/test_tags.rb
@@ -1,26 +1,45 @@
require File.expand_path('../test_helper', __FILE__)
class TagsTest < Test::Unit::TestCase
include Rack::Cache::Tags::Store
+ attr_reader :store
+
+ def setup
+ @store = Rack::Cache::Tags::Store::ActiveRecord.new
+ end
+
test 'stores tags for the current url' do
respond_with 200, { Rack::Cache::Tags::TAGS_HEADER => %w(foo-1 bar-2) }, ''
get('http://example.com/')
actual = ActiveRecord::Tagging.all.map { |tagging| [tagging.url, tagging.tag] }
assert_equal [%W(http://example.com/ foo-1), %W(http://example.com/ bar-2)], actual
end
test 'expands tags to urls for purge headers and deletes the tagging' do
create_tags('http://example.com/foo', %w(foo-1 foo-2))
create_tags('http://example.com/bar', %w(foo-1))
create_tags('http://example.com/baz', %w(baz-1))
respond_with 200, { Rack::Cache::Tags::PURGE_TAGS_HEADER => %w(foo-1) }, ''
status, headers, body = get('http://example.com')
actual = ActiveRecord::Tagging.all.map { |tagging| [tagging.url, tagging.tag] }
assert_equal [%w(http://example.com/baz baz-1)], actual
assert_equal %w(http://example.com/foo http://example.com/bar), headers[Rack::Cache::Tags::PURGE_HEADER]
end
-end
\ No newline at end of file
+
+ test 'active_record store finds tags w/o methods' do
+ tags = %w(foo-1 foo-2)
+ create_tags('http://example.com/foo', tags)
+ assert_equal tags, store.taggings_by_tags(tags).map(&:tag)
+ end
+
+ test 'active_record store finds tags w/ methods' do
+ tags = %w(foo-1:title foo-1:body)
+ create_tags('http://example.com/foo', tags)
+ assert_equal tags, store.taggings_by_tags(%w(foo-1)).map(&:tag)
+ end
+end
+
|
svenfuchs/rack-cache-tags
|
cbe6c6e661a545219ebf3acdd449570e668c851f
|
bump to 0.0.2
|
diff --git a/lib/rack_cache_tags/version.rb b/lib/rack_cache_tags/version.rb
index d4a0e39..387da18 100644
--- a/lib/rack_cache_tags/version.rb
+++ b/lib/rack_cache_tags/version.rb
@@ -1,3 +1,3 @@
module RackCacheTags
- VERSION = "0.0.1"
+ VERSION = "0.0.2"
end
\ No newline at end of file
|
svenfuchs/rack-cache-tags
|
5501e1e7a6a4209d693546b70c0ddc1c0d1a8fe4
|
cleanup
|
diff --git a/rack-cache-tags.gemspec b/rack-cache-tags.gemspec
index 46b7f96..c77b200 100644
--- a/rack-cache-tags.gemspec
+++ b/rack-cache-tags.gemspec
@@ -1,20 +1,19 @@
# encoding: utf-8
$:.unshift File.expand_path('../lib', __FILE__)
require 'rack_cache_tags/version'
Gem::Specification.new do |s|
s.name = "rack-cache-tags"
s.version = RackCacheTags::VERSION
s.authors = ["Sven Fuchs"]
s.email = "svenfuchs@artweb-design.de"
s.homepage = "http://github.com/svenfuchs/rack-cache-tags"
s.summary = "[summary]"
s.description = "[description]"
s.files = Dir.glob("lib/**/**")
s.platform = Gem::Platform::RUBY
s.require_path = 'lib'
s.rubyforge_project = '[none]'
- s.required_rubygems_version = '>= 1.3.6'
end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index cb850ff..bd5083e 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,39 +1,59 @@
$:.unshift File.expand_path('../../lib', __FILE__)
require 'rubygems'
require 'test/unit'
require 'test_declarative'
require 'fileutils'
require 'active_record'
require 'logger'
require 'rack/mock'
require 'database_cleaner'
require 'rack_cache_tags'
log = '/tmp/rack_cache_tags.log'
FileUtils.touch(log) unless File.exists?(log)
ActiveRecord::Base.logger = Logger.new(log)
ActiveRecord::LogSubscriber.attach_to(:active_record)
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
ActiveRecord::Migration.verbose = false
ActiveRecord::Schema.define :version => 0 do
create_table :cache_taggings, :force => true do |t|
t.string :url
t.string :tag
end
end
DatabaseCleaner.strategy = :truncation
class Test::Unit::TestCase
+ include Rack::Cache::Tags::Store
+
def setup
DatabaseCleaner.start
end
def teardown
DatabaseCleaner.clean
end
+
+ attr_reader :app
+
+ def create_tags(url, tags)
+ tags.each { |tag| ActiveRecord::Tagging.create!(:url => url, :tag => tag) }
+ end
+
+ def respond_with(status, headers, body)
+ @app = Rack::Cache::Tags.new(lambda { |env| [200, headers, ''] })
+ end
+
+ def get(url)
+ app.call(env_for(url))
+ end
+
+ def env_for(*args)
+ Rack::MockRequest.env_for(*args)
+ end
end
\ No newline at end of file
diff --git a/test/test_store.rb b/test/test_store.rb
deleted file mode 100644
index 425e80e..0000000
--- a/test/test_store.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require File.expand_path('../test_helper', __FILE__)
-
-class StoreTest < Test::Unit::TestCase
-end
\ No newline at end of file
diff --git a/test/test_tags.rb b/test/test_tags.rb
index aed6706..d139f96 100644
--- a/test/test_tags.rb
+++ b/test/test_tags.rb
@@ -1,41 +1,26 @@
require File.expand_path('../test_helper', __FILE__)
class TagsTest < Test::Unit::TestCase
include Rack::Cache::Tags::Store
test 'stores tags for the current url' do
- url = 'http://example.com/foo'
- headers = { Rack::Cache::Tags::TAGS_HEADER => %w(foo-1 bar-2) }
- tags = Rack::Cache::Tags.new(lambda { |env| [200, headers, ''] })
+ respond_with 200, { Rack::Cache::Tags::TAGS_HEADER => %w(foo-1 bar-2) }, ''
- tags.call(env_for(url))
+ get('http://example.com/')
actual = ActiveRecord::Tagging.all.map { |tagging| [tagging.url, tagging.tag] }
- assert_equal [%W(#{url} foo-1), %W(#{url} bar-2)], actual
+ assert_equal [%W(http://example.com/ foo-1), %W(http://example.com/ bar-2)], actual
end
test 'expands tags to urls for purge headers and deletes the tagging' do
create_tags('http://example.com/foo', %w(foo-1 foo-2))
create_tags('http://example.com/bar', %w(foo-1))
create_tags('http://example.com/baz', %w(baz-1))
- headers = { Rack::Cache::Tags::PURGE_TAGS_HEADER => %w(foo-1) }
- tags = Rack::Cache::Tags.new(lambda { |env| [200, headers, ''] })
-
- status, headers, body = tags.call(env_for('http://example.com'))
+ respond_with 200, { Rack::Cache::Tags::PURGE_TAGS_HEADER => %w(foo-1) }, ''
+ status, headers, body = get('http://example.com')
actual = ActiveRecord::Tagging.all.map { |tagging| [tagging.url, tagging.tag] }
assert_equal [%w(http://example.com/baz baz-1)], actual
-
assert_equal %w(http://example.com/foo http://example.com/bar), headers[Rack::Cache::Tags::PURGE_HEADER]
end
-
- protected
-
- def create_tags(url, tags)
- tags.each { |tag| ActiveRecord::Tagging.create!(:url => url, :tag => tag) }
- end
-
- def env_for(*args)
- Rack::MockRequest.env_for(*args)
- end
end
\ No newline at end of file
|
svenfuchs/rack-cache-tags
|
2ee4531422564e5f3b00957458d2ed0513cd20d2
|
simplified reimplementation
|
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..47e7ef4
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,10 @@
+require 'rake'
+require 'rake/testtask'
+
+Rake::TestTask.new do |t|
+ t.libs << 'lib'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = false
+end
+
+task :default => :test
diff --git a/lib/core_ext/file_utils/rmdir_p.rb b/lib/core_ext/file_utils/rmdir_p.rb
deleted file mode 100644
index a8d2bb4..0000000
--- a/lib/core_ext/file_utils/rmdir_p.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'fileutils'
-
-module FileUtils
- def self.rmdir_p(path)
- begin
- while(true)
- FileUtils.rmdir(path)
- path = File.dirname(path)
- end
- rescue Errno::EEXIST, Errno::ENOTEMPTY, Errno::ENOENT, Errno::EINVAL, Errno::ENOTDIR
- # Stop trying to remove parent directories
- end
- end
-end
\ No newline at end of file
diff --git a/lib/method_call_tracking.rb b/lib/method_call_tracking.rb
deleted file mode 100644
index 01ca903..0000000
--- a/lib/method_call_tracking.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-# Simple mechanism to track calls on methods.
-#
-# Include the module and call track_methods(an_array, :foo, :bar) on any object.
-# This will set up the methods :foo and :bar on the object's metaclass.
-#
-# When the method :foo is called for the first time this is recorded to the
-# given array and the method is removed from the metaclass (so it only records
-# the) first call. The given array will then equal [[the_object, :foo]].
-module MethodCallTracking
- def track_method_calls(tracker, *methods)
- if methods.empty?
- # FIXME this assumes ActiveRecord
- define_track_method(tracker, @attributes, :[], [self, nil])
- else
- methods.each do |method|
- define_track_method(tracker, self, method, [self, method])
- end
- end
- end
-
- # Sets up a method in the meta class of the target object which will save
- # a reference when the method is called first, then removes itself and
- # delegates to the regular method in the class. (Cheap method proxy pattern
- # that leverages Ruby's way of looking up a method in the meta class first
- # and then in the regular class second.)
- def define_track_method(tracker, target, method, reference)
- meta_class = class << target; self; end
- meta_class.send :define_method, method do |*args|
- tracker << reference
- meta_class.send(:remove_method, method)
- super
- end
- end
-
- # Tracks method access on trackable objects. Trackables can be given as
- #
- # * instance variable names (when starting with an @)
- # * method names (otherwise)
- # * Hashes that use ivar or method names as keys and method names as values:
- #
- # So both of these:
- #
- # Tracker.new controller, :'@foo', :bar, { :'@baz' => :buz }
- # Tracker.new controller, :'@foo', :bar, { :'@baz' => [:buz] }
- #
- # would set up access tracking for the controller's ivar @foo, the method :bar
- # and the method :buz on the ivar @baz.
- class Tracker
- attr_reader :references
-
- def initialize
- @references = []
- end
-
- def track(owner, *trackables)
- trackables.each do |trackable|
- trackable = { trackable => nil } unless trackable.is_a?(Hash)
- trackable.each do |trackable, methods|
- trackable = resolve_trackable(owner, trackable)
- track_methods(trackable, methods) unless trackable.nil? # FIXME issue warning
- end
- end
- end
-
- protected
-
- # Resolves the trackable by looking it up on the owner. Trackables will be
- # interpreted as instance variables when they start with an @ and as method
- # names otherwise.
- def resolve_trackable(owner, trackable)
- case trackable.to_s
- when /^@/; owner.instance_variable_get(trackable.to_sym)
- else owner.send(trackable.to_sym)
- end
- end
-
- # Wraps the trackable into a MethodReadObserver and registers itself as an observer.
- # Sets up tracking for the read_attribute method when the methods argument is nil.
- # Sets up tracking for any other given methods otherwise.
- def track_methods(trackable, methods)
- if trackable.is_a?(Array)
- trackable.each { |trackable| track_methods(trackable, methods) }
- else
- trackable.track_method_calls(references, *Array(methods))
- end
- end
- end
-end
diff --git a/lib/rack/cache/tags.rb b/lib/rack/cache/tags.rb
index 4080a49..649f4a0 100644
--- a/lib/rack/cache/tags.rb
+++ b/lib/rack/cache/tags.rb
@@ -1,41 +1,50 @@
-require 'uri'
+require 'rack/request'
-require 'rack/cache'
-require 'rack/cache/storage'
-require 'rack/cache/utils'
+module Rack
+ module Cache
+ class Tags
+ autoload :Store, 'rack/cache/tags/store'
-require 'rack/cache/tags/context'
-require 'rack/cache/tags/storage'
-require 'rack/cache/tags/tag_store'
-require 'rack/cache/tags/meta_store'
-require 'rack/cache/tags/purger'
+ class << self
+ def store
+ @store ||= Store::ActiveRecord.new
+ end
-module Rack::Cache
- TAGS_HEADER = 'X-Cache-Tags'
- PURGE_TAGS_HEADER = 'X-Cache-Purge-Tags'
-
- Context.class_eval do
- option_accessor :tagstore
-
- def tagstore
- uri = options['rack-cache.tagstore']
- storage.resolve_tagstore_uri(uri)
- end
- end
+ def store=(store)
+ @store ||= store
+ end
+ end
- Purge::Purger.class_eval do
- include Tags::Purger
- end
+ TAGS_HEADER = 'rack-cache.tags'
+ PURGE_HEADER = 'rack-cache.purge'
+ PURGE_TAGS_HEADER = 'rack-cache.purge-tags'
+
+ attr_reader :app
- module Tags
- class << self
- def new(backend, options={}, &b)
- Context.new(backend, options, &b)
+ def initialize(app)
+ @app = app
end
- def normalize(tags)
- Array(tags).join(',').split(',').map { |tag| tag.strip }
+ def call(env)
+ status, headers, body = app.call(env)
+ if status == 200
+ store(Rack::Request.new(env).url, headers[TAGS_HEADER]) if headers.key?(TAGS_HEADER)
+ purge(headers) if headers.key?(PURGE_TAGS_HEADER)
+ end
+ [status, headers, body]
end
+
+ protected
+
+ def store(*args)
+ self.class.store.store(*args)
+ end
+
+ def purge(headers)
+ urls = self.class.store.purge(headers[PURGE_TAGS_HEADER])
+ headers[PURGE_HEADER] = urls unless urls.empty?
+ headers.delete(PURGE_TAGS_HEADER)
+ end
end
end
end
\ No newline at end of file
diff --git a/lib/rack/cache/tags/context.rb b/lib/rack/cache/tags/context.rb
deleted file mode 100644
index bfa367d..0000000
--- a/lib/rack/cache/tags/context.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-module Rack::Cache::Tags
- class Context
- def initialize(backend, options = {})
- @backend = backend
- @options = options
- yield self if block_given?
- end
-
- def call(env)
- @env = env
- request = Rack::Cache::Request.new(env)
- response = Rack::Cache::Response.new(*@backend.call(env))
-
- tags = response.headers.delete(Rack::Cache::PURGE_TAGS_HEADER)
- return response.to_a unless tags
-
- uris = tagged_uris(tags)
- if false && env.key?('rack-cache.purger')
- # TODO directly purge using uris?
- else
- set_purge_header(response, uris)
- purge_taggings(request, uris)
- end
-
- response.to_a
- end
-
- protected
-
- def tagged_uris(tags)
- tags = Rack::Cache::Tags.normalize(tags)
- tags.inject([]) { |uris, tag| uris + tagstore.read_tag(tag) }
- end
-
- def set_purge_header(response, uris)
- response.headers[Rack::Cache::PURGE_HEADER] = uris.join("\n")
- end
-
- def purge_taggings(request, uris)
- tagstore = self.tagstore
- keys = uris.map { |uri| Rack::Cache::Utils::Key.call(request, uri) }
- keys.each { |key| tagstore.purge(key) }
- end
-
- def tagstore
- uri = @env['rack-cache.tagstore']
- storage.resolve_tagstore_uri(uri)
- end
-
- def storage
- Rack::Cache::Storage.instance
- end
- end
-end
\ No newline at end of file
diff --git a/lib/rack/cache/tags/meta_store.rb b/lib/rack/cache/tags/meta_store.rb
deleted file mode 100644
index f37ec61..0000000
--- a/lib/rack/cache/tags/meta_store.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-module Rack::Cache::Tags::MetaStore
- def store(request, response, entity_store)
- key = super
-
- tags = response.headers[Rack::Cache::TAGS_HEADER]
- tagstore(request).store(key, tags) if tags
-
- key
- end
-
- def tagstore(request)
- uri = request.env['rack-cache.tagstore']
- storage.resolve_tagstore_uri(uri)
- end
-
- def storage
- Rack::Cache::Storage.instance
- end
-
- Rack::Cache::MetaStore::Heap.send(:include, self)
- Rack::Cache::MetaStore::Disk.send(:include, self)
-end
diff --git a/lib/rack/cache/tags/purger.rb b/lib/rack/cache/tags/purger.rb
deleted file mode 100644
index a1b6b3a..0000000
--- a/lib/rack/cache/tags/purger.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-module Rack
- module Cache
- module Tags
- module Purger
- def purge(arg)
- keys = super
- tagstore = self.tagstore
- keys.each { |key| tagstore.purge(key) }
- end
-
- def tagstore
- uri = context.env['rack-cache.tagstore']
- storage.resolve_tagstore_uri(uri)
- end
- end
- end
- end
-end
\ No newline at end of file
diff --git a/lib/rack/cache/tags/rails/action_controller.rb b/lib/rack/cache/tags/rails/action_controller.rb
deleted file mode 100644
index 5614639..0000000
--- a/lib/rack/cache/tags/rails/action_controller.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-require 'method_call_tracking'
-
-module Rack::Cache::Tags
- module Rails
- module ActionController
- module ActMacro
- # ...
- #
- # cache_tags :index, :show, :track => ['@article', '@articles', {'@site' => :tag_counts}]
- #
- def cache_tags(*actions)
- tracks_references(*actions)
-
- unless caches_page_with_references?
- alias_method_chain :caching_allowed, :skipping
- end
-
- # options = actions.extract_options!
- after_filter(:only => actions) { |c| c.cache_control }
- end
-
- # Sets up reference tracking for given actions and objects
- #
- # tracks_references :index, :show, :track => ['@article', '@articles', {'@site' => :tag_counts}]
- #
- def tracks_references(*actions)
- unless tracks_references?
- include Rack::Cache::Tags::Rails::ActionController
-
- # helper_method :cached_references
- # attr_writer :cached_references
- alias_method_chain :render, :reference_tracking
-
- class_inheritable_accessor :track_references_to
- self.track_references_to = []
-
- class_inheritable_accessor :track_references_on
- self.track_references_on = []
- end
-
- options = actions.extract_options!
- track = options[:track]
-
- self.track_references_to += track.is_a?(Array) ? track : [track]
- self.track_references_to.uniq!
- self.track_references_on = actions
- end
-
- def caches_page_with_references?
- method_defined? :caching_allowed_without_skipping
- end
-
- def tracks_references?
- method_defined? :render_without_reference_tracking
- end
- end
-
- attr_reader :reference_tracker
-
- def cache_control
- if perform_caching && caching_allowed
- expires_in(10.years.from_now, :public => true)
- set_cache_tags
- end
- end
-
- def skip_caching!
- @skip_caching = true
- end
-
- def skip_caching?
- @skip_caching == true
- end
-
- protected
-
- def render_with_reference_tracking(*args, &block)
- args << options = args.extract_options!
- skip_caching! if options.delete(:skip_caching) || !cacheable_action?
-
- setup_reference_tracking if perform_caching && caching_allowed
- render_without_reference_tracking(*args, &block)
- end
-
- def cacheable_action?
- action = params[:action] || ''
- self.class.track_references_on.include?(action.to_sym)
- end
-
- def setup_reference_tracking
- trackables = self.class.track_references_to || {}
- @reference_tracker ||= MethodCallTracking::Tracker.new
- @reference_tracker.track(self, *trackables.clone)
- end
-
- def set_cache_tags
- cache_tags = @reference_tracker.references.map do |reference|
- reference.first.cache_tag
- end
- response.headers[Rack::Cache::TAGS_HEADER] = cache_tags.join(',') unless cache_tags.empty?
- end
-
- def caching_allowed_with_skipping
- caching_allowed_without_skipping && !skip_caching?
- end
-
- ::ActionController::Base.send(:extend, ActMacro)
- end
- end
-end
\ No newline at end of file
diff --git a/lib/rack/cache/tags/storage.rb b/lib/rack/cache/tags/storage.rb
deleted file mode 100644
index 0628c6b..0000000
--- a/lib/rack/cache/tags/storage.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-Rack::Cache::Storage.class_eval do
- alias :clear_without_tagstore :clear
- def clear
- @tagstores.clear
- clear_without_tagstore
- end
-
- def resolve_tagstore_uri(uri)
- @tagstores ||= {}
- @tagstores[uri.to_s] ||= create_store(Rack::Cache::Tags::TagStore, uri)
- end
-end
\ No newline at end of file
diff --git a/lib/rack/cache/tags/store.rb b/lib/rack/cache/tags/store.rb
new file mode 100644
index 0000000..a414183
--- /dev/null
+++ b/lib/rack/cache/tags/store.rb
@@ -0,0 +1,9 @@
+module Rack
+ module Cache
+ class Tags
+ module Store
+ autoload :ActiveRecord, 'rack/cache/tags/store/active_record'
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/lib/rack/cache/tags/store/active_record.rb b/lib/rack/cache/tags/store/active_record.rb
new file mode 100644
index 0000000..d3ab8fc
--- /dev/null
+++ b/lib/rack/cache/tags/store/active_record.rb
@@ -0,0 +1,26 @@
+require 'active_record'
+
+module Rack
+ module Cache
+ class Tags
+ module Store
+ class ActiveRecord
+ class Tagging < ::ActiveRecord::Base
+ set_table_name 'cache_taggings'
+ end
+
+ def store(url, tags)
+ tags.each { |tag| Tagging.find_or_create_by_url_and_tag(url, tag) }
+ end
+
+ def purge(tags)
+ tags = Tagging.where(:tag => tags)
+ urls = tags.map(&:url)
+ Tagging.where(:url => urls).delete_all
+ urls
+ end
+ end
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/lib/rack/cache/tags/tag_store.rb b/lib/rack/cache/tags/tag_store.rb
deleted file mode 100644
index 94ef8f7..0000000
--- a/lib/rack/cache/tags/tag_store.rb
+++ /dev/null
@@ -1,177 +0,0 @@
-require 'rack/utils'
-require 'digest/sha1'
-require 'fileutils'
-require 'core_ext/file_utils/rmdir_p'
-
-module Rack::Cache::Tags
- class TagStore
- def read_key(key)
- key(key).read
- end
-
- def read_tag(tag)
- tag(tag).read
- end
-
- def store(key, tags)
- tags = Rack::Cache::Tags.normalize(tags)
- key(key, tags).store.each { |tag| read_tag(tag).add(key) }
- end
-
- def purge(key)
- read_key(key).purge.each { |tag| read_tag(tag).remove(key) }
- end
-
- public
-
- class Heap < TagStore
- def self.resolve(uri)
- new
- end
-
- def initialize
- @by_key, @by_tag = {}, {}
- end
-
- def key(key, tags = [])
- Collection.new(@by_key, :key, key, tags)
- end
-
- def tag(tag, keys = [])
- Collection.new(@by_tag, :tag, tag, keys)
- end
-
- class Collection < Array
- attr_reader :type, :owner, :hash
-
- def initialize(hash, type, owner, elements = [])
- @hash, @type, @owner = hash, type, owner
- super(elements) if elements
- compact
- end
-
- def add(element)
- return if element.nil? or include?(element)
- push(element)
- store
- end
-
- def remove(element)
- store if delete(element)
- self
- end
-
- def purge
- hash.delete(owner)
- self
- end
-
- def exist?
- hash.key?(owner)
- end
-
- def read
- replace(hash[owner] || [])
- self
- end
-
- def store
- return purge if empty?
- hash[owner] = self
- end
- end
- end
-
- HEAP = Heap
- MEM = HEAP
-
- class Disk < TagStore
- def self.resolve(uri)
- path = File.expand_path(uri.opaque || uri.path)
- new(path)
- end
-
- def initialize(root)
- @root = root
- FileUtils.mkdir_p root, :mode => 0755
- end
-
- def key(key, tags = [])
- Collection.new(@root, :key, key, tags)
- end
-
- def tag(tag, keys = [])
- Collection.new(@root, :tag, tag, keys)
- end
-
- class Collection < Array
- attr_reader :type, :owner, :root
-
- def initialize(root, type, owner, elements)
- @root, @type, @owner = root, type, owner
- super(elements) if elements
- compact
- end
-
- def add(element)
- return if element.nil? or include?(element)
- push(element)
- store
- end
-
- def remove(element)
- store if delete(element)
- self
- end
-
- def purge
- File.unlink(path) rescue Errno::ENOENT
- FileUtils.rmdir_p(File.dirname(path))
- self
- end
-
- def exist?
- File.exist?(path)
- end
-
- def read
- replace(read_file.split(','))
- self
- rescue Errno::ENOENT
- self
- end
-
- def store
- return purge if empty?
-
- FileUtils.mkdir_p(File.dirname(path), :mode => 0755)
- File.open(path, 'wb') { |f| f.write(join(',')) }
- self
- end
-
- protected
-
- def read_file
- File.open(path, 'rb') { |f| f.read }
- end
-
- def path
- File.join(root, "by_#{type}", spread(owner))
- end
-
- def digest(key)
- Digest::SHA1.hexdigest(key)
- end
-
- def spread(arg)
- arg = digest(arg)
- arg[2, 0] = '/'
- arg
- end
- end
- end
-
- DISK = Disk
- FILE = Disk
- end
-end
\ No newline at end of file
diff --git a/lib/rack_cache_tags.rb b/lib/rack_cache_tags.rb
new file mode 100644
index 0000000..0f9cc76
--- /dev/null
+++ b/lib/rack_cache_tags.rb
@@ -0,0 +1 @@
+require 'rack/cache/tags'
\ No newline at end of file
diff --git a/lib/rack_cache_tags/version.rb b/lib/rack_cache_tags/version.rb
new file mode 100644
index 0000000..d4a0e39
--- /dev/null
+++ b/lib/rack_cache_tags/version.rb
@@ -0,0 +1,3 @@
+module RackCacheTags
+ VERSION = "0.0.1"
+end
\ No newline at end of file
diff --git a/rack-cache-tags.gemspec b/rack-cache-tags.gemspec
new file mode 100644
index 0000000..46b7f96
--- /dev/null
+++ b/rack-cache-tags.gemspec
@@ -0,0 +1,20 @@
+# encoding: utf-8
+
+$:.unshift File.expand_path('../lib', __FILE__)
+require 'rack_cache_tags/version'
+
+Gem::Specification.new do |s|
+ s.name = "rack-cache-tags"
+ s.version = RackCacheTags::VERSION
+ s.authors = ["Sven Fuchs"]
+ s.email = "svenfuchs@artweb-design.de"
+ s.homepage = "http://github.com/svenfuchs/rack-cache-tags"
+ s.summary = "[summary]"
+ s.description = "[description]"
+
+ s.files = Dir.glob("lib/**/**")
+ s.platform = Gem::Platform::RUBY
+ s.require_path = 'lib'
+ s.rubyforge_project = '[none]'
+ s.required_rubygems_version = '>= 1.3.6'
+end
diff --git a/test/method_call_tracking_test.rb b/test/method_call_tracking_test.rb
deleted file mode 100644
index 2a33756..0000000
--- a/test/method_call_tracking_test.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require File.expand_path("#{File.dirname(__FILE__)}/test_setup")
-require 'method_call_tracking'
-
-class Template
- def initialize(locals)
- locals.each { |name, value| instance_variable_set(:"@#{name}", value) }
- end
-end
-
-class Foo
- include MethodCallTracking
- def self.bar; end
- attr_reader :attributes
- def initialize; @attributes = {}; end
- def bar; end
-end
-
-describe 'MethodCallTracking' do
- describe 'setup' do
- before(:each) do
- @foo = Foo.new
- @template = Template.new(:foo => @foo)
- @tracker = MethodCallTracking::Tracker.new
- end
-
- it "with an instance and method definition" do
- @tracker.track(@template, :@foo => :bar)
- @foo.bar
- assert_referenced @foo, :bar
- end
-
- it "with an instance and no method" do
- @tracker.track(@template, :@foo => nil)
- @foo.attributes[:bar]
- assert_referenced @foo
- end
-
- def assert_referenced(object, method = nil)
- assert @tracker.references.any? { |reference|
- reference[0] == object && reference[1] == method
- }, "should reference #{object.inspect}, #{method ? method.inspect : ''} but doesn't"
- end
- end
-end
diff --git a/test/rails/action_controller_test.rb b/test/rails/action_controller_test.rb
deleted file mode 100644
index 3989f65..0000000
--- a/test/rails/action_controller_test.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require File.expand_path("#{File.dirname(__FILE__)}/../test_setup")
-
-require 'rubygems'
-require 'action_controller'
-require 'rack/cache/tags/rails/action_controller'
-
-class Foo
- include MethodCallTracking
- def bar
- 'YAY'
- end
- def cache_tag
- "foo-1"
- end
-end
-
-class FooController < ActionController::Base
- cache_tags :index, :track => { :@foo => :bar }
- def index
- @foo = Foo.new
- render :file => File.expand_path(File.dirname(__FILE__) + '/templates/index.html.erb')
- end
-end
-
-describe 'Rack::Cache::Tags::Rails::ActionController' do
- it "tracks references (method access) to objects assigned to the view" do
- get('/')
- references = @controller.reference_tracker.references
-
- assert_equal "200 OK", @response.status
- assert_equal 1, references.size
- assert_equal Foo, references.first[0].class
- assert_equal :bar, references.first[1]
- end
-
- it "adds an after_filter that adds cache-control, max-age and x-cache-tags headers" do
- get('/')
- assert_equal "foo-1", @response.headers[Rack::Cache::TAGS_HEADER]
- end
-
- it "sends cache-control, max-age and x-cache-tags headers" do
- assert FooController.filter_chain.select { |f| f.type == :after }
- end
-
- def get(path)
- @request = ActionController::Request.new(
- "REQUEST_METHOD" => "GET",
- "REQUEST_URI" => path,
- "rack.input" => "",
- "action_controller.request.path_parameters" => { :action => 'index' }
- )
- @response = ActionController::Response.new
- @controller = FooController.new
- @controller.process(@request, @response)
- end
-end
\ No newline at end of file
diff --git a/test/rails/templates/index.html.erb b/test/rails/templates/index.html.erb
deleted file mode 100644
index 6982b56..0000000
--- a/test/rails/templates/index.html.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-INDEX
-<%= @foo.bar %>
\ No newline at end of file
diff --git a/test/tag_store_test.rb b/test/tag_store_test.rb
deleted file mode 100644
index 00fcfc7..0000000
--- a/test/tag_store_test.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-require File.expand_path("#{File.dirname(__FILE__)}/test_setup")
-
-describe 'Rack::Cache::Tags::Tagstore' do
- describe 'Heap' do
- before(:each) do
- @store = Rack::Cache::Tags::TagStore::Heap.new
- end
-
- it "can be resolved from an uri" do
- tag_store = Rack::Cache::Storage.new.resolve_tagstore_uri('heap:/')
- tag_store.should.be.kind_of Rack::Cache::Tags::TagStore::Heap
- end
-
- it "writes to both read_key and read_tag" do
- @store.store('1234', 'tag-1,tag-2')
-
- @store.read_key('1234').should == ['tag-1', 'tag-2']
- @store.read_tag('tag-1').should == ['1234']
- @store.read_tag('tag-2').should == ['1234']
- @store.read_tag('tag-3').should == []
-
- @store.store('5678', 'tag-1,tag-3')
-
- @store.read_key('1234').should == ['tag-1', 'tag-2']
- @store.read_key('5678').should == ['tag-1', 'tag-3']
- @store.read_tag('tag-1').should == ['1234', '5678']
- @store.read_tag('tag-2').should == ['1234']
- @store.read_tag('tag-3').should == ['5678']
- end
-
- it "purges from both read_key and read_tag" do
- @store.store('1234', 'tag-1,tag-2')
- @store.store('5678', 'tag-1,tag-3')
-
- @store.purge('1234')
-
- @store.read_key('1234').should == []
- @store.read_key('5678').should == ['tag-1', 'tag-3']
- @store.read_tag('tag-1').should == ['5678']
- @store.read_tag('tag-2').should == []
- @store.read_tag('tag-3').should == ['5678']
- end
- end
-
- describe 'File' do
- before(:each) do
- uri = URI.parse("file://#{TMP_DIR}/tagstore")
- @store = Rack::Cache::Tags::TagStore::Disk.resolve(uri)
- end
-
- after(:each) do
- FileUtils.rm_r(TMP_DIR) rescue Errno::ENOENT
- end
-
- it "can be resolved from an uri" do
- tag_store = Rack::Cache::Storage.new.resolve_tagstore_uri("file://#{TMP_DIR}/tagstore")
- tag_store.should.be.kind_of Rack::Cache::Tags::TagStore::Disk
- end
-
- it "writes to both read_key and read_tag" do
- @store.store('1234', 'tag-1,tag-2')
-
- @store.read_key('1234').should == ['tag-1', 'tag-2']
- @store.read_tag('tag-1').should == ['1234']
- @store.read_tag('tag-2').should == ['1234']
- @store.read_tag('tag-3').should == []
-
- @store.store('5678', 'tag-1,tag-3')
-
- @store.read_key('1234').should == ['tag-1', 'tag-2']
- @store.read_key('5678').should == ['tag-1', 'tag-3']
- @store.read_tag('tag-1').should == ['1234', '5678']
- @store.read_tag('tag-2').should == ['1234']
- @store.read_tag('tag-3').should == ['5678']
- end
-
- it "purges from both read_key and read_tag" do
- @store.store('1234', 'tag-1,tag-2')
- @store.store('5678', 'tag-1,tag-3')
-
- @store.purge('1234')
-
- @store.read_key('1234').should == []
- @store.read_key('5678').should == ['tag-1', 'tag-3']
- @store.read_tag('tag-1').should == ['5678']
- @store.read_tag('tag-2').should == []
- @store.read_tag('tag-3').should == ['5678']
- end
- end
-end
\ No newline at end of file
diff --git a/test/tags_test.rb b/test/tags_test.rb
deleted file mode 100644
index 0ecfc3e..0000000
--- a/test/tags_test.rb
+++ /dev/null
@@ -1,116 +0,0 @@
-require File.expand_path("#{File.dirname(__FILE__)}/test_setup")
-
-# When the downstream app sends an X-Cache-Tag header *and* the response is
-# cacheable store taggings for the cache entry
-#
-# When the downstream app sends an X-Cache-Purge-Tags header:
-#
-# * remove the headers
-# * lookup any tagged URIs
-# * set them as X-Cache-Purge headers
-#
-# When a cache entry is purged also purge its taggings.
-
-describe 'Rack::Cache::Tags' do
- before(:each) { setup_cache_context }
- after(:each) { teardown_cache_context }
-
- configs = [
- {
- 'metastore' => 'heap:/',
- 'entitystore' => 'heap:/',
- 'tagstore' => 'heap:/'
- },
- {
- 'metastore' => "file://#{TMP_DIR}/metastore",
- 'entitystore' => "file://#{TMP_DIR}/entitystore",
- 'tagstore' => "file://#{TMP_DIR}/tagstore"
- }
- ]
-
- configs.each do |config|
- it "writes taggings for an entry on :store (#{config[config.keys.first]})" do
- cache_config do |cache|
- config.each { |key, value| cache.options["rack-cache.#{key}"] = value }
- end
- respond_with 200, { 'X-Cache-Tags' => 'page-1,user-2', 'Cache-Control' => 'public, max-age=10000' }, 'body'
-
- response = get '/'
- tagstore.read_key('http://example.org/').should == ['page-1', 'user-2']
- tagstore.read_tag('page-1').should == ['http://example.org/']
- tagstore.read_tag('user-2').should == ['http://example.org/']
- end
-
- # TODO test all three purging methods!
- it "deletes taggings for a key on :purge (using HTTP PURGE)" do
- respond_with 200, { 'Cache-Control' => 'public, max-age=500' }, 'body' do |req, res|
- case req.path
- when '/'
- res.headers['X-Cache-Tags'] = ['page-1,user-2']
- when '/users/2'
- subrequest(:purge, '/')
- end
- end
-
- it_purges_cache_entry_including_tags
- end
-
- it "deletes taggings for a key on :purge (using tag headers)" do
- respond_with 200, { 'Cache-Control' => 'public, max-age=500' }, 'body' do |req, res|
- case req.path
- when '/'
- res.headers['X-Cache-Tags'] = ['page-1,user-2']
- when '/users/2'
- res.headers['X-Cache-Purge-Tags'] = 'user-2'
- end
- end
-
- it_purges_cache_entry_including_tags
- end
-
- it "deletes taggings for a key on :purge (using manual purge)" do
- respond_with 200, { 'Cache-Control' => 'public, max-age=500' }, 'body' do |req, res|
- case req.path
- when '/'
- res.headers['X-Cache-Tags'] = ['page-1,user-2']
- when '/users/2'
- req.env['rack-cache.purger'].purge('http://example.org/')
- end
- end
-
- it_purges_cache_entry_including_tags
- end
- end
-
- def it_purges_cache_entry_including_tags
- get '/'
- tagstore.read_key('http://example.org/').should.include 'user-2'
- cache.trace.should.include :store
-
- get '/'
- cache.trace.should.include :fresh
-
- post '/users/2'
- tagstore.read_key('http://example.org/').should == []
-
- get '/'
- cache.trace.should.include :miss
- end
-
- def subrequest(method, path)
- purge = Rack::Cache::Purge.new(nil, :allow_http_purge => true)
- app = Rack::Cache::Context.new(purge, :tagstore => 'heap:/')
- app.call(
- "REQUEST_METHOD" => method.to_s.upcase,
- "SERVER_NAME" => "example.org",
- "SERVER_PORT" => "80",
- "PATH_INFO" => path,
- "rack.url_scheme" => "http",
- "rack.errors" => StringIO.new
- )
- end
-
- def tagstore
- cache.send(:tagstore)
- end
-end
\ No newline at end of file
diff --git a/test/test_helper.rb b/test/test_helper.rb
new file mode 100644
index 0000000..cb850ff
--- /dev/null
+++ b/test/test_helper.rb
@@ -0,0 +1,39 @@
+$:.unshift File.expand_path('../../lib', __FILE__)
+
+require 'rubygems'
+require 'test/unit'
+require 'test_declarative'
+require 'fileutils'
+require 'active_record'
+require 'logger'
+require 'rack/mock'
+require 'database_cleaner'
+
+require 'rack_cache_tags'
+
+log = '/tmp/rack_cache_tags.log'
+FileUtils.touch(log) unless File.exists?(log)
+
+ActiveRecord::Base.logger = Logger.new(log)
+ActiveRecord::LogSubscriber.attach_to(:active_record)
+ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
+ActiveRecord::Migration.verbose = false
+
+ActiveRecord::Schema.define :version => 0 do
+ create_table :cache_taggings, :force => true do |t|
+ t.string :url
+ t.string :tag
+ end
+end
+
+DatabaseCleaner.strategy = :truncation
+
+class Test::Unit::TestCase
+ def setup
+ DatabaseCleaner.start
+ end
+
+ def teardown
+ DatabaseCleaner.clean
+ end
+end
\ No newline at end of file
diff --git a/test/test_setup.rb b/test/test_setup.rb
deleted file mode 100644
index b03fbe6..0000000
--- a/test/test_setup.rb
+++ /dev/null
@@ -1,111 +0,0 @@
-# test setup largely stolen from Ryan Tomayko's rack-cache
-
-require 'pp'
-require 'fileutils'
-
-begin
- require 'test/spec'
-rescue LoadError => boom
- require 'rubygems' rescue nil
- require 'test/spec'
-end
-
-# Setup the load path ..
-$: << File.expand_path(File.dirname(__FILE__) + '/../../rack-cache/lib')
-$: << File.expand_path(File.dirname(__FILE__) + '/../../rack-cache-purge/lib')
-$: << File.expand_path(File.dirname(__FILE__) + '/../lib')
-$: << File.expand_path(File.dirname(__FILE__))
-
-require 'rack/cache'
-require 'rack/cache/purge'
-require 'rack/cache/tags'
-
-TMP_DIR = File.expand_path(File.dirname(__FILE__) + '/tmp')
-
-# Methods for constructing downstream applications / response
-# generators.
-module CacheContextHelpers
- attr_reader :app, :cache, :tags
-
- def setup_cache_context
- # holds each Rack::Cache::Context
- @app, @cache, @called, @request, @response, @cache_config = nil
- @errors = StringIO.new
- @storage = Rack::Cache::Storage.instance
- end
-
- def teardown_cache_context
- FileUtils.rm_r(TMP_DIR) rescue Errno::ENOENT
- @storage.clear
- end
-
- def cache_config(&cache_config)
- @cache_config = cache_config
- end
-
- # A basic response with 200 status code and a tiny body.
- def respond_with(status=200, headers={}, body=['Hello World'])
- called = false
- @app = lambda do |env|
- called = true
- response = Rack::Response.new(body, status, headers)
- request = Rack::Request.new(env)
- yield request, response if block_given?
- response.finish
- end
- @app.meta_def(:called?) { called }
- @app.meta_def(:reset!) { called = false }
- @app
- end
-
- def request(method, uri = '/', env = {})
- fail 'response not specified (use respond_with)' if @app.nil?
- @app.reset! if @app.respond_to?(:reset!)
-
- @tags = Rack::Cache::Tags.new(@app)
- @purge = Rack::Cache::Purge.new(@tags, :allow_http_purge => true)
- @cache = Rack::Cache::Context.new(@purge, :tagstore => 'heap:/', &@cache_config)
- @request = Rack::MockRequest.new(@cache)
-
- env = { 'rack.run_once' => true }.merge(env)
-
- @response = @request.request(method.to_s.upcase, uri, env)
- end
-
- def get(stem, env={}, &b)
- request(:get, stem, env, &b)
- end
-
- def head(stem, env={}, &b)
- request(:head, stem, env, &b)
- end
-
- def post(*args, &b)
- request(:post, *args, &b)
- end
-end
-
-class Test::Unit::TestCase
- include CacheContextHelpers
-end
-
-# Metaid == a few simple metaclass helper
-# (See http://whytheluckystiff.net/articles/seeingMetaclassesClearly.html.)
-class Object
- # The hidden singleton lurks behind everyone
- def metaclass; class << self; self; end; end
- def meta_eval(&blk); metaclass.instance_eval(&blk); end
- # Adds methods to a metaclass
- def meta_def name, &blk
- meta_eval { define_method name, &blk }
- end
- # Defines an instance method within a class
- def class_def name, &blk
- class_eval { define_method name, &blk }
- end
-
- # True when the Object is neither false or nil.
- def truthy?
- !!self
- end
-end
diff --git a/test/test_store.rb b/test/test_store.rb
new file mode 100644
index 0000000..425e80e
--- /dev/null
+++ b/test/test_store.rb
@@ -0,0 +1,4 @@
+require File.expand_path('../test_helper', __FILE__)
+
+class StoreTest < Test::Unit::TestCase
+end
\ No newline at end of file
diff --git a/test/test_tags.rb b/test/test_tags.rb
new file mode 100644
index 0000000..aed6706
--- /dev/null
+++ b/test/test_tags.rb
@@ -0,0 +1,41 @@
+require File.expand_path('../test_helper', __FILE__)
+
+class TagsTest < Test::Unit::TestCase
+ include Rack::Cache::Tags::Store
+
+ test 'stores tags for the current url' do
+ url = 'http://example.com/foo'
+ headers = { Rack::Cache::Tags::TAGS_HEADER => %w(foo-1 bar-2) }
+ tags = Rack::Cache::Tags.new(lambda { |env| [200, headers, ''] })
+
+ tags.call(env_for(url))
+ actual = ActiveRecord::Tagging.all.map { |tagging| [tagging.url, tagging.tag] }
+ assert_equal [%W(#{url} foo-1), %W(#{url} bar-2)], actual
+ end
+
+ test 'expands tags to urls for purge headers and deletes the tagging' do
+ create_tags('http://example.com/foo', %w(foo-1 foo-2))
+ create_tags('http://example.com/bar', %w(foo-1))
+ create_tags('http://example.com/baz', %w(baz-1))
+
+ headers = { Rack::Cache::Tags::PURGE_TAGS_HEADER => %w(foo-1) }
+ tags = Rack::Cache::Tags.new(lambda { |env| [200, headers, ''] })
+
+ status, headers, body = tags.call(env_for('http://example.com'))
+
+ actual = ActiveRecord::Tagging.all.map { |tagging| [tagging.url, tagging.tag] }
+ assert_equal [%w(http://example.com/baz baz-1)], actual
+
+ assert_equal %w(http://example.com/foo http://example.com/bar), headers[Rack::Cache::Tags::PURGE_HEADER]
+ end
+
+ protected
+
+ def create_tags(url, tags)
+ tags.each { |tag| ActiveRecord::Tagging.create!(:url => url, :tag => tag) }
+ end
+
+ def env_for(*args)
+ Rack::MockRequest.env_for(*args)
+ end
+end
\ No newline at end of file
|
svenfuchs/rack-cache-tags
|
5dc2657c9a0e76f868eb6735e1d5a82025d5508c
|
add method call tracking and rails/action_controller adapter
|
diff --git a/lib/method_call_tracking.rb b/lib/method_call_tracking.rb
new file mode 100644
index 0000000..01ca903
--- /dev/null
+++ b/lib/method_call_tracking.rb
@@ -0,0 +1,88 @@
+# Simple mechanism to track calls on methods.
+#
+# Include the module and call track_methods(an_array, :foo, :bar) on any object.
+# This will set up the methods :foo and :bar on the object's metaclass.
+#
+# When the method :foo is called for the first time this is recorded to the
+# given array and the method is removed from the metaclass (so it only records
+# the) first call. The given array will then equal [[the_object, :foo]].
+module MethodCallTracking
+ def track_method_calls(tracker, *methods)
+ if methods.empty?
+ # FIXME this assumes ActiveRecord
+ define_track_method(tracker, @attributes, :[], [self, nil])
+ else
+ methods.each do |method|
+ define_track_method(tracker, self, method, [self, method])
+ end
+ end
+ end
+
+ # Sets up a method in the meta class of the target object which will save
+ # a reference when the method is called first, then removes itself and
+ # delegates to the regular method in the class. (Cheap method proxy pattern
+ # that leverages Ruby's way of looking up a method in the meta class first
+ # and then in the regular class second.)
+ def define_track_method(tracker, target, method, reference)
+ meta_class = class << target; self; end
+ meta_class.send :define_method, method do |*args|
+ tracker << reference
+ meta_class.send(:remove_method, method)
+ super
+ end
+ end
+
+ # Tracks method access on trackable objects. Trackables can be given as
+ #
+ # * instance variable names (when starting with an @)
+ # * method names (otherwise)
+ # * Hashes that use ivar or method names as keys and method names as values:
+ #
+ # So both of these:
+ #
+ # Tracker.new controller, :'@foo', :bar, { :'@baz' => :buz }
+ # Tracker.new controller, :'@foo', :bar, { :'@baz' => [:buz] }
+ #
+ # would set up access tracking for the controller's ivar @foo, the method :bar
+ # and the method :buz on the ivar @baz.
+ class Tracker
+ attr_reader :references
+
+ def initialize
+ @references = []
+ end
+
+ def track(owner, *trackables)
+ trackables.each do |trackable|
+ trackable = { trackable => nil } unless trackable.is_a?(Hash)
+ trackable.each do |trackable, methods|
+ trackable = resolve_trackable(owner, trackable)
+ track_methods(trackable, methods) unless trackable.nil? # FIXME issue warning
+ end
+ end
+ end
+
+ protected
+
+ # Resolves the trackable by looking it up on the owner. Trackables will be
+ # interpreted as instance variables when they start with an @ and as method
+ # names otherwise.
+ def resolve_trackable(owner, trackable)
+ case trackable.to_s
+ when /^@/; owner.instance_variable_get(trackable.to_sym)
+ else owner.send(trackable.to_sym)
+ end
+ end
+
+ # Wraps the trackable into a MethodReadObserver and registers itself as an observer.
+ # Sets up tracking for the read_attribute method when the methods argument is nil.
+ # Sets up tracking for any other given methods otherwise.
+ def track_methods(trackable, methods)
+ if trackable.is_a?(Array)
+ trackable.each { |trackable| track_methods(trackable, methods) }
+ else
+ trackable.track_method_calls(references, *Array(methods))
+ end
+ end
+ end
+end
diff --git a/lib/rack/cache/tags/rails/action_controller.rb b/lib/rack/cache/tags/rails/action_controller.rb
new file mode 100644
index 0000000..5614639
--- /dev/null
+++ b/lib/rack/cache/tags/rails/action_controller.rb
@@ -0,0 +1,110 @@
+require 'method_call_tracking'
+
+module Rack::Cache::Tags
+ module Rails
+ module ActionController
+ module ActMacro
+ # ...
+ #
+ # cache_tags :index, :show, :track => ['@article', '@articles', {'@site' => :tag_counts}]
+ #
+ def cache_tags(*actions)
+ tracks_references(*actions)
+
+ unless caches_page_with_references?
+ alias_method_chain :caching_allowed, :skipping
+ end
+
+ # options = actions.extract_options!
+ after_filter(:only => actions) { |c| c.cache_control }
+ end
+
+ # Sets up reference tracking for given actions and objects
+ #
+ # tracks_references :index, :show, :track => ['@article', '@articles', {'@site' => :tag_counts}]
+ #
+ def tracks_references(*actions)
+ unless tracks_references?
+ include Rack::Cache::Tags::Rails::ActionController
+
+ # helper_method :cached_references
+ # attr_writer :cached_references
+ alias_method_chain :render, :reference_tracking
+
+ class_inheritable_accessor :track_references_to
+ self.track_references_to = []
+
+ class_inheritable_accessor :track_references_on
+ self.track_references_on = []
+ end
+
+ options = actions.extract_options!
+ track = options[:track]
+
+ self.track_references_to += track.is_a?(Array) ? track : [track]
+ self.track_references_to.uniq!
+ self.track_references_on = actions
+ end
+
+ def caches_page_with_references?
+ method_defined? :caching_allowed_without_skipping
+ end
+
+ def tracks_references?
+ method_defined? :render_without_reference_tracking
+ end
+ end
+
+ attr_reader :reference_tracker
+
+ def cache_control
+ if perform_caching && caching_allowed
+ expires_in(10.years.from_now, :public => true)
+ set_cache_tags
+ end
+ end
+
+ def skip_caching!
+ @skip_caching = true
+ end
+
+ def skip_caching?
+ @skip_caching == true
+ end
+
+ protected
+
+ def render_with_reference_tracking(*args, &block)
+ args << options = args.extract_options!
+ skip_caching! if options.delete(:skip_caching) || !cacheable_action?
+
+ setup_reference_tracking if perform_caching && caching_allowed
+ render_without_reference_tracking(*args, &block)
+ end
+
+ def cacheable_action?
+ action = params[:action] || ''
+ self.class.track_references_on.include?(action.to_sym)
+ end
+
+ def setup_reference_tracking
+ trackables = self.class.track_references_to || {}
+ @reference_tracker ||= MethodCallTracking::Tracker.new
+ @reference_tracker.track(self, *trackables.clone)
+ end
+
+ def set_cache_tags
+ cache_tags = @reference_tracker.references.map do |reference|
+ reference.first.cache_tag
+ end
+ response.headers[Rack::Cache::TAGS_HEADER] = cache_tags.join(',') unless cache_tags.empty?
+ end
+
+ def caching_allowed_with_skipping
+ caching_allowed_without_skipping && !skip_caching?
+ end
+
+ ::ActionController::Base.send(:extend, ActMacro)
+ end
+ end
+end
\ No newline at end of file
diff --git a/test/method_call_tracking_test.rb b/test/method_call_tracking_test.rb
new file mode 100644
index 0000000..2a33756
--- /dev/null
+++ b/test/method_call_tracking_test.rb
@@ -0,0 +1,44 @@
+require File.expand_path("#{File.dirname(__FILE__)}/test_setup")
+require 'method_call_tracking'
+
+class Template
+ def initialize(locals)
+ locals.each { |name, value| instance_variable_set(:"@#{name}", value) }
+ end
+end
+
+class Foo
+ include MethodCallTracking
+ def self.bar; end
+ attr_reader :attributes
+ def initialize; @attributes = {}; end
+ def bar; end
+end
+
+describe 'MethodCallTracking' do
+ describe 'setup' do
+ before(:each) do
+ @foo = Foo.new
+ @template = Template.new(:foo => @foo)
+ @tracker = MethodCallTracking::Tracker.new
+ end
+
+ it "with an instance and method definition" do
+ @tracker.track(@template, :@foo => :bar)
+ @foo.bar
+ assert_referenced @foo, :bar
+ end
+
+ it "with an instance and no method" do
+ @tracker.track(@template, :@foo => nil)
+ @foo.attributes[:bar]
+ assert_referenced @foo
+ end
+
+ def assert_referenced(object, method = nil)
+ assert @tracker.references.any? { |reference|
+ reference[0] == object && reference[1] == method
+ }, "should reference #{object.inspect}, #{method ? method.inspect : ''} but doesn't"
+ end
+ end
+end
diff --git a/test/rails/action_controller_test.rb b/test/rails/action_controller_test.rb
new file mode 100644
index 0000000..3989f65
--- /dev/null
+++ b/test/rails/action_controller_test.rb
@@ -0,0 +1,56 @@
+require File.expand_path("#{File.dirname(__FILE__)}/../test_setup")
+
+require 'rubygems'
+require 'action_controller'
+require 'rack/cache/tags/rails/action_controller'
+
+class Foo
+ include MethodCallTracking
+ def bar
+ 'YAY'
+ end
+ def cache_tag
+ "foo-1"
+ end
+end
+
+class FooController < ActionController::Base
+ cache_tags :index, :track => { :@foo => :bar }
+ def index
+ @foo = Foo.new
+ render :file => File.expand_path(File.dirname(__FILE__) + '/templates/index.html.erb')
+ end
+end
+
+describe 'Rack::Cache::Tags::Rails::ActionController' do
+ it "tracks references (method access) to objects assigned to the view" do
+ get('/')
+ references = @controller.reference_tracker.references
+
+ assert_equal "200 OK", @response.status
+ assert_equal 1, references.size
+ assert_equal Foo, references.first[0].class
+ assert_equal :bar, references.first[1]
+ end
+
+ it "adds an after_filter that adds cache-control, max-age and x-cache-tags headers" do
+ get('/')
+ assert_equal "foo-1", @response.headers[Rack::Cache::TAGS_HEADER]
+ end
+
+ it "sends cache-control, max-age and x-cache-tags headers" do
+ assert FooController.filter_chain.select { |f| f.type == :after }
+ end
+
+ def get(path)
+ @request = ActionController::Request.new(
+ "REQUEST_METHOD" => "GET",
+ "REQUEST_URI" => path,
+ "rack.input" => "",
+ "action_controller.request.path_parameters" => { :action => 'index' }
+ )
+ @response = ActionController::Response.new
+ @controller = FooController.new
+ @controller.process(@request, @response)
+ end
+end
\ No newline at end of file
diff --git a/test/rails/templates/index.html.erb b/test/rails/templates/index.html.erb
new file mode 100644
index 0000000..6982b56
--- /dev/null
+++ b/test/rails/templates/index.html.erb
@@ -0,0 +1,2 @@
+INDEX
+<%= @foo.bar %>
\ No newline at end of file
|
svenfuchs/rack-cache-tags
|
bf23b6b41a589f1ae4749d5de8bcf2b4623ad262
|
add a Disk tagstore implementation, refactor Heap implementation
|
diff --git a/lib/core_ext/file_utils/rmdir_p.rb b/lib/core_ext/file_utils/rmdir_p.rb
new file mode 100644
index 0000000..a8d2bb4
--- /dev/null
+++ b/lib/core_ext/file_utils/rmdir_p.rb
@@ -0,0 +1,14 @@
+require 'fileutils'
+
+module FileUtils
+ def self.rmdir_p(path)
+ begin
+ while(true)
+ FileUtils.rmdir(path)
+ path = File.dirname(path)
+ end
+ rescue Errno::EEXIST, Errno::ENOTEMPTY, Errno::ENOENT, Errno::EINVAL, Errno::ENOTDIR
+ # Stop trying to remove parent directories
+ end
+ end
+end
\ No newline at end of file
diff --git a/lib/rack/cache/tags.rb b/lib/rack/cache/tags.rb
index 213b136..4080a49 100644
--- a/lib/rack/cache/tags.rb
+++ b/lib/rack/cache/tags.rb
@@ -1,36 +1,41 @@
require 'uri'
require 'rack/cache'
require 'rack/cache/storage'
require 'rack/cache/utils'
require 'rack/cache/tags/context'
require 'rack/cache/tags/storage'
require 'rack/cache/tags/tag_store'
require 'rack/cache/tags/meta_store'
+require 'rack/cache/tags/purger'
module Rack::Cache
TAGS_HEADER = 'X-Cache-Tags'
PURGE_TAGS_HEADER = 'X-Cache-Purge-Tags'
Context.class_eval do
option_accessor :tagstore
def tagstore
uri = options['rack-cache.tagstore']
storage.resolve_tagstore_uri(uri)
end
end
+ Purge::Purger.class_eval do
+ include Tags::Purger
+ end
+
module Tags
class << self
def new(backend, options={}, &b)
Context.new(backend, options, &b)
end
def normalize(tags)
Array(tags).join(',').split(',').map { |tag| tag.strip }
end
end
end
end
\ No newline at end of file
diff --git a/lib/rack/cache/tags/context.rb b/lib/rack/cache/tags/context.rb
index 8763d09..bfa367d 100644
--- a/lib/rack/cache/tags/context.rb
+++ b/lib/rack/cache/tags/context.rb
@@ -1,48 +1,54 @@
module Rack::Cache::Tags
class Context
def initialize(backend, options = {})
@backend = backend
@options = options
yield self if block_given?
end
def call(env)
@env = env
request = Rack::Cache::Request.new(env)
response = Rack::Cache::Response.new(*@backend.call(env))
-
+
tags = response.headers.delete(Rack::Cache::PURGE_TAGS_HEADER)
- if tags
- tags = Rack::Cache::Tags.normalize(tags)
- uris = tagged_uris(tags)
- response.headers[Rack::Cache::PURGE_HEADER] = uris.join("\n")
-
+ return response.to_a unless tags
+
+ uris = tagged_uris(tags)
+ if false && env.key?('rack-cache.purger')
+ # TODO directly purge using uris?
+ else
+ set_purge_header(response, uris)
purge_taggings(request, uris)
end
response.to_a
end
protected
-
+
def tagged_uris(tags)
- tags.inject([]) { |uris, tag| uris + tagstore.by_tag[tag] }
+ tags = Rack::Cache::Tags.normalize(tags)
+ tags.inject([]) { |uris, tag| uris + tagstore.read_tag(tag) }
end
-
+
+ def set_purge_header(response, uris)
+ response.headers[Rack::Cache::PURGE_HEADER] = uris.join("\n")
+ end
+
def purge_taggings(request, uris)
- uris.each do |uri|
- key = Rack::Cache::Utils::Key.call(request, uri)
- tagstore.purge(key)
- end
+ tagstore = self.tagstore
+ keys = uris.map { |uri| Rack::Cache::Utils::Key.call(request, uri) }
+ keys.each { |key| tagstore.purge(key) }
end
-
+
def tagstore
uri = @env['rack-cache.tagstore']
storage.resolve_tagstore_uri(uri)
end
-
+
def storage
Rack::Cache::Storage.instance
end
end
end
\ No newline at end of file
diff --git a/lib/rack/cache/tags/meta_store.rb b/lib/rack/cache/tags/meta_store.rb
index 9d9ce70..f37ec61 100644
--- a/lib/rack/cache/tags/meta_store.rb
+++ b/lib/rack/cache/tags/meta_store.rb
@@ -1,19 +1,22 @@
-Rack::Cache::MetaStore::Heap.class_eval do
+module Rack::Cache::Tags::MetaStore
def store(request, response, entity_store)
key = super
tags = response.headers[Rack::Cache::TAGS_HEADER]
tagstore(request).store(key, tags) if tags
-
+
key
end
-
+
def tagstore(request)
uri = request.env['rack-cache.tagstore']
storage.resolve_tagstore_uri(uri)
end
def storage
Rack::Cache::Storage.instance
end
+
+ Rack::Cache::MetaStore::Heap.send(:include, self)
+ Rack::Cache::MetaStore::Disk.send(:include, self)
end
diff --git a/lib/rack/cache/tags/purger.rb b/lib/rack/cache/tags/purger.rb
new file mode 100644
index 0000000..a1b6b3a
--- /dev/null
+++ b/lib/rack/cache/tags/purger.rb
@@ -0,0 +1,18 @@
+module Rack
+ module Cache
+ module Tags
+ module Purger
+ def purge(arg)
+ keys = super
+ tagstore = self.tagstore
+ keys.each { |key| tagstore.purge(key) }
+ end
+
+ def tagstore
+ uri = context.env['rack-cache.tagstore']
+ storage.resolve_tagstore_uri(uri)
+ end
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/lib/rack/cache/tags/tag_store.rb b/lib/rack/cache/tags/tag_store.rb
index dbc4353..94ef8f7 100644
--- a/lib/rack/cache/tags/tag_store.rb
+++ b/lib/rack/cache/tags/tag_store.rb
@@ -1,75 +1,177 @@
-require 'fileutils'
-require 'digest/sha1'
require 'rack/utils'
+require 'digest/sha1'
+require 'fileutils'
+require 'core_ext/file_utils/rmdir_p'
module Rack::Cache::Tags
class TagStore
- def store(key, tags)
- tags = Rack::Cache::Tags.normalize(tags)
- write(key, tags)
- end
-
- def by_key(key)
- raise NotImplemented
+ def read_key(key)
+ key(key).read
end
- def by_tag(tag)
- raise NotImplemented
+ def read_tag(tag)
+ tag(tag).read
end
- protected
-
- def write(key, tags)
- raise NotImplemented
+ def store(key, tags)
+ tags = Rack::Cache::Tags.normalize(tags)
+ key(key, tags).store.each { |tag| read_tag(tag).add(key) }
end
def purge(key)
- raise NotImplemented
+ read_key(key).purge.each { |tag| read_tag(tag).remove(key) }
end
- public
+ public
- class Heap < TagStore
- def self.resolve(uri)
- new
- end
-
- def initialize
- @hash = { :by_key => {}, :by_tag => {} }
- end
-
- def by_key
- @hash[:by_key]
- end
-
- def by_tag
- @hash[:by_tag]
- end
+ class Heap < TagStore
+ def self.resolve(uri)
+ new
+ end
+
+ def initialize
+ @by_key, @by_tag = {}, {}
+ end
+
+ def key(key, tags = [])
+ Collection.new(@by_key, :key, key, tags)
+ end
+
+ def tag(tag, keys = [])
+ Collection.new(@by_tag, :tag, tag, keys)
+ end
+
+ class Collection < Array
+ attr_reader :type, :owner, :hash
+
+ def initialize(hash, type, owner, elements = [])
+ @hash, @type, @owner = hash, type, owner
+ super(elements) if elements
+ compact
+ end
+
+ def add(element)
+ return if element.nil? or include?(element)
+ push(element)
+ store
+ end
+
+ def remove(element)
+ store if delete(element)
+ self
+ end
+
+ def purge
+ hash.delete(owner)
+ self
+ end
+
+ def exist?
+ hash.key?(owner)
+ end
- def purge(key)
- if tags = by_key[key]
- tags.each do |tag|
- next unless by_tag[tag]
- by_tag[tag].delete(key)
- by_tag.delete(tag) if by_tag[tag].empty?
+ def read
+ replace(hash[owner] || [])
+ self
+ end
+
+ def store
+ return purge if empty?
+ hash[owner] = self
end
end
-
- by_key.delete(key)
- nil
end
- def write(key, tags)
- by_key[key] = tags
+ HEAP = Heap
+ MEM = HEAP
+
+ class Disk < TagStore
+ def self.resolve(uri)
+ path = File.expand_path(uri.opaque || uri.path)
+ new(path)
+ end
+
+ def initialize(root)
+ @root = root
+ FileUtils.mkdir_p root, :mode => 0755
+ end
+
+ def key(key, tags = [])
+ Collection.new(@root, :key, key, tags)
+ end
- tags.each do |tag|
- by_tag[tag] ||= []
- by_tag[tag] << key unless by_tag[tag].include?(key)
+ def tag(tag, keys = [])
+ Collection.new(@root, :tag, tag, keys)
+ end
+
+ class Collection < Array
+ attr_reader :type, :owner, :root
+
+ def initialize(root, type, owner, elements)
+ @root, @type, @owner = root, type, owner
+ super(elements) if elements
+ compact
+ end
+
+ def add(element)
+ return if element.nil? or include?(element)
+ push(element)
+ store
+ end
+
+ def remove(element)
+ store if delete(element)
+ self
+ end
+
+ def purge
+ File.unlink(path) rescue Errno::ENOENT
+ FileUtils.rmdir_p(File.dirname(path))
+ self
+ end
+
+ def exist?
+ File.exist?(path)
+ end
+
+ def read
+ replace(read_file.split(','))
+ self
+ rescue Errno::ENOENT
+ self
+ end
+
+ def store
+ return purge if empty?
+
+ FileUtils.mkdir_p(File.dirname(path), :mode => 0755)
+ File.open(path, 'wb') { |f| f.write(join(',')) }
+ self
+ end
+
+ protected
+
+ def read_file
+ File.open(path, 'rb') { |f| f.read }
+ end
+
+ def path
+ File.join(root, "by_#{type}", spread(owner))
+ end
+
+ def digest(key)
+ Digest::SHA1.hexdigest(key)
+ end
+
+ def spread(arg)
+ arg = digest(arg)
+ arg[2, 0] = '/'
+ arg
+ end
end
end
- end
- HEAP = Heap
- MEM = HEAP
+ DISK = Disk
+ FILE = Disk
end
end
\ No newline at end of file
diff --git a/test/tag_store_test.rb b/test/tag_store_test.rb
index 9dde78b..00fcfc7 100644
--- a/test/tag_store_test.rb
+++ b/test/tag_store_test.rb
@@ -1,43 +1,90 @@
-require "#{File.dirname(__FILE__)}/test_setup"
+require File.expand_path("#{File.dirname(__FILE__)}/test_setup")
describe 'Rack::Cache::Tags::Tagstore' do
- before(:each) do
- @store = Rack::Cache::Tags::TagStore::Heap.new
- end
-
- it "can be resolved from an uri" do
- tag_store = Rack::Cache::Storage.new.resolve_tagstore_uri('heap:/')
- tag_store.should.be.kind_of Rack::Cache::Tags::TagStore::Heap
- end
+ describe 'Heap' do
+ before(:each) do
+ @store = Rack::Cache::Tags::TagStore::Heap.new
+ end
+
+ it "can be resolved from an uri" do
+ tag_store = Rack::Cache::Storage.new.resolve_tagstore_uri('heap:/')
+ tag_store.should.be.kind_of Rack::Cache::Tags::TagStore::Heap
+ end
+
+ it "writes to both read_key and read_tag" do
+ @store.store('1234', 'tag-1,tag-2')
+
+ @store.read_key('1234').should == ['tag-1', 'tag-2']
+ @store.read_tag('tag-1').should == ['1234']
+ @store.read_tag('tag-2').should == ['1234']
+ @store.read_tag('tag-3').should == []
- it "writes to both by_key and by_tag" do
- @store.store('1234', 'tag-1,tag-2')
-
- @store.by_key['1234'].should == ['tag-1', 'tag-2']
- @store.by_tag['tag-1'].should == ['1234']
- @store.by_tag['tag-2'].should == ['1234']
- @store.by_tag['tag-3'].should == nil
-
- @store.store('5678', 'tag-1,tag-3')
-
- @store.by_key['1234'].should == ['tag-1', 'tag-2']
- @store.by_key['5678'].should == ['tag-1', 'tag-3']
- @store.by_tag['tag-1'].should == ['1234', '5678']
- @store.by_tag['tag-2'].should == ['1234']
- @store.by_tag['tag-3'].should == ['5678']
+ @store.store('5678', 'tag-1,tag-3')
+
+ @store.read_key('1234').should == ['tag-1', 'tag-2']
+ @store.read_key('5678').should == ['tag-1', 'tag-3']
+ @store.read_tag('tag-1').should == ['1234', '5678']
+ @store.read_tag('tag-2').should == ['1234']
+ @store.read_tag('tag-3').should == ['5678']
+ end
+
+ it "purges from both read_key and read_tag" do
+ @store.store('1234', 'tag-1,tag-2')
+ @store.store('5678', 'tag-1,tag-3')
+
+ @store.purge('1234')
+
+ @store.read_key('1234').should == []
+ @store.read_key('5678').should == ['tag-1', 'tag-3']
+ @store.read_tag('tag-1').should == ['5678']
+ @store.read_tag('tag-2').should == []
+ @store.read_tag('tag-3').should == ['5678']
+ end
end
-
- it "purges from both by_key and by_tag" do
- @store.store('1234', 'tag-1,tag-2')
- @store.store('5678', 'tag-1,tag-3')
-
- @store.purge('1234')
-
- @store.by_key['1234'].should == nil
- @store.by_key['5678'].should == ['tag-1', 'tag-3']
- @store.by_tag['tag-1'].should == ['5678']
- @store.by_tag['tag-2'].should == nil
- @store.by_tag['tag-3'].should == ['5678']
+
+ describe 'File' do
+ before(:each) do
+ uri = URI.parse("file://#{TMP_DIR}/tagstore")
+ @store = Rack::Cache::Tags::TagStore::Disk.resolve(uri)
+ end
+
+ after(:each) do
+ FileUtils.rm_r(TMP_DIR) rescue Errno::ENOENT
+ end
+
+ it "can be resolved from an uri" do
+ tag_store = Rack::Cache::Storage.new.resolve_tagstore_uri("file://#{TMP_DIR}/tagstore")
+ tag_store.should.be.kind_of Rack::Cache::Tags::TagStore::Disk
+ end
+
+ it "writes to both read_key and read_tag" do
+ @store.store('1234', 'tag-1,tag-2')
+
+ @store.read_key('1234').should == ['tag-1', 'tag-2']
+ @store.read_tag('tag-1').should == ['1234']
+ @store.read_tag('tag-2').should == ['1234']
+ @store.read_tag('tag-3').should == []
+
+ @store.store('5678', 'tag-1,tag-3')
+
+ @store.read_key('1234').should == ['tag-1', 'tag-2']
+ @store.read_key('5678').should == ['tag-1', 'tag-3']
+ @store.read_tag('tag-1').should == ['1234', '5678']
+ @store.read_tag('tag-2').should == ['1234']
+ @store.read_tag('tag-3').should == ['5678']
+ end
+
+ it "purges from both read_key and read_tag" do
+ @store.store('1234', 'tag-1,tag-2')
+ @store.store('5678', 'tag-1,tag-3')
+
+ @store.purge('1234')
+
+ @store.read_key('1234').should == []
+ @store.read_key('5678').should == ['tag-1', 'tag-3']
+ @store.read_tag('tag-1').should == ['5678']
+ @store.read_tag('tag-2').should == []
+ @store.read_tag('tag-3').should == ['5678']
+ end
end
-
end
\ No newline at end of file
diff --git a/test/tags_test.rb b/test/tags_test.rb
index 4deb485..0ecfc3e 100644
--- a/test/tags_test.rb
+++ b/test/tags_test.rb
@@ -1,43 +1,116 @@
-require "#{File.dirname(__FILE__)}/test_setup"
+require File.expand_path("#{File.dirname(__FILE__)}/test_setup")
+
+# When the downstream app sends an X-Cache-Tag header *and* the response is
+# cacheable store taggings for the cache entry
+#
+# When the downstream app sends an X-Cache-Purge-Tags header:
+#
+# * remove the headers
+# * lookup any tagged URIs
+# * set them as X-Cache-Purge headers
+#
+# When a cache entry is purged also purge its taggings.
describe 'Rack::Cache::Tags' do
before(:each) { setup_cache_context }
after(:each) { teardown_cache_context }
- it "writes tags for a key on :store" do
- respond_with 200, { 'X-Cache-Tags' => 'page-1,user-2', 'Cache-Control' => 'public, max-age=10000' }, 'body'
+ configs = [
+ {
+ 'metastore' => 'heap:/',
+ 'entitystore' => 'heap:/',
+ 'tagstore' => 'heap:/'
+ },
+ {
+ 'metastore' => "file://#{TMP_DIR}/metastore",
+ 'entitystore' => "file://#{TMP_DIR}/entitystore",
+ 'tagstore' => "file://#{TMP_DIR}/tagstore"
+ }
+ ]
- response = get '/'
- tagstore.by_key.should == { 'http://example.org/' => ['page-1', 'user-2'] }
- tagstore.by_tag.should == { 'page-1' => ['http://example.org/'], 'user-2' => ['http://example.org/'] }
- end
+ configs.each do |config|
+ it "writes taggings for an entry on :store (#{config[config.keys.first]})" do
+ cache_config do |cache|
+ config.each { |key, value| cache.options["rack-cache.#{key}"] = value }
+ end
+ respond_with 200, { 'X-Cache-Tags' => 'page-1,user-2', 'Cache-Control' => 'public, max-age=10000' }, 'body'
+
+ response = get '/'
+ tagstore.read_key('http://example.org/').should == ['page-1', 'user-2']
+ tagstore.read_tag('page-1').should == ['http://example.org/']
+ tagstore.read_tag('user-2').should == ['http://example.org/']
+ end
- it "deletes tags for a key on :purge" do
- respond_with 200, { 'Cache-Control' => 'public, max-age=10000' }, 'body'
- respond_with 200, { 'Cache-Control' => 'public, max-age=500' }, 'body' do |req, res|
- case req.path
- when '/'
- res.headers['X-Cache-Tags'] = ['page-1,user-2']
- when '/users/2'
- res.headers['X-Cache-Purge-Tags'] = 'user-2'
+ # TODO test all three purging methods!
+ it "deletes taggings for a key on :purge (using HTTP PURGE)" do
+ respond_with 200, { 'Cache-Control' => 'public, max-age=500' }, 'body' do |req, res|
+ case req.path
+ when '/'
+ res.headers['X-Cache-Tags'] = ['page-1,user-2']
+ when '/users/2'
+ subrequest(:purge, '/')
+ end
end
+
+ it_purges_cache_entry_including_tags
end
+ it "deletes taggings for a key on :purge (using tag headers)" do
+ respond_with 200, { 'Cache-Control' => 'public, max-age=500' }, 'body' do |req, res|
+ case req.path
+ when '/'
+ res.headers['X-Cache-Tags'] = ['page-1,user-2']
+ when '/users/2'
+ res.headers['X-Cache-Purge-Tags'] = 'user-2'
+ end
+ end
+
+ it_purges_cache_entry_including_tags
+ end
+
+ it "deletes taggings for a key on :purge (using manual purge)" do
+ respond_with 200, { 'Cache-Control' => 'public, max-age=500' }, 'body' do |req, res|
+ case req.path
+ when '/'
+ res.headers['X-Cache-Tags'] = ['page-1,user-2']
+ when '/users/2'
+ req.env['rack-cache.purger'].purge('http://example.org/')
+ end
+ end
+
+ it_purges_cache_entry_including_tags
+ end
+ end
+
+ def it_purges_cache_entry_including_tags
get '/'
- tagstore.by_key['http://example.org/'].should.include 'user-2'
+ tagstore.read_key('http://example.org/').should.include 'user-2'
cache.trace.should.include :store
get '/'
cache.trace.should.include :fresh
post '/users/2'
- tagstore.by_key['http://example.org/'].should.be.nil
+ tagstore.read_key('http://example.org/').should == []
get '/'
cache.trace.should.include :miss
end
+ def subrequest(method, path)
+ purge = Rack::Cache::Purge.new(nil, :allow_http_purge => true)
+ app = Rack::Cache::Context.new(purge, :tagstore => 'heap:/')
+ app.call(
+ "REQUEST_METHOD" => method.to_s.upcase,
+ "SERVER_NAME" => "example.org",
+ "SERVER_PORT" => "80",
+ "PATH_INFO" => path,
+ "rack.url_scheme" => "http",
+ "rack.errors" => StringIO.new
+ )
+ end
+
def tagstore
cache.send(:tagstore)
end
end
\ No newline at end of file
diff --git a/test/test_setup.rb b/test/test_setup.rb
index cc2ecc9..b03fbe6 100644
--- a/test/test_setup.rb
+++ b/test/test_setup.rb
@@ -1,124 +1,111 @@
# test setup largely stolen from Ryan Tomayko's rack-cache
require 'pp'
+require 'fileutils'
begin
require 'test/spec'
rescue LoadError => boom
require 'rubygems' rescue nil
require 'test/spec'
end
# Setup the load path ..
-$: << File.dirname(File.dirname(__FILE__)) + '/../rack-cache/lib'
-$: << File.dirname(File.dirname(__FILE__)) + '/../rack-cache-purge/lib'
-$: << File.dirname(File.dirname(__FILE__)) + '/lib'
-$: << File.dirname(__FILE__)
+$: << File.expand_path(File.dirname(__FILE__) + '/../../rack-cache/lib')
+$: << File.expand_path(File.dirname(__FILE__) + '/../../rack-cache-purge/lib')
+$: << File.expand_path(File.dirname(__FILE__) + '/../lib')
+$: << File.expand_path(File.dirname(__FILE__))
require 'rack/cache'
require 'rack/cache/purge'
require 'rack/cache/tags'
+TMP_DIR = File.expand_path(File.dirname(__FILE__) + '/tmp')
+
# Methods for constructing downstream applications / response
# generators.
module CacheContextHelpers
attr_reader :app, :cache, :tags
def setup_cache_context
# holds each Rack::Cache::Context
- @app = nil
-
- # each time a request is made, a clone of @cache_template is used
- # and appended to @caches.
- @cache_template = nil
- @cache = nil
- @caches = []
+ @app, @cache, @called, @request, @response, @cache_config = nil
@errors = StringIO.new
- @cache_config = nil
-
- @called = false
- @request = nil
- @response = nil
- @responses = []
-
@storage = Rack::Cache::Storage.instance
end
def teardown_cache_context
- @app, @cache_template, @cache, @caches, @called,
- @request, @response, @responses, @cache_config = nil
+ FileUtils.rm_r(TMP_DIR) rescue Errno::ENOENT
@storage.clear
end
+ def cache_config(&cache_config)
+ @cache_config = cache_config
+ end
+
# A basic response with 200 status code and a tiny body.
def respond_with(status=200, headers={}, body=['Hello World'])
called = false
@app = lambda do |env|
called = true
response = Rack::Response.new(body, status, headers)
request = Rack::Request.new(env)
yield request, response if block_given?
response.finish
end
@app.meta_def(:called?) { called }
- @app.meta_def(:reset!) { called = false }
+ @app.meta_def(:reset!) { called = false }
@app
end
- def cache_config(&block)
- @cache_config = block
- end
-
def request(method, uri = '/', env = {})
fail 'response not specified (use respond_with)' if @app.nil?
@app.reset! if @app.respond_to?(:reset!)
@tags = Rack::Cache::Tags.new(@app)
@purge = Rack::Cache::Purge.new(@tags, :allow_http_purge => true)
@cache = Rack::Cache::Context.new(@purge, :tagstore => 'heap:/', &@cache_config)
@request = Rack::MockRequest.new(@cache)
env = { 'rack.run_once' => true }.merge(env)
@response = @request.request(method.to_s.upcase, uri, env)
- @responses << @response
- @response
end
def get(stem, env={}, &b)
request(:get, stem, env, &b)
end
def head(stem, env={}, &b)
request(:head, stem, env, &b)
end
def post(*args, &b)
request(:post, *args, &b)
end
end
class Test::Unit::TestCase
include CacheContextHelpers
end
# Metaid == a few simple metaclass helper
# (See http://whytheluckystiff.net/articles/seeingMetaclassesClearly.html.)
class Object
# The hidden singleton lurks behind everyone
def metaclass; class << self; self; end; end
def meta_eval(&blk); metaclass.instance_eval(&blk); end
# Adds methods to a metaclass
def meta_def name, &blk
meta_eval { define_method name, &blk }
end
# Defines an instance method within a class
def class_def name, &blk
class_eval { define_method name, &blk }
end
# True when the Object is neither false or nil.
def truthy?
!!self
end
end
|
svenfuchs/rack-cache-tags
|
c449b5da6c7eea8564e65a3f058080e90b0135a7
|
make Storage#clear clear the tagstores as well
|
diff --git a/lib/rack/cache/tags/storage.rb b/lib/rack/cache/tags/storage.rb
index 02c2f14..0628c6b 100644
--- a/lib/rack/cache/tags/storage.rb
+++ b/lib/rack/cache/tags/storage.rb
@@ -1,6 +1,12 @@
Rack::Cache::Storage.class_eval do
+ alias :clear_without_tagstore :clear
+ def clear
+ @tagstores.clear
+ clear_without_tagstore
+ end
+
def resolve_tagstore_uri(uri)
@tagstores ||= {}
@tagstores[uri.to_s] ||= create_store(Rack::Cache::Tags::TagStore, uri)
end
end
\ No newline at end of file
|
martensite/OS_Practice
|
f2dcab7fae35a1b3a4f8f5d22e9ae7c51dc3e112
|
modify to hide the name.
|
diff --git a/README b/README
index 8b9ef7d..68b8f2c 100644
--- a/README
+++ b/README
@@ -1 +1 @@
-This is tintin's OS Practice.
+This is an OS Practice.
|
martensite/OS_Practice
|
71014016b92b4fede536a2a91fc25db8d6fcef2e
|
add some intro to README
|
diff --git a/README b/README
index e69de29..8b9ef7d 100644
--- a/README
+++ b/README
@@ -0,0 +1 @@
+This is tintin's OS Practice.
|
bentford/NSArchiveExample
|
27c4ae45afd9040c5ed56dab5052325ba0e71ca6
|
Show Custom Object as it exists in the database.
|
diff --git a/Classes/NSArchiveExampleAppDelegate.m b/Classes/NSArchiveExampleAppDelegate.m
index f014149..d582f6e 100644
--- a/Classes/NSArchiveExampleAppDelegate.m
+++ b/Classes/NSArchiveExampleAppDelegate.m
@@ -1,36 +1,41 @@
//
// NSArchiveExampleAppDelegate.m
// NSArchiveExample
//
// Created by Ben Ford on 4/21/10.
// Copyright __MyCompanyName__ 2010. All rights reserved.
//
#import "NSArchiveExampleAppDelegate.h"
#import "Persistance.h"
@implementation NSArchiveExampleAppDelegate
@synthesize window;
@synthesize tabBar;
-
+#pragma mark UIApplicationDelegate
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[[Persistance sharedService] loadFromDisk];
[window makeKeyAndVisible];
}
+- (void)applicationDidEnterBackground:(UIApplication *)application {
+ [[Persistance sharedService] saveToDisk];
+}
+
- (void)applicationWillTerminate:(UIApplication *)application {
[[Persistance sharedService] saveToDisk];
}
+#pragma mark -
- (void)dealloc {
[tabBar release];
[window release];
[super dealloc];
}
@end
diff --git a/Classes/Persistance.m b/Classes/Persistance.m
index 9d2e4ec..0c5e654 100644
--- a/Classes/Persistance.m
+++ b/Classes/Persistance.m
@@ -1,124 +1,124 @@
//
// Persistance.m
// GuestInfo
//
// Created by Ben Ford on 10/23/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "Persistance.h"
#import "Person.h"
@implementation Persistance
@synthesize boss, dictionary, array;
//taken from apple code example:
//http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/TP40002974-CH4-SW32
static Persistance *sharedGlobalInstance = nil;
- (id)init {
self = [super init];
return self;
}
#pragma mark Singleton
+ (Persistance*) sharedService {
if( sharedGlobalInstance == nil )
{
[[self alloc] init];// assignment not done here
}
return sharedGlobalInstance;
}
+ (Persistance*) allocWithZone:(NSZone*)zone {
@synchronized(self) {
if (sharedGlobalInstance == nil) {
sharedGlobalInstance = [super allocWithZone:zone];
return sharedGlobalInstance; // assignment and return on first allocation
}
}
return nil; //on subsequent allocation attempts return nil
}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (id)retain {
return self;
}
- (unsigned)retainCount {
return UINT_MAX; //denotes an object that cannot be released
}
- (oneway void)release {
//do nothing
}
- (id)autorelease {
return self;
}
#pragma mark -
#pragma mark LifeCycle
- (void)loadFromDisk {
// boss
NSString *bossFilePath = [Persistance pathForDocumentsDirectoryFile:@"boss.archive"];
self.boss = [NSKeyedUnarchiver unarchiveObjectWithFile:bossFilePath];
-
- if( !self.boss )
+
+ if( self.boss == nil )
self.boss = [Person defaultPerson];
// managers
NSString *managerFilePath = [Persistance pathForDocumentsDirectoryFile:@"managers.archive"];
self.dictionary = [NSKeyedUnarchiver unarchiveObjectWithFile:managerFilePath];
- if( !self.dictionary )
+ if( self.dictionary == nil )
self.dictionary = [NSMutableDictionary dictionaryWithCapacity:0];
// employees
NSString *employeesFilePath = [Persistance pathForDocumentsDirectoryFile:@"employees.archive"];
self.array = [NSKeyedUnarchiver unarchiveObjectWithFile:employeesFilePath];
- if( !self.array )
+ if( self.array == nil )
self.array = [NSMutableArray arrayWithCapacity:0];
}
- (void)saveToDisk {
NSString *dictionaryFilePath = [Persistance pathForDocumentsDirectoryFile:@"boss.archive"];
[NSKeyedArchiver archiveRootObject:self.boss toFile:dictionaryFilePath];
NSString *managersFilePath = [Persistance pathForDocumentsDirectoryFile:@"managers.archive"];
[NSKeyedArchiver archiveRootObject:self.dictionary toFile:managersFilePath];
NSString *arrayFilePath = [Persistance pathForDocumentsDirectoryFile:@"employees.archive"];
[NSKeyedArchiver archiveRootObject:self.array toFile:arrayFilePath];
}
#pragma mark -
#pragma mark helpers
+ (NSString *)pathForDocumentsDirectoryFile:(NSString*)filename {
NSArray *paths = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
return [documentsDirectory stringByAppendingPathComponent:filename];
}
#pragma mark -
- (void)dealloc {
self.boss = nil;
self.dictionary = nil;
self.array = nil;
[super dealloc];
}
@end
diff --git a/Classes/PersonEntryViewController.h b/Classes/PersonEntryViewController.h
index d693e59..32a2fed 100644
--- a/Classes/PersonEntryViewController.h
+++ b/Classes/PersonEntryViewController.h
@@ -1,21 +1,21 @@
//
// PersonEntryViewController.h
// NSArchiveExample
//
// Created by Ben Ford on 4/24/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PersonEntryViewController : UIViewController {
IBOutlet UITextField *firstName;
IBOutlet UITextField *lastName;
IBOutlet UITextField *age;
- IBOutlet UISwitch *isFullTime;
+
IBOutlet UILabel *titleLabel;
}
- (IBAction)savePerson;
- (void)loadBoss;
@end
diff --git a/Classes/PersonEntryViewController.m b/Classes/PersonEntryViewController.m
index 2732b6b..1fd9c5a 100644
--- a/Classes/PersonEntryViewController.m
+++ b/Classes/PersonEntryViewController.m
@@ -1,45 +1,50 @@
//
// PersonEntryViewController.m
// NSArchiveExample
//
// Created by Ben Ford on 4/24/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "PersonEntryViewController.h"
#import "Model.h"
@implementation PersonEntryViewController
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[firstName resignFirstResponder];
[lastName resignFirstResponder];
[age resignFirstResponder];
}
- (void)viewDidLoad {
[super viewDidLoad];
+ [[Persistance sharedService] loadFromDisk];
+ [self loadBoss];
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+ [super viewWillAppear:animated];
+
- [self loadBoss];
}
- (void)loadBoss {
+
firstName.text = [Persistance sharedService].boss.firstName;
lastName.text = [Persistance sharedService].boss.lastName;
age.text = [NSString stringWithFormat:@"%d",[Persistance sharedService].boss.age];
- [isFullTime setOn:[Persistance sharedService].boss.isFullTime animated:NO];
}
- (IBAction)savePerson {
[Persistance sharedService].boss.firstName = firstName.text;
[Persistance sharedService].boss.lastName = lastName.text;
[Persistance sharedService].boss.age = [age.text intValue];
- [Persistance sharedService].boss.isFullTime = isFullTime.on;
}
- (void)dealloc {
[super dealloc];
}
@end
diff --git a/MainWindow.xib b/MainWindow.xib
index b838ab0..4535d04 100644
--- a/MainWindow.xib
+++ b/MainWindow.xib
@@ -1,649 +1,370 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11C74</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1138.23</string>
<string key="IBDocument.HIToolboxVersion">567.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>IBProxyObject</string>
<string>IBUITabBarItem</string>
<string>IBUIViewController</string>
<string>IBUICustomObject</string>
<string>IBUITabBarController</string>
<string>IBUIWindow</string>
<string>IBUITabBar</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="841351856">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="427554174">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUICustomObject" id="664661524">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUITabBarController" id="675605402">
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
<object class="IBUIViewController" key="IBUISelectedViewController" id="780626317">
<string key="IBUITitle">Object</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="211206031">
<string key="IBUITitle">Object</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <reference key="IBUITabBar" ref="764819862"/>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">PersonEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="NSMutableArray" key="IBUIViewControllers">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="780626317"/>
<object class="IBUIViewController" id="404439053">
<string key="IBUITitle">Dictionary</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="415100502">
<string key="IBUITitle">Dictionary</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <reference key="IBUITabBar" ref="764819862"/>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">DictionaryEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="976730607">
<string key="IBUITitle">Array</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="582457009">
<string key="IBUITitle">Array</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <reference key="IBUITabBar" ref="764819862"/>
</object>
<object class="NSArray" key="IBUIToolbarItems" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">ArrayEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="102828398">
<string key="IBUITitle">View All</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="794213646">
<string key="IBUITitle">View All</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <reference key="IBUITabBar" ref="764819862"/>
</object>
<reference key="IBUIToolbarItems" ref="0"/>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">ViewAllView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</object>
<object class="IBUITabBar" key="IBUITabBar" id="764819862">
<reference key="NSNextResponder"/>
<int key="NSvFlags">266</int>
<string key="NSFrame">{{0, 431}, {320, 49}}</string>
<reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <object class="NSMutableArray" key="IBUIItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="211206031"/>
- <reference ref="415100502"/>
- <reference ref="582457009"/>
- <reference ref="794213646"/>
- </object>
- <reference key="IBUISelectedItem" ref="211206031"/>
</object>
</object>
<object class="IBUIWindow" id="117978783">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 480}</string>
<reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="664661524"/>
</object>
<int key="connectionID">4</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="117978783"/>
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">tabBar</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="675605402"/>
</object>
<int key="connectionID">25</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">rootViewController</string>
<reference key="source" ref="117978783"/>
<reference key="destination" ref="675605402"/>
</object>
<int key="connectionID">28</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="664661524"/>
<reference key="parent" ref="0"/>
<string key="objectName">NSArchiveExample App Delegate</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="427554174"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="117978783"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="675605402"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="764819862"/>
<reference ref="780626317"/>
<reference ref="404439053"/>
<reference ref="976730607"/>
<reference ref="102828398"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="764819862"/>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="780626317"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="211206031"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="404439053"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="415100502"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="415100502"/>
<reference key="parent" ref="404439053"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="211206031"/>
<reference key="parent" ref="780626317"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="976730607"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="582457009"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="582457009"/>
<reference key="parent" ref="976730607"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
<reference key="object" ref="102828398"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="794213646"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="794213646"/>
<reference key="parent" ref="102828398"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
<string>-2.IBPluginDependency</string>
<string>12.IBPluginDependency</string>
<string>15.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>17.CustomClassName</string>
<string>17.IBPluginDependency</string>
<string>18.CustomClassName</string>
<string>18.IBPluginDependency</string>
<string>19.IBPluginDependency</string>
<string>20.IBPluginDependency</string>
<string>21.CustomClassName</string>
<string>21.IBPluginDependency</string>
<string>22.IBPluginDependency</string>
<string>26.CustomClassName</string>
<string>26.IBPluginDependency</string>
<string>27.IBPluginDependency</string>
<string>3.CustomClassName</string>
<string>3.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIApplication</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>PersonEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>DictionaryEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>ArrayEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>ViewAllViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>NSArchiveExampleAppDelegate</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">28</int>
</object>
- <object class="IBClassDescriber" key="IBDocument.Classes">
- <object class="NSMutableArray" key="referencedPartialClassDescriptions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBPartialClassDescription">
- <string key="className">ArrayEntryViewController</string>
- <string key="superclassName">UIViewController</string>
- <object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">save</string>
- <string key="NS.object.0">id</string>
- </object>
- <object class="NSMutableDictionary" key="actionInfosByName">
- <string key="NS.key.0">save</string>
- <object class="IBActionInfo" key="NS.object.0">
- <string key="name">save</string>
- <string key="candidateClassName">id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="outlets">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>value1</string>
- <string>value2</string>
- <string>value3</string>
- <string>value4</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>UITextField</string>
- <string>UITextField</string>
- <string>UITextField</string>
- <string>UITextField</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>value1</string>
- <string>value2</string>
- <string>value3</string>
- <string>value4</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBToOneOutletInfo">
- <string key="name">value1</string>
- <string key="candidateClassName">UITextField</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">value2</string>
- <string key="candidateClassName">UITextField</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">value3</string>
- <string key="candidateClassName">UITextField</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">value4</string>
- <string key="candidateClassName">UITextField</string>
- </object>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/ArrayEntryViewController.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">DictionaryEntryViewController</string>
- <string key="superclassName">UIViewController</string>
- <object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">save</string>
- <string key="NS.object.0">id</string>
- </object>
- <object class="NSMutableDictionary" key="actionInfosByName">
- <string key="NS.key.0">save</string>
- <object class="IBActionInfo" key="NS.object.0">
- <string key="name">save</string>
- <string key="candidateClassName">id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="outlets">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>key1</string>
- <string>key2</string>
- <string>value1</string>
- <string>value2</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>UITextField</string>
- <string>UITextField</string>
- <string>UITextField</string>
- <string>UITextField</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>key1</string>
- <string>key2</string>
- <string>value1</string>
- <string>value2</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBToOneOutletInfo">
- <string key="name">key1</string>
- <string key="candidateClassName">UITextField</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">key2</string>
- <string key="candidateClassName">UITextField</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">value1</string>
- <string key="candidateClassName">UITextField</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">value2</string>
- <string key="candidateClassName">UITextField</string>
- </object>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/DictionaryEntryViewController.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSArchiveExampleAppDelegate</string>
- <string key="superclassName">NSObject</string>
- <object class="NSMutableDictionary" key="outlets">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>tabBar</string>
- <string>window</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>UITabBarController</string>
- <string>UIWindow</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>tabBar</string>
- <string>window</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBToOneOutletInfo">
- <string key="name">tabBar</string>
- <string key="candidateClassName">UITabBarController</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">window</string>
- <string key="candidateClassName">UIWindow</string>
- </object>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/NSArchiveExampleAppDelegate.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">PersonEntryViewController</string>
- <string key="superclassName">UIViewController</string>
- <object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">savePerson</string>
- <string key="NS.object.0">id</string>
- </object>
- <object class="NSMutableDictionary" key="actionInfosByName">
- <string key="NS.key.0">savePerson</string>
- <object class="IBActionInfo" key="NS.object.0">
- <string key="name">savePerson</string>
- <string key="candidateClassName">id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="outlets">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>age</string>
- <string>firstName</string>
- <string>isFullTime</string>
- <string>lastName</string>
- <string>titleLabel</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>UITextField</string>
- <string>UITextField</string>
- <string>UISwitch</string>
- <string>UITextField</string>
- <string>UILabel</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>age</string>
- <string>firstName</string>
- <string>isFullTime</string>
- <string>lastName</string>
- <string>titleLabel</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBToOneOutletInfo">
- <string key="name">age</string>
- <string key="candidateClassName">UITextField</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">firstName</string>
- <string key="candidateClassName">UITextField</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">isFullTime</string>
- <string key="candidateClassName">UISwitch</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">lastName</string>
- <string key="candidateClassName">UITextField</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">titleLabel</string>
- <string key="candidateClassName">UILabel</string>
- </object>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/PersonEntryViewController.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">ViewAllViewController</string>
- <string key="superclassName">UIViewController</string>
- <object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">tableview</string>
- <string key="NS.object.0">UITableView</string>
- </object>
- <object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <string key="NS.key.0">tableview</string>
- <object class="IBToOneOutletInfo" key="NS.object.0">
- <string key="name">tableview</string>
- <string key="candidateClassName">UITableView</string>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/ViewAllViewController.h</string>
- </object>
- </object>
- </object>
- </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
|
bentford/NSArchiveExample
|
62c0ecf098efe952dc7d0173b3c4905165274693
|
Cleaning up
|
diff --git a/Classes/PersonEntryView.xib b/Classes/PersonEntryView.xib
index f8fcf58..c36b0d6 100644
--- a/Classes/PersonEntryView.xib
+++ b/Classes/PersonEntryView.xib
@@ -1,669 +1,471 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
- <int key="IBDocument.SystemTarget">800</int>
- <string key="IBDocument.SystemVersion">10D2125</string>
- <string key="IBDocument.InterfaceBuilderVersion">762</string>
- <string key="IBDocument.AppKitVersion">1038.29</string>
- <string key="IBDocument.HIToolboxVersion">460.00</string>
+ <int key="IBDocument.SystemTarget">1280</int>
+ <string key="IBDocument.SystemVersion">11C74</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1938</string>
+ <string key="IBDocument.AppKitVersion">1138.23</string>
+ <string key="IBDocument.HIToolboxVersion">567.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">87</string>
+ <string key="NS.object.0">933</string>
</object>
- <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="1"/>
+ <string>IBUILabel</string>
+ <string>IBUIButton</string>
+ <string>IBUIView</string>
+ <string>IBUITextField</string>
+ <string>IBProxyObject</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys" id="0">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUITextField" id="939720903">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 64}, {280, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="261189894"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">First Name</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace" id="382993945">
<int key="NSID">2</int>
</object>
</object>
- <object class="NSFont" key="IBUIFont" id="462333560">
- <string key="NSName">Helvetica</string>
- <double key="NSSize">18</double>
- <int key="NSfFlags">16</int>
- </object>
<bool key="IBUIClearsOnBeginEditing">YES</bool>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
+ <object class="IBUIFontDescription" key="IBUIFontDescription" id="655967471">
+ <string key="name">Helvetica</string>
+ <string key="family">Helvetica</string>
+ <int key="traits">0</int>
+ <double key="pointSize">18</double>
+ </object>
+ <object class="NSFont" key="IBUIFont" id="462333560">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">18</double>
+ <int key="NSfFlags">16</int>
+ </object>
</object>
<object class="IBUITextField" id="261189894">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 111}, {280, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="5586189"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">Last Name</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<reference key="NSCustomColorSpace" ref="382993945"/>
</object>
- <reference key="IBUIFont" ref="462333560"/>
<bool key="IBUIClearsOnBeginEditing">YES</bool>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
+ <reference key="IBUIFontDescription" ref="655967471"/>
+ <reference key="IBUIFont" ref="462333560"/>
</object>
<object class="IBUITextField" id="5586189">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 164}, {280, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">Age</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<reference key="NSCustomColorSpace" ref="382993945"/>
</object>
- <reference key="IBUIFont" ref="462333560"/>
<bool key="IBUIClearsOnBeginEditing">YES</bool>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
- </object>
- <object class="IBUISwitch" id="115392934">
- <reference key="NSNextResponder" ref="191373211"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{147, 231}, {94, 27}}</string>
- <reference key="NSSuperview" ref="191373211"/>
- <bool key="IBUIOpaque">NO</bool>
- <bool key="IBUIClipsSubviews">YES</bool>
- <bool key="IBUIMultipleTouchEnabled">YES</bool>
- <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <int key="IBUIContentHorizontalAlignment">0</int>
- <int key="IBUIContentVerticalAlignment">0</int>
- <bool key="IBUIOn">YES</bool>
- </object>
- <object class="IBUILabel" id="628301908">
- <reference key="NSNextResponder" ref="191373211"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{20, 237}, {90, 21}}</string>
- <reference key="NSSuperview" ref="191373211"/>
- <bool key="IBUIOpaque">NO</bool>
- <bool key="IBUIClipsSubviews">YES</bool>
- <bool key="IBUIUserInteractionEnabled">NO</bool>
- <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <string key="IBUIText">Is Full Time</string>
- <object class="NSColor" key="IBUITextColor" id="883919357">
- <int key="NSColorSpace">1</int>
- <bytes key="NSRGB">MCAwIDAAA</bytes>
- </object>
- <nil key="IBUIHighlightedColor"/>
- <int key="IBUIBaselineAdjustment">1</int>
- <float key="IBUIMinimumFontSize">10</float>
+ <reference key="IBUIFontDescription" ref="655967471"/>
+ <reference key="IBUIFont" ref="462333560"/>
</object>
<object class="IBUIButton" id="268590498">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 308}, {280, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
- <object class="NSFont" key="IBUIFont">
- <string key="NSName">Helvetica-Bold</string>
- <double key="NSSize">15</double>
- <int key="NSfFlags">16</int>
- </object>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Save</string>
<object class="NSColor" key="IBUIHighlightedTitleColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
+ <object class="IBUIFontDescription" key="IBUIFontDescription">
+ <string key="name">Helvetica-Bold</string>
+ <string key="family">Helvetica</string>
+ <int key="traits">2</int>
+ <double key="pointSize">15</double>
+ </object>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica-Bold</string>
+ <double key="NSSize">15</double>
+ <int key="NSfFlags">16</int>
+ </object>
</object>
<object class="IBUILabel" id="65325736">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{105, 13}, {110, 29}}</string>
+ <string key="NSFrame">{{75, 13}, {171, 29}}</string>
<reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="939720903"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <string key="IBUIText">Boss</string>
- <object class="NSFont" key="IBUIFont">
- <string key="NSName">Helvetica-Bold</string>
- <double key="NSSize">24</double>
- <int key="NSfFlags">16</int>
+ <string key="IBUIText">Custom Object</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAAA</bytes>
</object>
- <reference key="IBUITextColor" ref="883919357"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">1</int>
+ <object class="IBUIFontDescription" key="IBUIFontDescription">
+ <string key="name">Helvetica-Bold</string>
+ <string key="family">Helvetica</string>
+ <int key="traits">2</int>
+ <double key="pointSize">24</double>
+ </object>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica-Bold</string>
+ <double key="NSSize">24</double>
+ <int key="NSfFlags">16</int>
+ </object>
</object>
</object>
- <string key="NSFrameSize">{320, 411}</string>
+ <string key="NSFrame">{{0, 20}, {320, 411}}</string>
<reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="65325736"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<reference key="NSCustomColorSpace" ref="382993945"/>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
</object>
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">13</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">age</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="5586189"/>
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">firstName</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="939720903"/>
</object>
<int key="connectionID">15</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">isFullTime</string>
+ <string key="label">lastName</string>
<reference key="source" ref="372490531"/>
- <reference key="destination" ref="115392934"/>
+ <reference key="destination" ref="261189894"/>
</object>
- <int key="connectionID">16</int>
+ <int key="connectionID">17</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">lastName</string>
+ <string key="label">titleLabel</string>
<reference key="source" ref="372490531"/>
- <reference key="destination" ref="261189894"/>
+ <reference key="destination" ref="65325736"/>
</object>
- <int key="connectionID">17</int>
+ <int key="connectionID">21</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">savePerson</string>
<reference key="source" ref="268590498"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
<int key="connectionID">19</int>
</object>
- <object class="IBConnectionRecord">
- <object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">titleLabel</string>
- <reference key="source" ref="372490531"/>
- <reference key="destination" ref="65325736"/>
- </object>
- <int key="connectionID">21</int>
- </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
- <reference key="object" ref="0"/>
+ <object class="NSArray" key="object" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="939720903"/>
- <reference ref="628301908"/>
<reference ref="268590498"/>
- <reference ref="115392934"/>
<reference ref="261189894"/>
<reference ref="5586189"/>
<reference ref="65325736"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="939720903"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="261189894"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="5586189"/>
<reference key="parent" ref="191373211"/>
</object>
- <object class="IBObjectRecord">
- <int key="objectID">9</int>
- <reference key="object" ref="115392934"/>
- <reference key="parent" ref="191373211"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">10</int>
- <reference key="object" ref="628301908"/>
- <reference key="parent" ref="191373211"/>
- </object>
<object class="IBObjectRecord">
<int key="objectID">11</int>
<reference key="object" ref="268590498"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="65325736"/>
<reference key="parent" ref="191373211"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
+ <string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
- <string>1.IBEditorWindowLastContentRect</string>
+ <string>-2.IBPluginDependency</string>
<string>1.IBPluginDependency</string>
- <string>10.IBPluginDependency</string>
<string>11.IBPluginDependency</string>
<string>12.IBPluginDependency</string>
<string>3.IBPluginDependency</string>
<string>4.IBPluginDependency</string>
<string>7.IBPluginDependency</string>
- <string>9.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>PersonEntryViewController</string>
- <string>UIResponder</string>
- <string>{{340, 276}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>UIResponder</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
+ <reference key="dict.values" ref="0"/>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
+ <reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">21</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">PersonEntryViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">savePerson</string>
<string key="NS.object.0">id</string>
</object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">savePerson</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">savePerson</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>age</string>
<string>firstName</string>
<string>isFullTime</string>
<string>lastName</string>
<string>titleLabel</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UITextField</string>
<string>UITextField</string>
<string>UISwitch</string>
<string>UITextField</string>
<string>UILabel</string>
</object>
</object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">Classes/PersonEntryViewController.h</string>
- </object>
- </object>
- </object>
- <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="117124143">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UIButton</string>
- <string key="superclassName">UIControl</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UIButton.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UIControl</string>
- <string key="superclassName">UIView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UILabel</string>
- <string key="superclassName">UIView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UIResponder</string>
- <string key="superclassName">NSObject</string>
- <reference key="sourceIdentifier" ref="117124143"/>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UISearchBar</string>
- <string key="superclassName">UIView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UISearchDisplayController</string>
- <string key="superclassName">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UISwitch</string>
- <string key="superclassName">UIControl</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UISwitch.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UITextField</string>
- <string key="superclassName">UIControl</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="507764279">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UIView</string>
- <reference key="sourceIdentifier" ref="507764279"/>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UIView</string>
- <string key="superclassName">UIResponder</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UIView.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UIViewController</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UIViewController</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>age</string>
+ <string>firstName</string>
+ <string>isFullTime</string>
+ <string>lastName</string>
+ <string>titleLabel</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">age</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">firstName</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">isFullTime</string>
+ <string key="candidateClassName">UISwitch</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">lastName</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">titleLabel</string>
+ <string key="candidateClassName">UILabel</string>
+ </object>
+ </object>
</object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">UIViewController</string>
- <string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/PersonEntryViewController.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
- <string key="IBDocument.LastKnownRelativeProjectPath">../NSArchiveExample.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">87</string>
+ <string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
diff --git a/Classes/ViewAllViewController.m b/Classes/ViewAllViewController.m
index e9c8e42..c7b5462 100644
--- a/Classes/ViewAllViewController.m
+++ b/Classes/ViewAllViewController.m
@@ -1,96 +1,96 @@
//
// ViewAllViewController.m
// NSArchiveExample
//
// Created by Ben Ford on 4/22/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "ViewAllViewController.h"
#import "Model.h"
@implementation ViewAllViewController
- (void)viewDidAppear:(BOOL)animated {
// refresh everytime
[tableview reloadData];
}
#pragma mark UITableViewDelegate
#pragma mark -
#pragma mark UITableViewDataSource
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
switch (section) {
case 0:
return @"Person Object";
break;
case 1:
return @"Dictionary";
break;
case 2:
return @"Array";
break;
}
return @"error";
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
switch (section) {
case 0:
return 1;
break;
case 1:
return [[Persistance sharedService].dictionary count];
break;
case 2:
return [[Persistance sharedService].array count];
break;
default:
return 1;
break;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell;
cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if( cell == nil ) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"] autorelease];
}
switch (indexPath.section) {
case 0:
- cell.textLabel.text = [Persistance sharedService].boss.fullName;
+ cell.textLabel.text = [NSString stringWithFormat:@"Name: %@, Age: %d",[Persistance sharedService].boss.fullName, [Persistance sharedService].boss.age];
break;
case 1:
if( [[[Persistance sharedService].dictionary allKeys] count] > indexPath.row ) {
NSString *key = [[[Persistance sharedService].dictionary allKeys] objectAtIndex:indexPath.row];
NSString *value = [[Persistance sharedService].dictionary objectForKey:key];
cell.textLabel.text = value;
cell.detailTextLabel.text = [NSString stringWithFormat:@"value for key: %@",key];
}
break;
case 2:
cell.textLabel.text = [[Persistance sharedService].array objectAtIndex:indexPath.row];
break;
default:
cell.textLabel.text = @"error";
break;
}
return cell;
}
#pragma mark -
- (void)dealloc {
[super dealloc];
}
@end
diff --git a/MainWindow.xib b/MainWindow.xib
index 83f2a17..b838ab0 100644
--- a/MainWindow.xib
+++ b/MainWindow.xib
@@ -1,370 +1,649 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11C74</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1138.23</string>
<string key="IBDocument.HIToolboxVersion">567.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>IBProxyObject</string>
<string>IBUITabBarItem</string>
<string>IBUIViewController</string>
<string>IBUICustomObject</string>
<string>IBUITabBarController</string>
<string>IBUIWindow</string>
<string>IBUITabBar</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="841351856">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="427554174">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUICustomObject" id="664661524">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUITabBarController" id="675605402">
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
- <object class="IBUIViewController" key="IBUISelectedViewController" id="404439053">
- <string key="IBUITitle">Dictionary</string>
- <object class="IBUITabBarItem" key="IBUITabBarItem" id="415100502">
- <string key="IBUITitle">Dictionary</string>
+ <object class="IBUIViewController" key="IBUISelectedViewController" id="780626317">
+ <string key="IBUITitle">Object</string>
+ <object class="IBUITabBarItem" key="IBUITabBarItem" id="211206031">
+ <string key="IBUITitle">Object</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUITabBar" ref="764819862"/>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
- <string key="IBUINibName">DictionaryEntryView</string>
+ <string key="IBUINibName">PersonEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="NSMutableArray" key="IBUIViewControllers">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBUIViewController" id="780626317">
- <string key="IBUITitle">Boss</string>
- <object class="IBUITabBarItem" key="IBUITabBarItem" id="211206031">
- <string key="IBUITitle">Boss</string>
+ <reference ref="780626317"/>
+ <object class="IBUIViewController" id="404439053">
+ <string key="IBUITitle">Dictionary</string>
+ <object class="IBUITabBarItem" key="IBUITabBarItem" id="415100502">
+ <string key="IBUITitle">Dictionary</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUITabBar" ref="764819862"/>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
- <string key="IBUINibName">PersonEntryView</string>
+ <string key="IBUINibName">DictionaryEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
- <reference ref="404439053"/>
<object class="IBUIViewController" id="976730607">
<string key="IBUITitle">Array</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="582457009">
<string key="IBUITitle">Array</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUITabBar" ref="764819862"/>
</object>
<object class="NSArray" key="IBUIToolbarItems" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">ArrayEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="102828398">
<string key="IBUITitle">View All</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="794213646">
<string key="IBUITitle">View All</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUITabBar" ref="764819862"/>
</object>
<reference key="IBUIToolbarItems" ref="0"/>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">ViewAllView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</object>
<object class="IBUITabBar" key="IBUITabBar" id="764819862">
<reference key="NSNextResponder"/>
<int key="NSvFlags">266</int>
<string key="NSFrame">{{0, 431}, {320, 49}}</string>
<reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableArray" key="IBUIItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="211206031"/>
+ <reference ref="415100502"/>
+ <reference ref="582457009"/>
+ <reference ref="794213646"/>
+ </object>
+ <reference key="IBUISelectedItem" ref="211206031"/>
</object>
</object>
<object class="IBUIWindow" id="117978783">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 480}</string>
<reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="664661524"/>
</object>
<int key="connectionID">4</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="117978783"/>
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">tabBar</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="675605402"/>
</object>
<int key="connectionID">25</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">rootViewController</string>
<reference key="source" ref="117978783"/>
<reference key="destination" ref="675605402"/>
</object>
<int key="connectionID">28</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="664661524"/>
<reference key="parent" ref="0"/>
<string key="objectName">NSArchiveExample App Delegate</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="427554174"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="117978783"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="675605402"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="764819862"/>
<reference ref="780626317"/>
<reference ref="404439053"/>
<reference ref="976730607"/>
<reference ref="102828398"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="764819862"/>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="780626317"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="211206031"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="404439053"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="415100502"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="415100502"/>
<reference key="parent" ref="404439053"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="211206031"/>
<reference key="parent" ref="780626317"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="976730607"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="582457009"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="582457009"/>
<reference key="parent" ref="976730607"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
<reference key="object" ref="102828398"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="794213646"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="794213646"/>
<reference key="parent" ref="102828398"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
<string>-2.IBPluginDependency</string>
<string>12.IBPluginDependency</string>
<string>15.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>17.CustomClassName</string>
<string>17.IBPluginDependency</string>
<string>18.CustomClassName</string>
<string>18.IBPluginDependency</string>
<string>19.IBPluginDependency</string>
<string>20.IBPluginDependency</string>
<string>21.CustomClassName</string>
<string>21.IBPluginDependency</string>
<string>22.IBPluginDependency</string>
<string>26.CustomClassName</string>
<string>26.IBPluginDependency</string>
<string>27.IBPluginDependency</string>
<string>3.CustomClassName</string>
<string>3.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIApplication</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>PersonEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>DictionaryEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>ArrayEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>ViewAllViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>NSArchiveExampleAppDelegate</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">28</int>
</object>
- <object class="IBClassDescriber" key="IBDocument.Classes"/>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">ArrayEntryViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">save</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">save</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">save</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>value1</string>
+ <string>value2</string>
+ <string>value3</string>
+ <string>value4</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>value1</string>
+ <string>value2</string>
+ <string>value3</string>
+ <string>value4</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">value1</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">value2</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">value3</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">value4</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/ArrayEntryViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">DictionaryEntryViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">save</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">save</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">save</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>key1</string>
+ <string>key2</string>
+ <string>value1</string>
+ <string>value2</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>key1</string>
+ <string>key2</string>
+ <string>value1</string>
+ <string>value2</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">key1</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">key2</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">value1</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">value2</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/DictionaryEntryViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSArchiveExampleAppDelegate</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>tabBar</string>
+ <string>window</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UITabBarController</string>
+ <string>UIWindow</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>tabBar</string>
+ <string>window</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">tabBar</string>
+ <string key="candidateClassName">UITabBarController</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">window</string>
+ <string key="candidateClassName">UIWindow</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/NSArchiveExampleAppDelegate.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">PersonEntryViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">savePerson</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">savePerson</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">savePerson</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>age</string>
+ <string>firstName</string>
+ <string>isFullTime</string>
+ <string>lastName</string>
+ <string>titleLabel</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UISwitch</string>
+ <string>UITextField</string>
+ <string>UILabel</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>age</string>
+ <string>firstName</string>
+ <string>isFullTime</string>
+ <string>lastName</string>
+ <string>titleLabel</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">age</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">firstName</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">isFullTime</string>
+ <string key="candidateClassName">UISwitch</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">lastName</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">titleLabel</string>
+ <string key="candidateClassName">UILabel</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/PersonEntryViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">ViewAllViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">tableview</string>
+ <string key="NS.object.0">UITableView</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">tableview</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">tableview</string>
+ <string key="candidateClassName">UITableView</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/ViewAllViewController.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
diff --git a/NSArchiveExample.xcodeproj/project.pbxproj b/NSArchiveExample.xcodeproj/project.pbxproj
index 550ceb7..6fb2937 100755
--- a/NSArchiveExample.xcodeproj/project.pbxproj
+++ b/NSArchiveExample.xcodeproj/project.pbxproj
@@ -1,328 +1,324 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
- 2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */; };
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
B52EA5E51182FC2D0065C4CA /* PersonEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */; };
B52EA600118439900065C4CA /* DictionaryEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */; };
B52EA601118439900065C4CA /* DictionaryEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */; };
B52EA6921186EB390065C4CA /* ArrayEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA6901186EB390065C4CA /* ArrayEntryViewController.m */; };
B52EA6931186EB390065C4CA /* ArrayEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B52EA6911186EB390065C4CA /* ArrayEntryView.xib */; };
B569D40114BBAF5800F46D4B /* NSArray+Ext.m in Sources */ = {isa = PBXBuildFile; fileRef = B569D40014BBAF5800F46D4B /* NSArray+Ext.m */; };
B5B25F7F11803200001BA9A0 /* ViewAllViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */; };
B5B25F8011803200001BA9A0 /* ViewAllView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5B25F7E11803200001BA9A0 /* ViewAllView.xib */; };
B5BFA804117F9A96008B450B /* Persistance.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA803117F9A96008B450B /* Persistance.m */; };
B5BFA81D117F9CAD008B450B /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA81C117F9CAD008B450B /* Person.m */; };
B5BFA845117FA1B8008B450B /* PersonEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5BFA844117FA1B8008B450B /* PersonEntryView.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExampleAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSArchiveExampleAppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSArchiveExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
- 2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NSArchiveExampleViewController.xib; sourceTree = "<group>"; };
- 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
+ 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainWindow.xib; path = ../MainWindow.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExample_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "NSArchiveExample-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PersonEntryViewController.h; sourceTree = "<group>"; };
B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PersonEntryViewController.m; sourceTree = "<group>"; };
B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryEntryViewController.h; sourceTree = "<group>"; };
B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DictionaryEntryViewController.m; sourceTree = "<group>"; };
B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DictionaryEntryView.xib; sourceTree = "<group>"; };
B52EA68F1186EB390065C4CA /* ArrayEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayEntryViewController.h; sourceTree = "<group>"; };
B52EA6901186EB390065C4CA /* ArrayEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArrayEntryViewController.m; sourceTree = "<group>"; };
B52EA6911186EB390065C4CA /* ArrayEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ArrayEntryView.xib; sourceTree = "<group>"; };
B569D3FF14BBAF5800F46D4B /* NSArray+Ext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Ext.h"; sourceTree = "<group>"; };
B569D40014BBAF5800F46D4B /* NSArray+Ext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Ext.m"; sourceTree = "<group>"; };
B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewAllViewController.h; sourceTree = "<group>"; };
B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewAllViewController.m; sourceTree = "<group>"; };
B5B25F7E11803200001BA9A0 /* ViewAllView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ViewAllView.xib; sourceTree = "<group>"; };
B5BFA802117F9A96008B450B /* Persistance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Persistance.h; sourceTree = "<group>"; };
B5BFA803117F9A96008B450B /* Persistance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Persistance.m; sourceTree = "<group>"; };
B5BFA81B117F9CAD008B450B /* Person.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Person.h; sourceTree = "<group>"; };
B5BFA81C117F9CAD008B450B /* Person.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Person.m; sourceTree = "<group>"; };
B5BFA83B117FA0E3008B450B /* Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Model.h; sourceTree = "<group>"; };
B5BFA844117FA1B8008B450B /* PersonEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PersonEntryView.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
B569D40214BBAF5A00F46D4B /* Extension */,
B5BFA81E117F9CB4008B450B /* Model */,
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */,
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */,
B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */,
B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */,
B5BFA844117FA1B8008B450B /* PersonEntryView.xib */,
B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */,
B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */,
B5B25F7E11803200001BA9A0 /* ViewAllView.xib */,
B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */,
B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */,
B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */,
B52EA68F1186EB390065C4CA /* ArrayEntryViewController.h */,
B52EA6901186EB390065C4CA /* ArrayEntryViewController.m */,
B52EA6911186EB390065C4CA /* ArrayEntryView.xib */,
+ 28AD733E0D9D9553002E5188 /* MainWindow.xib */,
);
path = Classes;
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = CustomTemplate;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
- 2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */,
- 28AD733E0D9D9553002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
288765A40DF7441C002DB57D /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
B569D40214BBAF5A00F46D4B /* Extension */ = {
isa = PBXGroup;
children = (
B569D3FF14BBAF5800F46D4B /* NSArray+Ext.h */,
B569D40014BBAF5800F46D4B /* NSArray+Ext.m */,
);
name = Extension;
sourceTree = "<group>";
};
B5BFA81E117F9CB4008B450B /* Model */ = {
isa = PBXGroup;
children = (
B5BFA83B117FA0E3008B450B /* Model.h */,
B5BFA802117F9A96008B450B /* Persistance.h */,
B5BFA803117F9A96008B450B /* Persistance.m */,
B5BFA81B117F9CAD008B450B /* Person.h */,
B5BFA81C117F9CAD008B450B /* Person.m */,
);
name = Model;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */;
buildPhases = (
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = NSArchiveExample;
productName = NSArchiveExample;
productReference = 1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
targets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1D60588D0D05DD3D006BFB54 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
- 2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */,
B5BFA845117FA1B8008B450B /* PersonEntryView.xib in Resources */,
B5B25F8011803200001BA9A0 /* ViewAllView.xib in Resources */,
B52EA601118439900065C4CA /* DictionaryEntryView.xib in Resources */,
B52EA6931186EB390065C4CA /* ArrayEntryView.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */,
B5BFA804117F9A96008B450B /* Persistance.m in Sources */,
B5BFA81D117F9CAD008B450B /* Person.m in Sources */,
B5B25F7F11803200001BA9A0 /* ViewAllViewController.m in Sources */,
B52EA5E51182FC2D0065C4CA /* PersonEntryViewController.m in Sources */,
B52EA600118439900065C4CA /* DictionaryEntryViewController.m in Sources */,
B52EA6921186EB390065C4CA /* ArrayEntryViewController.m in Sources */,
B569D40114BBAF5800F46D4B /* NSArray+Ext.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.2;
PRODUCT_NAME = NSArchiveExample;
SDKROOT = iphoneos;
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.2;
PRODUCT_NAME = NSArchiveExample;
SDKROOT = iphoneos;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
SDKROOT = iphoneos;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1D6058940D05DD3E006BFB54 /* Debug */,
1D6058950D05DD3E006BFB54 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
diff --git a/NSArchiveExampleViewController.xib b/NSArchiveExampleViewController.xib
deleted file mode 100644
index e11e752..0000000
--- a/NSArchiveExampleViewController.xib
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
- <data>
- <int key="IBDocument.SystemTarget">784</int>
- <string key="IBDocument.SystemVersion">10A394</string>
- <string key="IBDocument.InterfaceBuilderVersion">732</string>
- <string key="IBDocument.AppKitVersion">1027.1</string>
- <string key="IBDocument.HIToolboxVersion">430.00</string>
- <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
- <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">60</string>
- </object>
- <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="6"/>
- </object>
- <object class="NSArray" key="IBDocument.PluginDependencies">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- </object>
- <object class="NSMutableDictionary" key="IBDocument.Metadata">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys" id="0">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- </object>
- <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBProxyObject" id="372490531">
- <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
- </object>
- <object class="IBProxyObject" id="843779117">
- <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
- </object>
- <object class="IBUIView" id="774585933">
- <reference key="NSNextResponder"/>
- <int key="NSvFlags">274</int>
- <string key="NSFrameSize">{320, 460}</string>
- <reference key="NSSuperview"/>
- <object class="NSColor" key="IBUIBackgroundColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC43NQA</bytes>
- <object class="NSColorSpace" key="NSCustomColorSpace">
- <int key="NSID">2</int>
- </object>
- </object>
- <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
- <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
- </object>
- </object>
- <object class="IBObjectContainer" key="IBDocument.Objects">
- <object class="NSMutableArray" key="connectionRecords">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBConnectionRecord">
- <object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">view</string>
- <reference key="source" ref="372490531"/>
- <reference key="destination" ref="774585933"/>
- </object>
- <int key="connectionID">7</int>
- </object>
- </object>
- <object class="IBMutableOrderedSet" key="objectRecords">
- <object class="NSArray" key="orderedObjects">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBObjectRecord">
- <int key="objectID">0</int>
- <reference key="object" ref="0"/>
- <reference key="children" ref="1000"/>
- <nil key="parent"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-1</int>
- <reference key="object" ref="372490531"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">File's Owner</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-2</int>
- <reference key="object" ref="843779117"/>
- <reference key="parent" ref="0"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">6</int>
- <reference key="object" ref="774585933"/>
- <reference key="parent" ref="0"/>
- </object>
- </object>
- </object>
- <object class="NSMutableDictionary" key="flattenedProperties">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>-1.CustomClassName</string>
- <string>-2.CustomClassName</string>
- <string>6.IBEditorWindowLastContentRect</string>
- <string>6.IBPluginDependency</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>NSArchiveExampleViewController</string>
- <string>UIResponder</string>
- <string>{{438, 347}, {320, 480}}</string>
- <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="unlocalizedProperties">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- </object>
- <nil key="activeLocalization"/>
- <object class="NSMutableDictionary" key="localizations">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- </object>
- <nil key="sourceID"/>
- <int key="maxID">7</int>
- </object>
- <object class="IBClassDescriber" key="IBDocument.Classes">
- <object class="NSMutableArray" key="referencedPartialClassDescriptions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBPartialClassDescription">
- <string key="className">NSArchiveExampleViewController</string>
- <string key="superclassName">UIViewController</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">Classes/NSArchiveExampleViewController.h</string>
- </object>
- </object>
- </object>
- </object>
- <int key="IBDocument.localizationMode">0</int>
- <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
- <integer value="3100" key="NS.object.0"/>
- </object>
- <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
- <string key="IBDocument.LastKnownRelativeProjectPath">NSArchiveExample.xcodeproj</string>
- <int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">3.1</string>
- </data>
-</archive>
|
bentford/NSArchiveExample
|
799456d0305ba65ec27faa7c4b44583e2f8e2ea6
|
Fixed crash on empty data
|
diff --git a/Classes/ArrayEntryViewController.m b/Classes/ArrayEntryViewController.m
index c5c7741..3297012 100644
--- a/Classes/ArrayEntryViewController.m
+++ b/Classes/ArrayEntryViewController.m
@@ -1,47 +1,48 @@
//
// ArrayEntryViewController.m
// NSArchiveExample
//
// Created by Ben Ford on 4/27/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "ArrayEntryViewController.h"
#import "Persistance.h"
+#import "NSArray+Ext.h"
@implementation ArrayEntryViewController
- (void)viewWillAppear:(BOOL)animated {
[self loadData];
}
- (void)loadData {
- value1.text = [[Persistance sharedService].array objectAtIndex:0];
- value2.text = [[Persistance sharedService].array objectAtIndex:1];
- value3.text = [[Persistance sharedService].array objectAtIndex:2];
- value4.text = [[Persistance sharedService].array objectAtIndex:3];
+ value1.text = [[Persistance sharedService].array extObjectAtIndexOrNil:0];
+ value2.text = [[Persistance sharedService].array extObjectAtIndexOrNil:1];
+ value3.text = [[Persistance sharedService].array extObjectAtIndexOrNil:2];
+ value4.text = [[Persistance sharedService].array extObjectAtIndexOrNil:3];
}
- (IBAction)save {
// taking the short route
[[Persistance sharedService].array removeAllObjects];
[[Persistance sharedService].array insertObject:value1.text atIndex:0];
[[Persistance sharedService].array insertObject:value2.text atIndex:1];
[[Persistance sharedService].array insertObject:value3.text atIndex:2];
[[Persistance sharedService].array insertObject:value4.text atIndex:3];
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[value1 resignFirstResponder];
[value2 resignFirstResponder];
[value3 resignFirstResponder];
[value4 resignFirstResponder];
}
- (void)dealloc {
[super dealloc];
}
@end
diff --git a/Classes/NSArray+Ext.h b/Classes/NSArray+Ext.h
new file mode 100644
index 0000000..5f13136
--- /dev/null
+++ b/Classes/NSArray+Ext.h
@@ -0,0 +1,13 @@
+//
+// NSArray+Ext.h
+// Virgin Health Miles Mobile App
+//
+// Created by Ben Ford on 10/27/11.
+// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface NSArray(Ext)
+- (id)extObjectAtIndexOrNil:(NSUInteger)theIndex;
+@end
diff --git a/Classes/NSArray+Ext.m b/Classes/NSArray+Ext.m
new file mode 100644
index 0000000..6cfd868
--- /dev/null
+++ b/Classes/NSArray+Ext.m
@@ -0,0 +1,18 @@
+//
+// NSArray+Ext.m
+// Virgin Health Miles Mobile App
+//
+// Created by Ben Ford on 10/27/11.
+// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "NSArray+Ext.h"
+
+@implementation NSArray(Ext)
+- (id)extObjectAtIndexOrNil:(NSUInteger)theIndex {
+ if( [self count] >= theIndex + 1)
+ return [self objectAtIndex:theIndex];
+ else
+ return nil;
+}
+@end
diff --git a/MainWindow.xib b/MainWindow.xib
index 18a54a1..83f2a17 100644
--- a/MainWindow.xib
+++ b/MainWindow.xib
@@ -1,369 +1,370 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11C74</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1138.23</string>
<string key="IBDocument.HIToolboxVersion">567.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">933</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>IBProxyObject</string>
<string>IBUITabBarItem</string>
<string>IBUIViewController</string>
<string>IBUICustomObject</string>
<string>IBUITabBarController</string>
<string>IBUIWindow</string>
<string>IBUITabBar</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="841351856">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="427554174">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUICustomObject" id="664661524">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUITabBarController" id="675605402">
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
<object class="IBUIViewController" key="IBUISelectedViewController" id="404439053">
<string key="IBUITitle">Dictionary</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="415100502">
<string key="IBUITitle">Dictionary</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">DictionaryEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="NSMutableArray" key="IBUIViewControllers">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIViewController" id="780626317">
<string key="IBUITitle">Boss</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="211206031">
<string key="IBUITitle">Boss</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">PersonEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<reference ref="404439053"/>
<object class="IBUIViewController" id="976730607">
<string key="IBUITitle">Array</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="582457009">
<string key="IBUITitle">Array</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="NSArray" key="IBUIToolbarItems" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">ArrayEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="102828398">
<string key="IBUITitle">View All</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="794213646">
<string key="IBUITitle">View All</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIToolbarItems" ref="0"/>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">ViewAllView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="IBUIInterfaceOrientation">1</int>
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</object>
<object class="IBUITabBar" key="IBUITabBar" id="764819862">
<reference key="NSNextResponder"/>
<int key="NSvFlags">266</int>
<string key="NSFrame">{{0, 431}, {320, 49}}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBUIWindow" id="117978783">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 480}</string>
<reference key="NSSuperview"/>
+ <reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="664661524"/>
</object>
<int key="connectionID">4</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="117978783"/>
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">tabBar</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="675605402"/>
</object>
<int key="connectionID">25</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">rootViewController</string>
<reference key="source" ref="117978783"/>
<reference key="destination" ref="675605402"/>
</object>
<int key="connectionID">28</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="664661524"/>
<reference key="parent" ref="0"/>
<string key="objectName">NSArchiveExample App Delegate</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="427554174"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="117978783"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="675605402"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="764819862"/>
<reference ref="780626317"/>
<reference ref="404439053"/>
<reference ref="976730607"/>
<reference ref="102828398"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="764819862"/>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="780626317"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="211206031"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="404439053"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="415100502"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="415100502"/>
<reference key="parent" ref="404439053"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="211206031"/>
<reference key="parent" ref="780626317"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="976730607"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="582457009"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="582457009"/>
<reference key="parent" ref="976730607"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
<reference key="object" ref="102828398"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="794213646"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="794213646"/>
<reference key="parent" ref="102828398"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
<string>-2.IBPluginDependency</string>
<string>12.IBPluginDependency</string>
<string>15.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>17.CustomClassName</string>
<string>17.IBPluginDependency</string>
<string>18.CustomClassName</string>
<string>18.IBPluginDependency</string>
<string>19.IBPluginDependency</string>
<string>20.IBPluginDependency</string>
<string>21.CustomClassName</string>
<string>21.IBPluginDependency</string>
<string>22.IBPluginDependency</string>
<string>26.CustomClassName</string>
<string>26.IBPluginDependency</string>
<string>27.IBPluginDependency</string>
<string>3.CustomClassName</string>
<string>3.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIApplication</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>PersonEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>DictionaryEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>ArrayEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>ViewAllViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>NSArchiveExampleAppDelegate</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">28</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
diff --git a/NSArchiveExample.xcodeproj/project.pbxproj b/NSArchiveExample.xcodeproj/project.pbxproj
index 8cdfb35..550ceb7 100755
--- a/NSArchiveExample.xcodeproj/project.pbxproj
+++ b/NSArchiveExample.xcodeproj/project.pbxproj
@@ -1,314 +1,328 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */; };
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
B52EA5E51182FC2D0065C4CA /* PersonEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */; };
B52EA600118439900065C4CA /* DictionaryEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */; };
B52EA601118439900065C4CA /* DictionaryEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */; };
B52EA6921186EB390065C4CA /* ArrayEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA6901186EB390065C4CA /* ArrayEntryViewController.m */; };
B52EA6931186EB390065C4CA /* ArrayEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B52EA6911186EB390065C4CA /* ArrayEntryView.xib */; };
+ B569D40114BBAF5800F46D4B /* NSArray+Ext.m in Sources */ = {isa = PBXBuildFile; fileRef = B569D40014BBAF5800F46D4B /* NSArray+Ext.m */; };
B5B25F7F11803200001BA9A0 /* ViewAllViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */; };
B5B25F8011803200001BA9A0 /* ViewAllView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5B25F7E11803200001BA9A0 /* ViewAllView.xib */; };
B5BFA804117F9A96008B450B /* Persistance.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA803117F9A96008B450B /* Persistance.m */; };
B5BFA81D117F9CAD008B450B /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA81C117F9CAD008B450B /* Person.m */; };
B5BFA845117FA1B8008B450B /* PersonEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5BFA844117FA1B8008B450B /* PersonEntryView.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExampleAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSArchiveExampleAppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSArchiveExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NSArchiveExampleViewController.xib; sourceTree = "<group>"; };
28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExample_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "NSArchiveExample-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PersonEntryViewController.h; sourceTree = "<group>"; };
B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PersonEntryViewController.m; sourceTree = "<group>"; };
B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryEntryViewController.h; sourceTree = "<group>"; };
B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DictionaryEntryViewController.m; sourceTree = "<group>"; };
B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DictionaryEntryView.xib; sourceTree = "<group>"; };
B52EA68F1186EB390065C4CA /* ArrayEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayEntryViewController.h; sourceTree = "<group>"; };
B52EA6901186EB390065C4CA /* ArrayEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArrayEntryViewController.m; sourceTree = "<group>"; };
B52EA6911186EB390065C4CA /* ArrayEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ArrayEntryView.xib; sourceTree = "<group>"; };
+ B569D3FF14BBAF5800F46D4B /* NSArray+Ext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Ext.h"; sourceTree = "<group>"; };
+ B569D40014BBAF5800F46D4B /* NSArray+Ext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Ext.m"; sourceTree = "<group>"; };
B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewAllViewController.h; sourceTree = "<group>"; };
B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewAllViewController.m; sourceTree = "<group>"; };
B5B25F7E11803200001BA9A0 /* ViewAllView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ViewAllView.xib; sourceTree = "<group>"; };
B5BFA802117F9A96008B450B /* Persistance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Persistance.h; sourceTree = "<group>"; };
B5BFA803117F9A96008B450B /* Persistance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Persistance.m; sourceTree = "<group>"; };
B5BFA81B117F9CAD008B450B /* Person.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Person.h; sourceTree = "<group>"; };
B5BFA81C117F9CAD008B450B /* Person.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Person.m; sourceTree = "<group>"; };
B5BFA83B117FA0E3008B450B /* Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Model.h; sourceTree = "<group>"; };
B5BFA844117FA1B8008B450B /* PersonEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PersonEntryView.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
+ B569D40214BBAF5A00F46D4B /* Extension */,
B5BFA81E117F9CB4008B450B /* Model */,
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */,
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */,
B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */,
B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */,
B5BFA844117FA1B8008B450B /* PersonEntryView.xib */,
B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */,
B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */,
B5B25F7E11803200001BA9A0 /* ViewAllView.xib */,
B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */,
B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */,
B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */,
B52EA68F1186EB390065C4CA /* ArrayEntryViewController.h */,
B52EA6901186EB390065C4CA /* ArrayEntryViewController.m */,
B52EA6911186EB390065C4CA /* ArrayEntryView.xib */,
);
path = Classes;
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = CustomTemplate;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */,
28AD733E0D9D9553002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
288765A40DF7441C002DB57D /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
+ B569D40214BBAF5A00F46D4B /* Extension */ = {
+ isa = PBXGroup;
+ children = (
+ B569D3FF14BBAF5800F46D4B /* NSArray+Ext.h */,
+ B569D40014BBAF5800F46D4B /* NSArray+Ext.m */,
+ );
+ name = Extension;
+ sourceTree = "<group>";
+ };
B5BFA81E117F9CB4008B450B /* Model */ = {
isa = PBXGroup;
children = (
B5BFA83B117FA0E3008B450B /* Model.h */,
B5BFA802117F9A96008B450B /* Persistance.h */,
B5BFA803117F9A96008B450B /* Persistance.m */,
B5BFA81B117F9CAD008B450B /* Person.h */,
B5BFA81C117F9CAD008B450B /* Person.m */,
);
name = Model;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */;
buildPhases = (
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = NSArchiveExample;
productName = NSArchiveExample;
productReference = 1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
targets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1D60588D0D05DD3D006BFB54 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */,
B5BFA845117FA1B8008B450B /* PersonEntryView.xib in Resources */,
B5B25F8011803200001BA9A0 /* ViewAllView.xib in Resources */,
B52EA601118439900065C4CA /* DictionaryEntryView.xib in Resources */,
B52EA6931186EB390065C4CA /* ArrayEntryView.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */,
B5BFA804117F9A96008B450B /* Persistance.m in Sources */,
B5BFA81D117F9CAD008B450B /* Person.m in Sources */,
B5B25F7F11803200001BA9A0 /* ViewAllViewController.m in Sources */,
B52EA5E51182FC2D0065C4CA /* PersonEntryViewController.m in Sources */,
B52EA600118439900065C4CA /* DictionaryEntryViewController.m in Sources */,
B52EA6921186EB390065C4CA /* ArrayEntryViewController.m in Sources */,
+ B569D40114BBAF5800F46D4B /* NSArray+Ext.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.2;
PRODUCT_NAME = NSArchiveExample;
SDKROOT = iphoneos;
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.2;
PRODUCT_NAME = NSArchiveExample;
SDKROOT = iphoneos;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
SDKROOT = iphoneos;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1D6058940D05DD3E006BFB54 /* Debug */,
1D6058950D05DD3E006BFB54 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
|
bentford/NSArchiveExample
|
d33a908095d7b16322b3f4c6d3ac960ad86c2d93
|
This is a working Xcode 4 project that builds successfully. (although it crashes still on weird error).
|
diff --git a/.gitignore b/.gitignore
index 378eac2..0008167 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,18 @@
-build
+# osx noise
+.DS_Store
+profile
+
+# xcode noise
+build/*
+*.mode1
+*.mode1v3
+*.mode2v3
+*.perspective
+*.perspectivev3
+*.pbxuser
+*.xcworkspace
+xcuserdata
+
+# svn & cvs
+.svn
+CVS
diff --git a/Classes/Persistance.m b/Classes/Persistance.m
index 64c53ca..9d2e4ec 100644
--- a/Classes/Persistance.m
+++ b/Classes/Persistance.m
@@ -1,124 +1,124 @@
//
// Persistance.m
// GuestInfo
//
// Created by Ben Ford on 10/23/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "Persistance.h"
#import "Person.h"
@implementation Persistance
@synthesize boss, dictionary, array;
//taken from apple code example:
//http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/TP40002974-CH4-SW32
static Persistance *sharedGlobalInstance = nil;
- (id)init {
self = [super init];
return self;
}
#pragma mark Singleton
+ (Persistance*) sharedService {
if( sharedGlobalInstance == nil )
{
[[self alloc] init];// assignment not done here
}
return sharedGlobalInstance;
}
+ (Persistance*) allocWithZone:(NSZone*)zone {
@synchronized(self) {
if (sharedGlobalInstance == nil) {
sharedGlobalInstance = [super allocWithZone:zone];
return sharedGlobalInstance; // assignment and return on first allocation
}
}
return nil; //on subsequent allocation attempts return nil
}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (id)retain {
return self;
}
- (unsigned)retainCount {
return UINT_MAX; //denotes an object that cannot be released
}
-- (void)release {
+- (oneway void)release {
//do nothing
}
- (id)autorelease {
return self;
}
#pragma mark -
#pragma mark LifeCycle
- (void)loadFromDisk {
// boss
NSString *bossFilePath = [Persistance pathForDocumentsDirectoryFile:@"boss.archive"];
self.boss = [NSKeyedUnarchiver unarchiveObjectWithFile:bossFilePath];
if( !self.boss )
self.boss = [Person defaultPerson];
// managers
NSString *managerFilePath = [Persistance pathForDocumentsDirectoryFile:@"managers.archive"];
self.dictionary = [NSKeyedUnarchiver unarchiveObjectWithFile:managerFilePath];
if( !self.dictionary )
self.dictionary = [NSMutableDictionary dictionaryWithCapacity:0];
// employees
NSString *employeesFilePath = [Persistance pathForDocumentsDirectoryFile:@"employees.archive"];
self.array = [NSKeyedUnarchiver unarchiveObjectWithFile:employeesFilePath];
if( !self.array )
self.array = [NSMutableArray arrayWithCapacity:0];
}
- (void)saveToDisk {
NSString *dictionaryFilePath = [Persistance pathForDocumentsDirectoryFile:@"boss.archive"];
[NSKeyedArchiver archiveRootObject:self.boss toFile:dictionaryFilePath];
NSString *managersFilePath = [Persistance pathForDocumentsDirectoryFile:@"managers.archive"];
[NSKeyedArchiver archiveRootObject:self.dictionary toFile:managersFilePath];
NSString *arrayFilePath = [Persistance pathForDocumentsDirectoryFile:@"employees.archive"];
[NSKeyedArchiver archiveRootObject:self.array toFile:arrayFilePath];
}
#pragma mark -
#pragma mark helpers
+ (NSString *)pathForDocumentsDirectoryFile:(NSString*)filename {
NSArray *paths = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
return [documentsDirectory stringByAppendingPathComponent:filename];
}
#pragma mark -
- (void)dealloc {
self.boss = nil;
self.dictionary = nil;
self.array = nil;
[super dealloc];
}
@end
diff --git a/NSArchiveExample.xcodeproj/Ben.pbxuser b/NSArchiveExample.xcodeproj/Ben.pbxuser
deleted file mode 100644
index acb01ec..0000000
--- a/NSArchiveExample.xcodeproj/Ben.pbxuser
+++ /dev/null
@@ -1,320 +0,0 @@
-// !$*UTF8*$!
-{
- 1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
- sepNavSelRange = "{0, 0}";
- sepNavVisRange = "{0, 529}";
- };
- };
- 1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
- sepNavSelRange = "{266, 0}";
- sepNavVisRange = "{0, 849}";
- };
- };
- 1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
- activeExec = 0;
- executables = (
- B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
- );
- };
- 29B97313FDCFA39411CA2CEA /* Project object */ = {
- activeBuildConfigurationName = Debug;
- activeExecutable = B5BFA7F6117F9A63008B450B /* NSArchiveExample */;
- activeTarget = 1D6058900D05DD3D006BFB54 /* NSArchiveExample */;
- addToTargets = (
- 1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
- );
- codeSenseManager = B5BFA801117F9A81008B450B /* Code sense */;
- executables = (
- B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
- );
- perUserDictionary = {
- PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = {
- PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
- PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID;
- PBXFileTableDataSourceColumnWidthsKey = (
- 22,
- 300,
- 442,
- );
- PBXFileTableDataSourceColumnsKey = (
- PBXExecutablesDataSource_ActiveFlagID,
- PBXExecutablesDataSource_NameID,
- PBXExecutablesDataSource_CommentsID,
- );
- };
- PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
- PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
- PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
- PBXFileTableDataSourceColumnWidthsKey = (
- 20,
- 554,
- 20,
- 48,
- 43,
- 43,
- 20,
- );
- PBXFileTableDataSourceColumnsKey = (
- PBXFileDataSource_FiletypeID,
- PBXFileDataSource_Filename_ColumnID,
- PBXFileDataSource_Built_ColumnID,
- PBXFileDataSource_ObjectSize_ColumnID,
- PBXFileDataSource_Errors_ColumnID,
- PBXFileDataSource_Warnings_ColumnID,
- PBXFileDataSource_Target_ColumnID,
- );
- };
- PBXPerProjectTemplateStateSaveDate = 294054686;
- PBXWorkspaceStateSaveDate = 294054686;
- };
- perUserProjectItems = {
- B52EA64E118441EE0065C4CA = B52EA64E118441EE0065C4CA /* PBXTextBookmark */;
- B52EA64F118441EE0065C4CA = B52EA64F118441EE0065C4CA /* PBXTextBookmark */;
- B52EA650118441EE0065C4CA = B52EA650118441EE0065C4CA /* PBXTextBookmark */;
- B52EA651118441EE0065C4CA = B52EA651118441EE0065C4CA /* PBXTextBookmark */;
- B52EA652118441EE0065C4CA = B52EA652118441EE0065C4CA /* PBXTextBookmark */;
- B52EA653118441EE0065C4CA = B52EA653118441EE0065C4CA /* PBXTextBookmark */;
- B52EA67E118443920065C4CA = B52EA67E118443920065C4CA /* PBXTextBookmark */;
- B52EA685118443CA0065C4CA = B52EA685118443CA0065C4CA /* PBXTextBookmark */;
- B52EA686118443CA0065C4CA = B52EA686118443CA0065C4CA /* PBXTextBookmark */;
- B52EA6881184EAA50065C4CA = B52EA6881184EAA50065C4CA /* PBXTextBookmark */;
- B5B25FAA11803848001BA9A0 = B5B25FAA11803848001BA9A0 /* PBXTextBookmark */;
- };
- sourceControlManager = B5BFA800117F9A81008B450B /* Source Control */;
- userBuildSettings = {
- };
- };
- B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {732, 418}}";
- sepNavSelRange = "{455, 0}";
- sepNavVisRange = "{0, 461}";
- };
- };
- B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {732, 874}}";
- sepNavSelRange = "{261, 176}";
- sepNavVisRange = "{0, 486}";
- };
- };
- B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {732, 399}}";
- sepNavSelRange = "{407, 0}";
- sepNavVisRange = "{0, 413}";
- };
- };
- B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {732, 855}}";
- sepNavSelRange = "{437, 0}";
- sepNavVisRange = "{310, 672}";
- };
- };
- B52EA64E118441EE0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA81C117F9CAD008B450B /* Person.m */;
- name = "Person.m: 42";
- rLen = 0;
- rLoc = 1045;
- rType = 0;
- vrLen = 515;
- vrLoc = 888;
- };
- B52EA64F118441EE0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */;
- name = "PersonEntryViewController.h: 20";
- rLen = 0;
- rLoc = 455;
- rType = 0;
- vrLen = 461;
- vrLoc = 0;
- };
- B52EA650118441EE0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA802117F9A96008B450B /* Persistance.h */;
- name = "Persistance.h: 22";
- rLen = 0;
- rLoc = 456;
- rType = 0;
- vrLen = 438;
- vrLoc = 21;
- };
- B52EA651118441EE0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA803117F9A96008B450B /* Persistance.m */;
- name = "Persistance.m: 120";
- rLen = 0;
- rLoc = 3347;
- rType = 0;
- vrLen = 614;
- vrLoc = 2767;
- };
- B52EA652118441EE0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */;
- name = "DictionaryEntryViewController.h: 19";
- rLen = 0;
- rLoc = 407;
- rType = 0;
- vrLen = 413;
- vrLoc = 0;
- };
- B52EA653118441EE0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */;
- name = "PersonEntryViewController.m: 13";
- rLen = 176;
- rLoc = 261;
- rType = 0;
- vrLen = 486;
- vrLoc = 0;
- };
- B52EA67E118443920065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 15";
- rLen = 0;
- rLoc = 307;
- rType = 0;
- vrLen = 369;
- vrLoc = 52;
- };
- B52EA685118443CA0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */;
- name = "DictionaryEntryViewController.m: 21";
- rLen = 0;
- rLoc = 437;
- rType = 0;
- vrLen = 672;
- vrLoc = 310;
- };
- B52EA686118443CA0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */;
- name = "ViewAllViewController.h: 13";
- rLen = 0;
- rLoc = 267;
- rType = 0;
- vrLen = 276;
- vrLoc = 0;
- };
- B52EA6881184EAA50065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 33";
- rLen = 0;
- rLoc = 655;
- rType = 0;
- vrLen = 389;
- vrLoc = 385;
- };
- B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {732, 362}}";
- sepNavSelRange = "{267, 0}";
- sepNavVisRange = "{0, 276}";
- };
- };
- B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {756, 2033}}";
- sepNavSelRange = "{655, 0}";
- sepNavVisRange = "{385, 388}";
- };
- };
- B5B25FAA11803848001BA9A0 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA81B117F9CAD008B450B /* Person.h */;
- name = "Person.h: 23";
- rLen = 0;
- rLoc = 495;
- rType = 0;
- vrLen = 535;
- vrLoc = 40;
- };
- B5BFA7F6117F9A63008B450B /* NSArchiveExample */ = {
- isa = PBXExecutable;
- activeArgIndices = (
- );
- argumentStrings = (
- );
- autoAttachOnCrash = 1;
- breakpointsEnabled = 0;
- configStateDict = {
- };
- customDataFormattersEnabled = 1;
- dataTipCustomDataFormattersEnabled = 1;
- dataTipShowTypeColumn = 1;
- dataTipSortType = 0;
- debuggerPlugin = GDBDebugging;
- disassemblyDisplayState = 0;
- dylibVariantSuffix = "";
- enableDebugStr = 1;
- environmentEntries = (
- );
- executableSystemSymbolLevel = 0;
- executableUserSymbolLevel = 0;
- libgmallocEnabled = 0;
- name = NSArchiveExample;
- showTypeColumn = 0;
- sourceDirectories = (
- );
- };
- B5BFA800117F9A81008B450B /* Source Control */ = {
- isa = PBXSourceControlManager;
- fallbackIsa = XCSourceControlManager;
- isSCMEnabled = 0;
- scmConfiguration = {
- repositoryNamesForRoots = {
- "" = "";
- };
- };
- };
- B5BFA801117F9A81008B450B /* Code sense */ = {
- isa = PBXCodeSenseManager;
- indexTemplatePath = "";
- };
- B5BFA802117F9A96008B450B /* Persistance.h */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {732, 608}}";
- sepNavSelRange = "{456, 0}";
- sepNavVisRange = "{21, 438}";
- };
- };
- B5BFA803117F9A96008B450B /* Persistance.m */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {828, 2166}}";
- sepNavSelRange = "{3347, 0}";
- sepNavVisRange = "{2767, 614}";
- };
- };
- B5BFA81B117F9CAD008B450B /* Person.h */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {732, 532}}";
- sepNavSelRange = "{495, 0}";
- sepNavVisRange = "{40, 535}";
- };
- };
- B5BFA81C117F9CAD008B450B /* Person.m */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {732, 1102}}";
- sepNavSelRange = "{1045, 0}";
- sepNavVisRange = "{888, 515}";
- };
- };
- B5BFA83B117FA0E3008B450B /* Model.h */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
- sepNavSelRange = "{161, 0}";
- sepNavVisRange = "{0, 181}";
- };
- };
-}
diff --git a/NSArchiveExample.xcodeproj/ben.mode1v3 b/NSArchiveExample.xcodeproj/ben.mode1v3
deleted file mode 100644
index b5f902b..0000000
--- a/NSArchiveExample.xcodeproj/ben.mode1v3
+++ /dev/null
@@ -1,1407 +0,0 @@
-<?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>ActivePerspectiveName</key>
- <string>Project</string>
- <key>AllowedModules</key>
- <array>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>n</string>
- <key>Module</key>
- <string>PBXSmartGroupTreeModule</string>
- <key>Name</key>
- <string>Groups and Files Outline View</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>n</string>
- <key>Module</key>
- <string>PBXNavigatorGroup</string>
- <key>Name</key>
- <string>Editor</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>n</string>
- <key>Module</key>
- <string>XCTaskListModule</string>
- <key>Name</key>
- <string>Task List</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>n</string>
- <key>Module</key>
- <string>XCDetailModule</string>
- <key>Name</key>
- <string>File and Smart Group Detail Viewer</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>1</string>
- <key>Module</key>
- <string>PBXBuildResultsModule</string>
- <key>Name</key>
- <string>Detailed Build Results Viewer</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>1</string>
- <key>Module</key>
- <string>PBXProjectFindModule</string>
- <key>Name</key>
- <string>Project Batch Find Tool</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>n</string>
- <key>Module</key>
- <string>XCProjectFormatConflictsModule</string>
- <key>Name</key>
- <string>Project Format Conflicts List</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>n</string>
- <key>Module</key>
- <string>PBXBookmarksModule</string>
- <key>Name</key>
- <string>Bookmarks Tool</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>n</string>
- <key>Module</key>
- <string>PBXClassBrowserModule</string>
- <key>Name</key>
- <string>Class Browser</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>n</string>
- <key>Module</key>
- <string>PBXCVSModule</string>
- <key>Name</key>
- <string>Source Code Control Tool</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>n</string>
- <key>Module</key>
- <string>PBXDebugBreakpointsModule</string>
- <key>Name</key>
- <string>Debug Breakpoints Tool</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>n</string>
- <key>Module</key>
- <string>XCDockableInspector</string>
- <key>Name</key>
- <string>Inspector</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>n</string>
- <key>Module</key>
- <string>PBXOpenQuicklyModule</string>
- <key>Name</key>
- <string>Open Quickly Tool</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>1</string>
- <key>Module</key>
- <string>PBXDebugSessionModule</string>
- <key>Name</key>
- <string>Debugger</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>1</string>
- <key>Module</key>
- <string>PBXDebugCLIModule</string>
- <key>Name</key>
- <string>Debug Console</string>
- </dict>
- <dict>
- <key>BundleLoadPath</key>
- <string></string>
- <key>MaxInstances</key>
- <string>n</string>
- <key>Module</key>
- <string>XCSnapshotModule</string>
- <key>Name</key>
- <string>Snapshots Tool</string>
- </dict>
- </array>
- <key>BundlePath</key>
- <string>/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources</string>
- <key>Description</key>
- <string>DefaultDescriptionKey</string>
- <key>DockingSystemVisible</key>
- <false/>
- <key>Extension</key>
- <string>mode1v3</string>
- <key>FavBarConfig</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>B5B25F6711802DFC001BA9A0</string>
- <key>XCBarModuleItemNames</key>
- <dict/>
- <key>XCBarModuleItems</key>
- <array/>
- </dict>
- <key>FirstTimeWindowDisplayed</key>
- <false/>
- <key>Identifier</key>
- <string>com.apple.perspectives.project.mode1v3</string>
- <key>MajorVersion</key>
- <integer>33</integer>
- <key>MinorVersion</key>
- <integer>0</integer>
- <key>Name</key>
- <string>Default</string>
- <key>Notifications</key>
- <array/>
- <key>OpenEditors</key>
- <array/>
- <key>PerspectiveWidths</key>
- <array>
- <integer>-1</integer>
- <integer>-1</integer>
- </array>
- <key>Perspectives</key>
- <array>
- <dict>
- <key>ChosenToolbarItems</key>
- <array>
- <string>active-combo-popup</string>
- <string>action</string>
- <string>NSToolbarFlexibleSpaceItem</string>
- <string>debugger-enable-breakpoints</string>
- <string>build-and-go</string>
- <string>com.apple.ide.PBXToolbarStopButton</string>
- <string>get-info</string>
- <string>NSToolbarFlexibleSpaceItem</string>
- <string>com.apple.pbx.toolbar.searchfield</string>
- </array>
- <key>ControllerClassBaseName</key>
- <string></string>
- <key>IconName</key>
- <string>WindowOfProjectWithEditor</string>
- <key>Identifier</key>
- <string>perspective.project</string>
- <key>IsVertical</key>
- <false/>
- <key>Layout</key>
- <array>
- <dict>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXBottomSmartGroupGIDs</key>
- <array>
- <string>1C37FBAC04509CD000000102</string>
- <string>1C37FAAC04509CD000000102</string>
- <string>1C37FABC05509CD000000102</string>
- <string>1C37FABC05539CD112110102</string>
- <string>E2644B35053B69B200211256</string>
- <string>1C37FABC04509CD000100104</string>
- <string>1CC0EA4004350EF90044410B</string>
- <string>1CC0EA4004350EF90041110B</string>
- </array>
- <key>PBXProjectModuleGUID</key>
- <string>1CE0B1FE06471DED0097A5F4</string>
- <key>PBXProjectModuleLabel</key>
- <string>Files</string>
- <key>PBXProjectStructureProvided</key>
- <string>yes</string>
- <key>PBXSmartGroupTreeModuleColumnData</key>
- <dict>
- <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
- <array>
- <real>270</real>
- </array>
- <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
- <array>
- <string>MainColumn</string>
- </array>
- </dict>
- <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
- <dict>
- <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
- <array>
- <string>29B97314FDCFA39411CA2CEA</string>
- <string>080E96DDFE201D6D7F000001</string>
- <string>B5BFA81E117F9CB4008B450B</string>
- <string>29B97317FDCFA39411CA2CEA</string>
- <string>1C37FABC05509CD000000102</string>
- </array>
- <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
- <array>
- <array>
- <integer>14</integer>
- <integer>1</integer>
- <integer>0</integer>
- </array>
- </array>
- <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 0}, {270, 597}}</string>
- </dict>
- <key>PBXTopSmartGroupGIDs</key>
- <array/>
- <key>XCIncludePerspectivesSwitch</key>
- <true/>
- <key>XCSharingToken</key>
- <string>com.apple.Xcode.GFSharingToken</string>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{{0, 0}, {287, 615}}</string>
- <key>GroupTreeTableConfiguration</key>
- <array>
- <string>MainColumn</string>
- <real>270</real>
- </array>
- <key>RubberWindowFrame</key>
- <string>1 122 1085 656 0 0 1280 778 </string>
- </dict>
- <key>Module</key>
- <string>PBXSmartGroupTreeModule</string>
- <key>Proportion</key>
- <string>287pt</string>
- </dict>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>BecomeActive</key>
- <true/>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>1CE0B20306471E060097A5F4</string>
- <key>PBXProjectModuleLabel</key>
- <string>ViewAllViewController.m</string>
- <key>PBXSplitModuleInNavigatorKey</key>
- <dict>
- <key>Split0</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>1CE0B20406471E060097A5F4</string>
- <key>PBXProjectModuleLabel</key>
- <string>ViewAllViewController.m</string>
- <key>_historyCapacity</key>
- <integer>0</integer>
- <key>bookmark</key>
- <string>B52EA6881184EAA50065C4CA</string>
- <key>history</key>
- <array>
- <string>B5B25FAA11803848001BA9A0</string>
- <string>B52EA64E118441EE0065C4CA</string>
- <string>B52EA64F118441EE0065C4CA</string>
- <string>B52EA650118441EE0065C4CA</string>
- <string>B52EA651118441EE0065C4CA</string>
- <string>B52EA652118441EE0065C4CA</string>
- <string>B52EA653118441EE0065C4CA</string>
- <string>B52EA685118443CA0065C4CA</string>
- <string>B52EA686118443CA0065C4CA</string>
- <string>B52EA67E118443920065C4CA</string>
- </array>
- </dict>
- <key>SplitCount</key>
- <string>1</string>
- </dict>
- <key>StatusBarVisibility</key>
- <true/>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{{0, 0}, {793, 417}}</string>
- <key>RubberWindowFrame</key>
- <string>1 122 1085 656 0 0 1280 778 </string>
- </dict>
- <key>Module</key>
- <string>PBXNavigatorGroup</string>
- <key>Proportion</key>
- <string>417pt</string>
- </dict>
- <dict>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>1CE0B20506471E060097A5F4</string>
- <key>PBXProjectModuleLabel</key>
- <string>Detail</string>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{{0, 422}, {793, 193}}</string>
- <key>RubberWindowFrame</key>
- <string>1 122 1085 656 0 0 1280 778 </string>
- </dict>
- <key>Module</key>
- <string>XCDetailModule</string>
- <key>Proportion</key>
- <string>193pt</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>793pt</string>
- </dict>
- </array>
- <key>Name</key>
- <string>Project</string>
- <key>ServiceClasses</key>
- <array>
- <string>XCModuleDock</string>
- <string>PBXSmartGroupTreeModule</string>
- <string>XCModuleDock</string>
- <string>PBXNavigatorGroup</string>
- <string>XCDetailModule</string>
- </array>
- <key>TableOfContents</key>
- <array>
- <string>B52EA5CA1182F38B0065C4CA</string>
- <string>1CE0B1FE06471DED0097A5F4</string>
- <string>B52EA5CB1182F38B0065C4CA</string>
- <string>1CE0B20306471E060097A5F4</string>
- <string>1CE0B20506471E060097A5F4</string>
- </array>
- <key>ToolbarConfigUserDefaultsMinorVersion</key>
- <string>2</string>
- <key>ToolbarConfiguration</key>
- <string>xcode.toolbar.config.defaultV3</string>
- </dict>
- <dict>
- <key>ControllerClassBaseName</key>
- <string></string>
- <key>IconName</key>
- <string>WindowOfProject</string>
- <key>Identifier</key>
- <string>perspective.morph</string>
- <key>IsVertical</key>
- <integer>0</integer>
- <key>Layout</key>
- <array>
- <dict>
- <key>BecomeActive</key>
- <integer>1</integer>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXBottomSmartGroupGIDs</key>
- <array>
- <string>1C37FBAC04509CD000000102</string>
- <string>1C37FAAC04509CD000000102</string>
- <string>1C08E77C0454961000C914BD</string>
- <string>1C37FABC05509CD000000102</string>
- <string>1C37FABC05539CD112110102</string>
- <string>E2644B35053B69B200211256</string>
- <string>1C37FABC04509CD000100104</string>
- <string>1CC0EA4004350EF90044410B</string>
- <string>1CC0EA4004350EF90041110B</string>
- </array>
- <key>PBXProjectModuleGUID</key>
- <string>11E0B1FE06471DED0097A5F4</string>
- <key>PBXProjectModuleLabel</key>
- <string>Files</string>
- <key>PBXProjectStructureProvided</key>
- <string>yes</string>
- <key>PBXSmartGroupTreeModuleColumnData</key>
- <dict>
- <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
- <array>
- <real>186</real>
- </array>
- <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
- <array>
- <string>MainColumn</string>
- </array>
- </dict>
- <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
- <dict>
- <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
- <array>
- <string>29B97314FDCFA39411CA2CEA</string>
- <string>1C37FABC05509CD000000102</string>
- </array>
- <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
- <array>
- <array>
- <integer>0</integer>
- </array>
- </array>
- <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 0}, {186, 337}}</string>
- </dict>
- <key>PBXTopSmartGroupGIDs</key>
- <array/>
- <key>XCIncludePerspectivesSwitch</key>
- <integer>1</integer>
- <key>XCSharingToken</key>
- <string>com.apple.Xcode.GFSharingToken</string>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{{0, 0}, {203, 355}}</string>
- <key>GroupTreeTableConfiguration</key>
- <array>
- <string>MainColumn</string>
- <real>186</real>
- </array>
- <key>RubberWindowFrame</key>
- <string>373 269 690 397 0 0 1440 878 </string>
- </dict>
- <key>Module</key>
- <string>PBXSmartGroupTreeModule</string>
- <key>Proportion</key>
- <string>100%</string>
- </dict>
- </array>
- <key>Name</key>
- <string>Morph</string>
- <key>PreferredWidth</key>
- <integer>300</integer>
- <key>ServiceClasses</key>
- <array>
- <string>XCModuleDock</string>
- <string>PBXSmartGroupTreeModule</string>
- </array>
- <key>TableOfContents</key>
- <array>
- <string>11E0B1FE06471DED0097A5F4</string>
- </array>
- <key>ToolbarConfiguration</key>
- <string>xcode.toolbar.config.default.shortV3</string>
- </dict>
- </array>
- <key>PerspectivesBarVisible</key>
- <false/>
- <key>ShelfIsVisible</key>
- <false/>
- <key>SourceDescription</key>
- <string>file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec'</string>
- <key>StatusbarIsVisible</key>
- <true/>
- <key>TimeStamp</key>
- <real>0.0</real>
- <key>ToolbarConfigUserDefaultsMinorVersion</key>
- <string>2</string>
- <key>ToolbarDisplayMode</key>
- <integer>1</integer>
- <key>ToolbarIsVisible</key>
- <true/>
- <key>ToolbarSizeMode</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Perspectives</string>
- <key>UpdateMessage</key>
- <string>The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'?</string>
- <key>WindowJustification</key>
- <integer>5</integer>
- <key>WindowOrderList</key>
- <array>
- <string>1C78EAAD065D492600B07095</string>
- <string>1CD10A99069EF8BA00B06720</string>
- <string>B5B25F6811802DFC001BA9A0</string>
- <string>/Users/ben/Devel/iPhone/NSArchiveExample/NSArchiveExample.xcodeproj</string>
- </array>
- <key>WindowString</key>
- <string>1 122 1085 656 0 0 1280 778 </string>
- <key>WindowToolsV3</key>
- <array>
- <dict>
- <key>FirstTimeWindowDisplayed</key>
- <false/>
- <key>Identifier</key>
- <string>windowTool.build</string>
- <key>IsVertical</key>
- <true/>
- <key>Layout</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>1CD0528F0623707200166675</string>
- <key>PBXProjectModuleLabel</key>
- <string></string>
- <key>StatusBarVisibility</key>
- <true/>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{{0, 0}, {500, 218}}</string>
- <key>RubberWindowFrame</key>
- <string>267 217 500 500 0 0 1280 778 </string>
- </dict>
- <key>Module</key>
- <string>PBXNavigatorGroup</string>
- <key>Proportion</key>
- <string>218pt</string>
- </dict>
- <dict>
- <key>BecomeActive</key>
- <true/>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>XCMainBuildResultsModuleGUID</string>
- <key>PBXProjectModuleLabel</key>
- <string>Build Results</string>
- <key>XCBuildResultsTrigger_Collapse</key>
- <integer>1021</integer>
- <key>XCBuildResultsTrigger_Open</key>
- <integer>1011</integer>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{{0, 223}, {500, 236}}</string>
- <key>RubberWindowFrame</key>
- <string>267 217 500 500 0 0 1280 778 </string>
- </dict>
- <key>Module</key>
- <string>PBXBuildResultsModule</string>
- <key>Proportion</key>
- <string>236pt</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>459pt</string>
- </dict>
- </array>
- <key>Name</key>
- <string>Build Results</string>
- <key>ServiceClasses</key>
- <array>
- <string>PBXBuildResultsModule</string>
- </array>
- <key>StatusbarIsVisible</key>
- <true/>
- <key>TableOfContents</key>
- <array>
- <string>B5B25F6811802DFC001BA9A0</string>
- <string>B52EA5CC1182F38B0065C4CA</string>
- <string>1CD0528F0623707200166675</string>
- <string>XCMainBuildResultsModuleGUID</string>
- </array>
- <key>ToolbarConfiguration</key>
- <string>xcode.toolbar.config.buildV3</string>
- <key>WindowContentMinSize</key>
- <string>486 300</string>
- <key>WindowString</key>
- <string>267 217 500 500 0 0 1280 778 </string>
- <key>WindowToolGUID</key>
- <string>B5B25F6811802DFC001BA9A0</string>
- <key>WindowToolIsVisible</key>
- <false/>
- </dict>
- <dict>
- <key>FirstTimeWindowDisplayed</key>
- <false/>
- <key>Identifier</key>
- <string>windowTool.debugger</string>
- <key>IsVertical</key>
- <true/>
- <key>Layout</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>ContentConfiguration</key>
- <dict>
- <key>Debugger</key>
- <dict>
- <key>HorizontalSplitView</key>
- <dict>
- <key>_collapsingFrameDimension</key>
- <real>0.0</real>
- <key>_indexOfCollapsedView</key>
- <integer>0</integer>
- <key>_percentageOfCollapsedView</key>
- <real>0.0</real>
- <key>isCollapsed</key>
- <string>yes</string>
- <key>sizes</key>
- <array>
- <string>{{0, 0}, {316, 194}}</string>
- <string>{{316, 0}, {378, 194}}</string>
- </array>
- </dict>
- <key>VerticalSplitView</key>
- <dict>
- <key>_collapsingFrameDimension</key>
- <real>0.0</real>
- <key>_indexOfCollapsedView</key>
- <integer>0</integer>
- <key>_percentageOfCollapsedView</key>
- <real>0.0</real>
- <key>isCollapsed</key>
- <string>yes</string>
- <key>sizes</key>
- <array>
- <string>{{0, 0}, {694, 194}}</string>
- <string>{{0, 194}, {694, 187}}</string>
- </array>
- </dict>
- </dict>
- <key>LauncherConfigVersion</key>
- <string>8</string>
- <key>PBXProjectModuleGUID</key>
- <string>1C162984064C10D400B95A72</string>
- <key>PBXProjectModuleLabel</key>
- <string>Debug - GLUTExamples (Underwater)</string>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>DebugConsoleVisible</key>
- <string>None</string>
- <key>DebugConsoleWindowFrame</key>
- <string>{{200, 200}, {500, 300}}</string>
- <key>DebugSTDIOWindowFrame</key>
- <string>{{200, 200}, {500, 300}}</string>
- <key>Frame</key>
- <string>{{0, 0}, {694, 381}}</string>
- <key>PBXDebugSessionStackFrameViewKey</key>
- <dict>
- <key>DebugVariablesTableConfiguration</key>
- <array>
- <string>Name</string>
- <real>120</real>
- <string>Value</string>
- <real>85</real>
- <string>Summary</string>
- <real>148</real>
- </array>
- <key>Frame</key>
- <string>{{316, 0}, {378, 194}}</string>
- <key>RubberWindowFrame</key>
- <string>22 333 694 422 0 0 1280 778 </string>
- </dict>
- <key>RubberWindowFrame</key>
- <string>22 333 694 422 0 0 1280 778 </string>
- </dict>
- <key>Module</key>
- <string>PBXDebugSessionModule</string>
- <key>Proportion</key>
- <string>381pt</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>381pt</string>
- </dict>
- </array>
- <key>Name</key>
- <string>Debugger</string>
- <key>ServiceClasses</key>
- <array>
- <string>PBXDebugSessionModule</string>
- </array>
- <key>StatusbarIsVisible</key>
- <true/>
- <key>TableOfContents</key>
- <array>
- <string>1CD10A99069EF8BA00B06720</string>
- <string>B52EA5D31182F9CF0065C4CA</string>
- <string>1C162984064C10D400B95A72</string>
- <string>B52EA5D41182F9CF0065C4CA</string>
- <string>B52EA5D51182F9CF0065C4CA</string>
- <string>B52EA5D61182F9CF0065C4CA</string>
- <string>B52EA5D71182F9CF0065C4CA</string>
- <string>B52EA5D81182F9CF0065C4CA</string>
- </array>
- <key>ToolbarConfiguration</key>
- <string>xcode.toolbar.config.debugV3</string>
- <key>WindowString</key>
- <string>22 333 694 422 0 0 1280 778 </string>
- <key>WindowToolGUID</key>
- <string>1CD10A99069EF8BA00B06720</string>
- <key>WindowToolIsVisible</key>
- <false/>
- </dict>
- <dict>
- <key>Identifier</key>
- <string>windowTool.find</string>
- <key>Layout</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>1CDD528C0622207200134675</string>
- <key>PBXProjectModuleLabel</key>
- <string><No Editor></string>
- <key>PBXSplitModuleInNavigatorKey</key>
- <dict>
- <key>Split0</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>1CD0528D0623707200166675</string>
- </dict>
- <key>SplitCount</key>
- <string>1</string>
- </dict>
- <key>StatusBarVisibility</key>
- <integer>1</integer>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{{0, 0}, {781, 167}}</string>
- <key>RubberWindowFrame</key>
- <string>62 385 781 470 0 0 1440 878 </string>
- </dict>
- <key>Module</key>
- <string>PBXNavigatorGroup</string>
- <key>Proportion</key>
- <string>781pt</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>50%</string>
- </dict>
- <dict>
- <key>BecomeActive</key>
- <integer>1</integer>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>1CD0528E0623707200166675</string>
- <key>PBXProjectModuleLabel</key>
- <string>Project Find</string>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{{8, 0}, {773, 254}}</string>
- <key>RubberWindowFrame</key>
- <string>62 385 781 470 0 0 1440 878 </string>
- </dict>
- <key>Module</key>
- <string>PBXProjectFindModule</string>
- <key>Proportion</key>
- <string>50%</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>428pt</string>
- </dict>
- </array>
- <key>Name</key>
- <string>Project Find</string>
- <key>ServiceClasses</key>
- <array>
- <string>PBXProjectFindModule</string>
- </array>
- <key>StatusbarIsVisible</key>
- <integer>1</integer>
- <key>TableOfContents</key>
- <array>
- <string>1C530D57069F1CE1000CFCEE</string>
- <string>1C530D58069F1CE1000CFCEE</string>
- <string>1C530D59069F1CE1000CFCEE</string>
- <string>1CDD528C0622207200134675</string>
- <string>1C530D5A069F1CE1000CFCEE</string>
- <string>1CE0B1FE06471DED0097A5F4</string>
- <string>1CD0528E0623707200166675</string>
- </array>
- <key>WindowString</key>
- <string>62 385 781 470 0 0 1440 878 </string>
- <key>WindowToolGUID</key>
- <string>1C530D57069F1CE1000CFCEE</string>
- <key>WindowToolIsVisible</key>
- <integer>0</integer>
- </dict>
- <dict>
- <key>Identifier</key>
- <string>MENUSEPARATOR</string>
- </dict>
- <dict>
- <key>FirstTimeWindowDisplayed</key>
- <false/>
- <key>Identifier</key>
- <string>windowTool.debuggerConsole</string>
- <key>IsVertical</key>
- <true/>
- <key>Layout</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>1C78EAAC065D492600B07095</string>
- <key>PBXProjectModuleLabel</key>
- <string>Debugger Console</string>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{{0, 0}, {650, 209}}</string>
- <key>RubberWindowFrame</key>
- <string>22 505 650 250 0 0 1280 778 </string>
- </dict>
- <key>Module</key>
- <string>PBXDebugCLIModule</string>
- <key>Proportion</key>
- <string>209pt</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>209pt</string>
- </dict>
- </array>
- <key>Name</key>
- <string>Debugger Console</string>
- <key>ServiceClasses</key>
- <array>
- <string>PBXDebugCLIModule</string>
- </array>
- <key>StatusbarIsVisible</key>
- <true/>
- <key>TableOfContents</key>
- <array>
- <string>1C78EAAD065D492600B07095</string>
- <string>B52EA5D91182F9CF0065C4CA</string>
- <string>1C78EAAC065D492600B07095</string>
- </array>
- <key>ToolbarConfiguration</key>
- <string>xcode.toolbar.config.consoleV3</string>
- <key>WindowString</key>
- <string>22 505 650 250 0 0 1280 778 </string>
- <key>WindowToolGUID</key>
- <string>1C78EAAD065D492600B07095</string>
- <key>WindowToolIsVisible</key>
- <false/>
- </dict>
- <dict>
- <key>Identifier</key>
- <string>windowTool.snapshots</string>
- <key>Layout</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>Module</key>
- <string>XCSnapshotModule</string>
- <key>Proportion</key>
- <string>100%</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>100%</string>
- </dict>
- </array>
- <key>Name</key>
- <string>Snapshots</string>
- <key>ServiceClasses</key>
- <array>
- <string>XCSnapshotModule</string>
- </array>
- <key>StatusbarIsVisible</key>
- <string>Yes</string>
- <key>ToolbarConfiguration</key>
- <string>xcode.toolbar.config.snapshots</string>
- <key>WindowString</key>
- <string>315 824 300 550 0 0 1440 878 </string>
- <key>WindowToolIsVisible</key>
- <string>Yes</string>
- </dict>
- <dict>
- <key>Identifier</key>
- <string>windowTool.scm</string>
- <key>Layout</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>1C78EAB2065D492600B07095</string>
- <key>PBXProjectModuleLabel</key>
- <string><No Editor></string>
- <key>PBXSplitModuleInNavigatorKey</key>
- <dict>
- <key>Split0</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>1C78EAB3065D492600B07095</string>
- </dict>
- <key>SplitCount</key>
- <string>1</string>
- </dict>
- <key>StatusBarVisibility</key>
- <integer>1</integer>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{{0, 0}, {452, 0}}</string>
- <key>RubberWindowFrame</key>
- <string>743 379 452 308 0 0 1280 1002 </string>
- </dict>
- <key>Module</key>
- <string>PBXNavigatorGroup</string>
- <key>Proportion</key>
- <string>0pt</string>
- </dict>
- <dict>
- <key>BecomeActive</key>
- <integer>1</integer>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>1CD052920623707200166675</string>
- <key>PBXProjectModuleLabel</key>
- <string>SCM</string>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>ConsoleFrame</key>
- <string>{{0, 259}, {452, 0}}</string>
- <key>Frame</key>
- <string>{{0, 7}, {452, 259}}</string>
- <key>RubberWindowFrame</key>
- <string>743 379 452 308 0 0 1280 1002 </string>
- <key>TableConfiguration</key>
- <array>
- <string>Status</string>
- <real>30</real>
- <string>FileName</string>
- <real>199</real>
- <string>Path</string>
- <real>197.0950012207031</real>
- </array>
- <key>TableFrame</key>
- <string>{{0, 0}, {452, 250}}</string>
- </dict>
- <key>Module</key>
- <string>PBXCVSModule</string>
- <key>Proportion</key>
- <string>262pt</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>266pt</string>
- </dict>
- </array>
- <key>Name</key>
- <string>SCM</string>
- <key>ServiceClasses</key>
- <array>
- <string>PBXCVSModule</string>
- </array>
- <key>StatusbarIsVisible</key>
- <integer>1</integer>
- <key>TableOfContents</key>
- <array>
- <string>1C78EAB4065D492600B07095</string>
- <string>1C78EAB5065D492600B07095</string>
- <string>1C78EAB2065D492600B07095</string>
- <string>1CD052920623707200166675</string>
- </array>
- <key>ToolbarConfiguration</key>
- <string>xcode.toolbar.config.scm</string>
- <key>WindowString</key>
- <string>743 379 452 308 0 0 1280 1002 </string>
- </dict>
- <dict>
- <key>Identifier</key>
- <string>windowTool.breakpoints</string>
- <key>IsVertical</key>
- <integer>0</integer>
- <key>Layout</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>BecomeActive</key>
- <integer>1</integer>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXBottomSmartGroupGIDs</key>
- <array>
- <string>1C77FABC04509CD000000102</string>
- </array>
- <key>PBXProjectModuleGUID</key>
- <string>1CE0B1FE06471DED0097A5F4</string>
- <key>PBXProjectModuleLabel</key>
- <string>Files</string>
- <key>PBXProjectStructureProvided</key>
- <string>no</string>
- <key>PBXSmartGroupTreeModuleColumnData</key>
- <dict>
- <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
- <array>
- <real>168</real>
- </array>
- <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
- <array>
- <string>MainColumn</string>
- </array>
- </dict>
- <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
- <dict>
- <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
- <array>
- <string>1C77FABC04509CD000000102</string>
- </array>
- <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
- <array>
- <array>
- <integer>0</integer>
- </array>
- </array>
- <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 0}, {168, 350}}</string>
- </dict>
- <key>PBXTopSmartGroupGIDs</key>
- <array/>
- <key>XCIncludePerspectivesSwitch</key>
- <integer>0</integer>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{{0, 0}, {185, 368}}</string>
- <key>GroupTreeTableConfiguration</key>
- <array>
- <string>MainColumn</string>
- <real>168</real>
- </array>
- <key>RubberWindowFrame</key>
- <string>315 424 744 409 0 0 1440 878 </string>
- </dict>
- <key>Module</key>
- <string>PBXSmartGroupTreeModule</string>
- <key>Proportion</key>
- <string>185pt</string>
- </dict>
- <dict>
- <key>ContentConfiguration</key>
- <dict>
- <key>PBXProjectModuleGUID</key>
- <string>1CA1AED706398EBD00589147</string>
- <key>PBXProjectModuleLabel</key>
- <string>Detail</string>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{{190, 0}, {554, 368}}</string>
- <key>RubberWindowFrame</key>
- <string>315 424 744 409 0 0 1440 878 </string>
- </dict>
- <key>Module</key>
- <string>XCDetailModule</string>
- <key>Proportion</key>
- <string>554pt</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>368pt</string>
- </dict>
- </array>
- <key>MajorVersion</key>
- <integer>3</integer>
- <key>MinorVersion</key>
- <integer>0</integer>
- <key>Name</key>
- <string>Breakpoints</string>
- <key>ServiceClasses</key>
- <array>
- <string>PBXSmartGroupTreeModule</string>
- <string>XCDetailModule</string>
- </array>
- <key>StatusbarIsVisible</key>
- <integer>1</integer>
- <key>TableOfContents</key>
- <array>
- <string>1CDDB66807F98D9800BB5817</string>
- <string>1CDDB66907F98D9800BB5817</string>
- <string>1CE0B1FE06471DED0097A5F4</string>
- <string>1CA1AED706398EBD00589147</string>
- </array>
- <key>ToolbarConfiguration</key>
- <string>xcode.toolbar.config.breakpointsV3</string>
- <key>WindowString</key>
- <string>315 424 744 409 0 0 1440 878 </string>
- <key>WindowToolGUID</key>
- <string>1CDDB66807F98D9800BB5817</string>
- <key>WindowToolIsVisible</key>
- <integer>1</integer>
- </dict>
- <dict>
- <key>Identifier</key>
- <string>windowTool.debugAnimator</string>
- <key>Layout</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>Module</key>
- <string>PBXNavigatorGroup</string>
- <key>Proportion</key>
- <string>100%</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>100%</string>
- </dict>
- </array>
- <key>Name</key>
- <string>Debug Visualizer</string>
- <key>ServiceClasses</key>
- <array>
- <string>PBXNavigatorGroup</string>
- </array>
- <key>StatusbarIsVisible</key>
- <integer>1</integer>
- <key>ToolbarConfiguration</key>
- <string>xcode.toolbar.config.debugAnimatorV3</string>
- <key>WindowString</key>
- <string>100 100 700 500 0 0 1280 1002 </string>
- </dict>
- <dict>
- <key>Identifier</key>
- <string>windowTool.bookmarks</string>
- <key>Layout</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>Module</key>
- <string>PBXBookmarksModule</string>
- <key>Proportion</key>
- <string>100%</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>100%</string>
- </dict>
- </array>
- <key>Name</key>
- <string>Bookmarks</string>
- <key>ServiceClasses</key>
- <array>
- <string>PBXBookmarksModule</string>
- </array>
- <key>StatusbarIsVisible</key>
- <integer>0</integer>
- <key>WindowString</key>
- <string>538 42 401 187 0 0 1280 1002 </string>
- </dict>
- <dict>
- <key>Identifier</key>
- <string>windowTool.projectFormatConflicts</string>
- <key>Layout</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>Module</key>
- <string>XCProjectFormatConflictsModule</string>
- <key>Proportion</key>
- <string>100%</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>100%</string>
- </dict>
- </array>
- <key>Name</key>
- <string>Project Format Conflicts</string>
- <key>ServiceClasses</key>
- <array>
- <string>XCProjectFormatConflictsModule</string>
- </array>
- <key>StatusbarIsVisible</key>
- <integer>0</integer>
- <key>WindowContentMinSize</key>
- <string>450 300</string>
- <key>WindowString</key>
- <string>50 850 472 307 0 0 1440 877</string>
- </dict>
- <dict>
- <key>Identifier</key>
- <string>windowTool.classBrowser</string>
- <key>Layout</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>BecomeActive</key>
- <integer>1</integer>
- <key>ContentConfiguration</key>
- <dict>
- <key>OptionsSetName</key>
- <string>Hierarchy, all classes</string>
- <key>PBXProjectModuleGUID</key>
- <string>1CA6456E063B45B4001379D8</string>
- <key>PBXProjectModuleLabel</key>
- <string>Class Browser - NSObject</string>
- </dict>
- <key>GeometryConfiguration</key>
- <dict>
- <key>ClassesFrame</key>
- <string>{{0, 0}, {374, 96}}</string>
- <key>ClassesTreeTableConfiguration</key>
- <array>
- <string>PBXClassNameColumnIdentifier</string>
- <real>208</real>
- <string>PBXClassBookColumnIdentifier</string>
- <real>22</real>
- </array>
- <key>Frame</key>
- <string>{{0, 0}, {630, 331}}</string>
- <key>MembersFrame</key>
- <string>{{0, 105}, {374, 395}}</string>
- <key>MembersTreeTableConfiguration</key>
- <array>
- <string>PBXMemberTypeIconColumnIdentifier</string>
- <real>22</real>
- <string>PBXMemberNameColumnIdentifier</string>
- <real>216</real>
- <string>PBXMemberTypeColumnIdentifier</string>
- <real>97</real>
- <string>PBXMemberBookColumnIdentifier</string>
- <real>22</real>
- </array>
- <key>PBXModuleWindowStatusBarHidden2</key>
- <integer>1</integer>
- <key>RubberWindowFrame</key>
- <string>385 179 630 352 0 0 1440 878 </string>
- </dict>
- <key>Module</key>
- <string>PBXClassBrowserModule</string>
- <key>Proportion</key>
- <string>332pt</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>332pt</string>
- </dict>
- </array>
- <key>Name</key>
- <string>Class Browser</string>
- <key>ServiceClasses</key>
- <array>
- <string>PBXClassBrowserModule</string>
- </array>
- <key>StatusbarIsVisible</key>
- <integer>0</integer>
- <key>TableOfContents</key>
- <array>
- <string>1C0AD2AF069F1E9B00FABCE6</string>
- <string>1C0AD2B0069F1E9B00FABCE6</string>
- <string>1CA6456E063B45B4001379D8</string>
- </array>
- <key>ToolbarConfiguration</key>
- <string>xcode.toolbar.config.classbrowser</string>
- <key>WindowString</key>
- <string>385 179 630 352 0 0 1440 878 </string>
- <key>WindowToolGUID</key>
- <string>1C0AD2AF069F1E9B00FABCE6</string>
- <key>WindowToolIsVisible</key>
- <integer>0</integer>
- </dict>
- <dict>
- <key>Identifier</key>
- <string>windowTool.refactoring</string>
- <key>IncludeInToolsMenu</key>
- <integer>0</integer>
- <key>Layout</key>
- <array>
- <dict>
- <key>Dock</key>
- <array>
- <dict>
- <key>BecomeActive</key>
- <integer>1</integer>
- <key>GeometryConfiguration</key>
- <dict>
- <key>Frame</key>
- <string>{0, 0}, {500, 335}</string>
- <key>RubberWindowFrame</key>
- <string>{0, 0}, {500, 335}</string>
- </dict>
- <key>Module</key>
- <string>XCRefactoringModule</string>
- <key>Proportion</key>
- <string>100%</string>
- </dict>
- </array>
- <key>Proportion</key>
- <string>100%</string>
- </dict>
- </array>
- <key>Name</key>
- <string>Refactoring</string>
- <key>ServiceClasses</key>
- <array>
- <string>XCRefactoringModule</string>
- </array>
- <key>WindowString</key>
- <string>200 200 500 356 0 0 1920 1200 </string>
- </dict>
- </array>
-</dict>
-</plist>
diff --git a/NSArchiveExample.xcodeproj/project.pbxproj b/NSArchiveExample.xcodeproj/project.pbxproj
index 568e0ed..dc00ee8 100755
--- a/NSArchiveExample.xcodeproj/project.pbxproj
+++ b/NSArchiveExample.xcodeproj/project.pbxproj
@@ -1,305 +1,313 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */; };
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
B52EA5E51182FC2D0065C4CA /* PersonEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */; };
B52EA600118439900065C4CA /* DictionaryEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */; };
B52EA601118439900065C4CA /* DictionaryEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */; };
B52EA6921186EB390065C4CA /* ArrayEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA6901186EB390065C4CA /* ArrayEntryViewController.m */; };
B52EA6931186EB390065C4CA /* ArrayEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B52EA6911186EB390065C4CA /* ArrayEntryView.xib */; };
B5B25F7F11803200001BA9A0 /* ViewAllViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */; };
B5B25F8011803200001BA9A0 /* ViewAllView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5B25F7E11803200001BA9A0 /* ViewAllView.xib */; };
B5BFA804117F9A96008B450B /* Persistance.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA803117F9A96008B450B /* Persistance.m */; };
B5BFA81D117F9CAD008B450B /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA81C117F9CAD008B450B /* Person.m */; };
B5BFA845117FA1B8008B450B /* PersonEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5BFA844117FA1B8008B450B /* PersonEntryView.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExampleAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSArchiveExampleAppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSArchiveExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NSArchiveExampleViewController.xib; sourceTree = "<group>"; };
28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExample_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "NSArchiveExample-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PersonEntryViewController.h; sourceTree = "<group>"; };
B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PersonEntryViewController.m; sourceTree = "<group>"; };
B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryEntryViewController.h; sourceTree = "<group>"; };
B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DictionaryEntryViewController.m; sourceTree = "<group>"; };
B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DictionaryEntryView.xib; sourceTree = "<group>"; };
B52EA68F1186EB390065C4CA /* ArrayEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayEntryViewController.h; sourceTree = "<group>"; };
B52EA6901186EB390065C4CA /* ArrayEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArrayEntryViewController.m; sourceTree = "<group>"; };
B52EA6911186EB390065C4CA /* ArrayEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ArrayEntryView.xib; sourceTree = "<group>"; };
B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewAllViewController.h; sourceTree = "<group>"; };
B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewAllViewController.m; sourceTree = "<group>"; };
B5B25F7E11803200001BA9A0 /* ViewAllView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ViewAllView.xib; sourceTree = "<group>"; };
B5BFA802117F9A96008B450B /* Persistance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Persistance.h; sourceTree = "<group>"; };
B5BFA803117F9A96008B450B /* Persistance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Persistance.m; sourceTree = "<group>"; };
B5BFA81B117F9CAD008B450B /* Person.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Person.h; sourceTree = "<group>"; };
B5BFA81C117F9CAD008B450B /* Person.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Person.m; sourceTree = "<group>"; };
B5BFA83B117FA0E3008B450B /* Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Model.h; sourceTree = "<group>"; };
B5BFA844117FA1B8008B450B /* PersonEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PersonEntryView.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
B5BFA81E117F9CB4008B450B /* Model */,
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */,
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */,
B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */,
B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */,
B5BFA844117FA1B8008B450B /* PersonEntryView.xib */,
B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */,
B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */,
B5B25F7E11803200001BA9A0 /* ViewAllView.xib */,
B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */,
B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */,
B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */,
B52EA68F1186EB390065C4CA /* ArrayEntryViewController.h */,
B52EA6901186EB390065C4CA /* ArrayEntryViewController.m */,
B52EA6911186EB390065C4CA /* ArrayEntryView.xib */,
);
path = Classes;
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = CustomTemplate;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */,
28AD733E0D9D9553002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
288765A40DF7441C002DB57D /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
B5BFA81E117F9CB4008B450B /* Model */ = {
isa = PBXGroup;
children = (
B5BFA83B117FA0E3008B450B /* Model.h */,
B5BFA802117F9A96008B450B /* Persistance.h */,
B5BFA803117F9A96008B450B /* Persistance.m */,
B5BFA81B117F9CAD008B450B /* Person.h */,
B5BFA81C117F9CAD008B450B /* Person.m */,
);
name = Model;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */;
buildPhases = (
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = NSArchiveExample;
productName = NSArchiveExample;
productReference = 1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ en,
+ );
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
targets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1D60588D0D05DD3D006BFB54 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */,
B5BFA845117FA1B8008B450B /* PersonEntryView.xib in Resources */,
B5B25F8011803200001BA9A0 /* ViewAllView.xib in Resources */,
B52EA601118439900065C4CA /* DictionaryEntryView.xib in Resources */,
B52EA6931186EB390065C4CA /* ArrayEntryView.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */,
B5BFA804117F9A96008B450B /* Persistance.m in Sources */,
B5BFA81D117F9CAD008B450B /* Person.m in Sources */,
B5B25F7F11803200001BA9A0 /* ViewAllViewController.m in Sources */,
B52EA5E51182FC2D0065C4CA /* PersonEntryViewController.m in Sources */,
B52EA600118439900065C4CA /* DictionaryEntryViewController.m in Sources */,
B52EA6921186EB390065C4CA /* ArrayEntryViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 4.2;
PRODUCT_NAME = NSArchiveExample;
+ SDKROOT = iphoneos5.0;
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 4.2;
PRODUCT_NAME = NSArchiveExample;
+ SDKROOT = iphoneos5.0;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = iphoneos3.1.3;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = iphoneos3.1.3;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1D6058940D05DD3E006BFB54 /* Debug */,
1D6058950D05DD3E006BFB54 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
|
bentford/NSArchiveExample
|
a6ef379360189f55a69c866e1ae61f6010af5f41
|
Revert "added ignore template that gitbox provides"
|
diff --git a/.gitignore b/.gitignore
index 0008167..378eac2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,18 +1 @@
-# osx noise
-.DS_Store
-profile
-
-# xcode noise
-build/*
-*.mode1
-*.mode1v3
-*.mode2v3
-*.perspective
-*.perspectivev3
-*.pbxuser
-*.xcworkspace
-xcuserdata
-
-# svn & cvs
-.svn
-CVS
+build
|
bentford/NSArchiveExample
|
ee994f03bbfc6bc1fc4612f4fc0c2f24065fc89f
|
Revert "cleared Xcode 4 / iOS5 compiler warning"
|
diff --git a/Classes/Persistance.m b/Classes/Persistance.m
index 46a63b8..f15eec4 100644
--- a/Classes/Persistance.m
+++ b/Classes/Persistance.m
@@ -1,124 +1,124 @@
//
// Persistance.m
// GuestInfo
//
// Created by Ben Ford on 10/23/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "Persistance.h"
#import "Person.h"
@implementation Persistance
@synthesize boss, managers, employees;
//taken from apple code example:
//http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/TP40002974-CH4-SW32
static Persistance *sharedGlobalInstance = nil;
- (id)init {
self = [super init];
return self;
}
#pragma mark Singleton
+ (Persistance*) sharedService {
if( sharedGlobalInstance == nil )
{
[[self alloc] init];// assignment not done here
}
return sharedGlobalInstance;
}
+ (Persistance*) allocWithZone:(NSZone*)zone {
@synchronized(self) {
if (sharedGlobalInstance == nil) {
sharedGlobalInstance = [super allocWithZone:zone];
return sharedGlobalInstance; // assignment and return on first allocation
}
}
return nil; //on subsequent allocation attempts return nil
}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (id)retain {
return self;
}
- (unsigned)retainCount {
return UINT_MAX; //denotes an object that cannot be released
}
-- (oneway void)release {
+- (void)release {
//do nothing
}
- (id)autorelease {
return self;
}
#pragma mark -
#pragma mark LifeCycle
- (void)loadFromDisk {
// boss
NSString *bossFilePath = [Persistance pathForDocumentsDirectoryFile:@"boss.archive"];
self.boss = [NSKeyedUnarchiver unarchiveObjectWithFile:bossFilePath];
if( !self.boss )
self.boss = [Person defaultPerson];
// managers
NSString *managerFilePath = [Persistance pathForDocumentsDirectoryFile:@"managers.archive"];
self.managers = [NSKeyedUnarchiver unarchiveObjectWithFile:managerFilePath];
if( !self.managers )
self.managers = [NSMutableDictionary dictionaryWithCapacity:0];
// employees
NSString *employeesFilePath = [Persistance pathForDocumentsDirectoryFile:@"employees.archive"];
self.employees = [NSKeyedUnarchiver unarchiveObjectWithFile:employeesFilePath];
if( !self.employees )
self.employees = [NSMutableArray arrayWithCapacity:0];
}
- (void)saveToDisk {
NSString *bossFilePath = [Persistance pathForDocumentsDirectoryFile:@"boss.archive"];
[NSKeyedArchiver archiveRootObject:self.boss toFile:bossFilePath];
NSString *managersFilePath = [Persistance pathForDocumentsDirectoryFile:@"managers.archive"];
[NSKeyedArchiver archiveRootObject:self.managers toFile:managersFilePath];
NSString *employeesFilePath = [Persistance pathForDocumentsDirectoryFile:@"employees.archive"];
[NSKeyedArchiver archiveRootObject:self.employees toFile:employeesFilePath];
}
#pragma mark -
#pragma mark helpers
+ (NSString *)pathForDocumentsDirectoryFile:(NSString*)filename {
NSArray *paths = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
return [documentsDirectory stringByAppendingPathComponent:filename];
}
#pragma mark -
- (void)dealloc {
self.boss = nil;
self.employees = nil;
self.managers = nil;
[super dealloc];
}
@end
|
bentford/NSArchiveExample
|
910bac95787ac24ecfa19ad40726cbfc8542a930
|
Revert "Updated some settings for iOS5 and Xcode 4"
|
diff --git a/NSArchiveExample.xcodeproj/Ben.pbxuser b/NSArchiveExample.xcodeproj/Ben.pbxuser
index 3492133..0422a7b 100644
--- a/NSArchiveExample.xcodeproj/Ben.pbxuser
+++ b/NSArchiveExample.xcodeproj/Ben.pbxuser
@@ -1,268 +1,126 @@
// !$*UTF8*$!
{
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
- sepNavSelRange = "{480, 0}";
- sepNavVisRange = "{0, 489}";
+ sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRange = "{0, 529}";
};
};
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {925, 892}}";
- sepNavSelRange = "{442, 0}";
- sepNavVisRange = "{0, 689}";
+ sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
+ sepNavSelRange = "{266, 0}";
+ sepNavVisRange = "{0, 849}";
};
};
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
activeExec = 0;
executables = (
B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
);
};
29B97313FDCFA39411CA2CEA /* Project object */ = {
activeBuildConfigurationName = Debug;
activeExecutable = B5BFA7F6117F9A63008B450B /* NSArchiveExample */;
activeTarget = 1D6058900D05DD3D006BFB54 /* NSArchiveExample */;
addToTargets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
codeSenseManager = B5BFA801117F9A81008B450B /* Code sense */;
executables = (
B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
);
perUserDictionary = {
- PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
- PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
- PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
- PBXFileTableDataSourceColumnWidthsKey = (
- 20,
- 747,
- 20,
- 48.16259765625,
- 43,
- 43,
- 20,
- );
- PBXFileTableDataSourceColumnsKey = (
- PBXFileDataSource_FiletypeID,
- PBXFileDataSource_Filename_ColumnID,
- PBXFileDataSource_Built_ColumnID,
- PBXFileDataSource_ObjectSize_ColumnID,
- PBXFileDataSource_Errors_ColumnID,
- PBXFileDataSource_Warnings_ColumnID,
- PBXFileDataSource_Target_ColumnID,
- );
- };
PBXPerProjectTemplateStateSaveDate = 293575267;
PBXWorkspaceStateSaveDate = 293575267;
};
- perUserProjectItems = {
- B5BFA8B0117FB22A008B450B /* PBXTextBookmark */ = B5BFA8B0117FB22A008B450B /* PBXTextBookmark */;
- B5BFA8B1117FB22A008B450B /* PBXTextBookmark */ = B5BFA8B1117FB22A008B450B /* PBXTextBookmark */;
- B5BFA8B2117FB22A008B450B /* PBXTextBookmark */ = B5BFA8B2117FB22A008B450B /* PBXTextBookmark */;
- B5BFA8B3117FB22A008B450B /* PBXTextBookmark */ = B5BFA8B3117FB22A008B450B /* PBXTextBookmark */;
- B5BFA8B4117FB22A008B450B /* PBXTextBookmark */ = B5BFA8B4117FB22A008B450B /* PBXTextBookmark */;
- B5BFA8B5117FB22A008B450B /* PBXTextBookmark */ = B5BFA8B5117FB22A008B450B /* PBXTextBookmark */;
- B5BFA8B6117FB22A008B450B /* PBXTextBookmark */ = B5BFA8B6117FB22A008B450B /* PBXTextBookmark */;
- B5BFA8B7117FB22A008B450B /* PBXTextBookmark */ = B5BFA8B7117FB22A008B450B /* PBXTextBookmark */;
- B5BFA8B8117FB22A008B450B /* PBXTextBookmark */ = B5BFA8B8117FB22A008B450B /* PBXTextBookmark */;
- B5BFA8B9117FB22A008B450B /* PBXTextBookmark */ = B5BFA8B9117FB22A008B450B /* PBXTextBookmark */;
- };
sourceControlManager = B5BFA800117F9A81008B450B /* Source Control */;
userBuildSettings = {
};
};
B5BFA7F6117F9A63008B450B /* NSArchiveExample */ = {
isa = PBXExecutable;
activeArgIndices = (
);
argumentStrings = (
);
autoAttachOnCrash = 1;
breakpointsEnabled = 0;
configStateDict = {
};
customDataFormattersEnabled = 1;
dataTipCustomDataFormattersEnabled = 1;
dataTipShowTypeColumn = 1;
dataTipSortType = 0;
debuggerPlugin = GDBDebugging;
disassemblyDisplayState = 0;
- dylibVariantSuffix = "";
enableDebugStr = 1;
environmentEntries = (
);
executableSystemSymbolLevel = 0;
executableUserSymbolLevel = 0;
libgmallocEnabled = 0;
name = NSArchiveExample;
showTypeColumn = 0;
sourceDirectories = (
);
};
B5BFA800117F9A81008B450B /* Source Control */ = {
isa = PBXSourceControlManager;
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
repositoryNamesForRoots = {
"" = "";
};
};
};
B5BFA801117F9A81008B450B /* Code sense */ = {
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
B5BFA802117F9A96008B450B /* Persistance.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
- sepNavSelRange = "{162, 0}";
- sepNavVisRange = "{0, 610}";
+ sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
+ sepNavSelRange = "{622, 0}";
+ sepNavVisRange = "{0, 628}";
};
};
B5BFA803117F9A96008B450B /* Persistance.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1450, 2632}}";
- sepNavSelRange = "{181, 0}";
- sepNavVisRange = "{1191, 1216}";
+ sepNavIntBoundsRect = "{{0, 0}, {1450, 2472}}";
+ sepNavSelRange = "{2824, 0}";
+ sepNavVisRange = "{0, 1153}";
};
};
B5BFA81B117F9CAD008B450B /* Person.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {925, 892}}";
- sepNavSelRange = "{522, 0}";
- sepNavVisRange = "{0, 528}";
+ sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
+ sepNavSelRange = "{511, 0}";
+ sepNavVisRange = "{0, 517}";
};
};
B5BFA81C117F9CAD008B450B /* Person.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {925, 1073}}";
- sepNavSelRange = "{312, 10}";
- sepNavVisRange = "{0, 1263}";
+ sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
+ sepNavSelRange = "{260, 0}";
+ sepNavVisRange = "{0, 1166}";
};
};
B5BFA83B117FA0E3008B450B /* Model.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
sepNavSelRange = "{161, 0}";
sepNavVisRange = "{0, 181}";
};
};
B5BFA841117FA1AA008B450B /* BossViewController.h */ = {
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {925, 892}}";
- sepNavSelRange = "{419, 0}";
- sepNavVisRange = "{0, 425}";
- sepNavWindowFrame = "{{38, 157}, {1354, 1235}}";
- };
- };
- B5BFA842117FA1AA008B450B /* BossViewController.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
- sepNavSelRange = "{319, 0}";
- sepNavVisRange = "{0, 1138}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRange = "{0, 247}";
+ sepNavWindowFrame = "{{38, 157}, {1354, 1235}}";
};
};
- B5BFA8B0117FB22A008B450B /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA83B117FA0E3008B450B /* Model.h */;
- name = "Model.h: 9";
- rLen = 0;
- rLoc = 161;
- rType = 0;
- vrLen = 181;
- vrLoc = 0;
- };
- B5BFA8B1117FB22A008B450B /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */;
- name = "NSArchiveExampleAppDelegate.h: 19";
- rLen = 0;
- rLoc = 480;
- rType = 0;
- vrLen = 489;
- vrLoc = 0;
- };
- B5BFA8B2117FB22A008B450B /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA841117FA1AA008B450B /* BossViewController.h */;
- name = "BossViewController.h: 20";
- rLen = 0;
- rLoc = 419;
- rType = 0;
- vrLen = 425;
- vrLoc = 0;
- };
- B5BFA8B3117FB22A008B450B /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA802117F9A96008B450B /* Persistance.h */;
- name = "Persistance.h: 10";
- rLen = 0;
- rLoc = 162;
- rType = 0;
- vrLen = 610;
- vrLoc = 0;
- };
- B5BFA8B4117FB22A008B450B /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = 1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */;
- name = "NSArchiveExampleAppDelegate.m: 21";
- rLen = 0;
- rLoc = 442;
- rType = 0;
- vrLen = 689;
- vrLoc = 0;
- };
- B5BFA8B5117FB22A008B450B /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA803117F9A96008B450B /* Persistance.m */;
- name = "Persistance.m: 11";
- rLen = 0;
- rLoc = 181;
- rType = 0;
- vrLen = 1216;
- vrLoc = 1191;
- };
- B5BFA8B6117FB22A008B450B /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA81B117F9CAD008B450B /* Person.h */;
- name = "Person.h: 24";
- rLen = 0;
- rLoc = 522;
- rType = 0;
- vrLen = 528;
- vrLoc = 0;
- };
- B5BFA8B7117FB22A008B450B /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA81C117F9CAD008B450B /* Person.m */;
- name = "Person.m: 18";
- rLen = 10;
- rLoc = 312;
- rType = 0;
- vrLen = 1263;
- vrLoc = 0;
- };
- B5BFA8B8117FB22A008B450B /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA842117FA1AA008B450B /* BossViewController.m */;
- name = "BossViewController.m: 17";
- rLen = 0;
- rLoc = 346;
- rType = 0;
- vrLen = 1075;
- vrLoc = 0;
- };
- B5BFA8B9117FB22A008B450B /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA842117FA1AA008B450B /* BossViewController.m */;
- name = "BossViewController.m: 20";
- rLen = 0;
- rLoc = 319;
- rType = 0;
- vrLen = 1138;
- vrLoc = 0;
- };
}
diff --git a/NSArchiveExample.xcodeproj/project.pbxproj b/NSArchiveExample.xcodeproj/project.pbxproj
index e6b4173..4bdd270 100755
--- a/NSArchiveExample.xcodeproj/project.pbxproj
+++ b/NSArchiveExample.xcodeproj/project.pbxproj
@@ -1,283 +1,275 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */; };
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
B5BFA804117F9A96008B450B /* Persistance.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA803117F9A96008B450B /* Persistance.m */; };
B5BFA81D117F9CAD008B450B /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA81C117F9CAD008B450B /* Person.m */; };
B5BFA843117FA1AA008B450B /* BossViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA842117FA1AA008B450B /* BossViewController.m */; };
B5BFA845117FA1B8008B450B /* BossView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5BFA844117FA1B8008B450B /* BossView.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExampleAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSArchiveExampleAppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSArchiveExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NSArchiveExampleViewController.xib; sourceTree = "<group>"; };
28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExample_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "NSArchiveExample-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
B5BFA802117F9A96008B450B /* Persistance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Persistance.h; sourceTree = "<group>"; };
B5BFA803117F9A96008B450B /* Persistance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Persistance.m; sourceTree = "<group>"; };
B5BFA81B117F9CAD008B450B /* Person.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Person.h; sourceTree = "<group>"; };
B5BFA81C117F9CAD008B450B /* Person.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Person.m; sourceTree = "<group>"; };
B5BFA83B117FA0E3008B450B /* Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Model.h; sourceTree = "<group>"; };
B5BFA841117FA1AA008B450B /* BossViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BossViewController.h; sourceTree = "<group>"; };
B5BFA842117FA1AA008B450B /* BossViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BossViewController.m; sourceTree = "<group>"; };
B5BFA844117FA1B8008B450B /* BossView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BossView.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
B5BFA81E117F9CB4008B450B /* Model */,
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */,
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */,
B5BFA841117FA1AA008B450B /* BossViewController.h */,
B5BFA842117FA1AA008B450B /* BossViewController.m */,
B5BFA844117FA1B8008B450B /* BossView.xib */,
);
path = Classes;
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = CustomTemplate;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */,
28AD733E0D9D9553002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
288765A40DF7441C002DB57D /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
B5BFA81E117F9CB4008B450B /* Model */ = {
isa = PBXGroup;
children = (
B5BFA83B117FA0E3008B450B /* Model.h */,
B5BFA802117F9A96008B450B /* Persistance.h */,
B5BFA803117F9A96008B450B /* Persistance.m */,
B5BFA81B117F9CAD008B450B /* Person.h */,
B5BFA81C117F9CAD008B450B /* Person.m */,
);
name = Model;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */;
buildPhases = (
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = NSArchiveExample;
productName = NSArchiveExample;
productReference = 1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */;
compatibilityVersion = "Xcode 3.1";
- developmentRegion = English;
hasScannedForEncodings = 1;
- knownRegions = (
- en,
- );
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
targets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1D60588D0D05DD3D006BFB54 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */,
B5BFA845117FA1B8008B450B /* BossView.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */,
B5BFA804117F9A96008B450B /* Persistance.m in Sources */,
B5BFA81D117F9CAD008B450B /* Person.m in Sources */,
B5BFA843117FA1AA008B450B /* BossViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 4.2;
PRODUCT_NAME = NSArchiveExample;
- SDKROOT = iphoneos5.0;
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 4.2;
PRODUCT_NAME = NSArchiveExample;
- SDKROOT = iphoneos5.0;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = iphoneos3.1.3;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = iphoneos3.1.3;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1D6058940D05DD3E006BFB54 /* Debug */,
1D6058950D05DD3E006BFB54 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
|
bentford/NSArchiveExample
|
2bfbd0fc1ee3945407566c84f2771b4d49304183
|
Revert "updated protect for Xcode 4 (again)."
|
diff --git a/NSArchiveExample.xcodeproj/project.pbxproj b/NSArchiveExample.xcodeproj/project.pbxproj
index 3358f01..e6b4173 100755
--- a/NSArchiveExample.xcodeproj/project.pbxproj
+++ b/NSArchiveExample.xcodeproj/project.pbxproj
@@ -1,284 +1,283 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
- objectVersion = 46;
+ objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */; };
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
B5BFA804117F9A96008B450B /* Persistance.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA803117F9A96008B450B /* Persistance.m */; };
B5BFA81D117F9CAD008B450B /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA81C117F9CAD008B450B /* Person.m */; };
B5BFA843117FA1AA008B450B /* BossViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA842117FA1AA008B450B /* BossViewController.m */; };
B5BFA845117FA1B8008B450B /* BossView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5BFA844117FA1B8008B450B /* BossView.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExampleAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSArchiveExampleAppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSArchiveExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NSArchiveExampleViewController.xib; sourceTree = "<group>"; };
28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExample_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "NSArchiveExample-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
B5BFA802117F9A96008B450B /* Persistance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Persistance.h; sourceTree = "<group>"; };
B5BFA803117F9A96008B450B /* Persistance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Persistance.m; sourceTree = "<group>"; };
B5BFA81B117F9CAD008B450B /* Person.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Person.h; sourceTree = "<group>"; };
B5BFA81C117F9CAD008B450B /* Person.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Person.m; sourceTree = "<group>"; };
B5BFA83B117FA0E3008B450B /* Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Model.h; sourceTree = "<group>"; };
B5BFA841117FA1AA008B450B /* BossViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BossViewController.h; sourceTree = "<group>"; };
B5BFA842117FA1AA008B450B /* BossViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BossViewController.m; sourceTree = "<group>"; };
B5BFA844117FA1B8008B450B /* BossView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BossView.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
B5BFA81E117F9CB4008B450B /* Model */,
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */,
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */,
B5BFA841117FA1AA008B450B /* BossViewController.h */,
B5BFA842117FA1AA008B450B /* BossViewController.m */,
B5BFA844117FA1B8008B450B /* BossView.xib */,
);
path = Classes;
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = CustomTemplate;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */,
28AD733E0D9D9553002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
288765A40DF7441C002DB57D /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
B5BFA81E117F9CB4008B450B /* Model */ = {
isa = PBXGroup;
children = (
B5BFA83B117FA0E3008B450B /* Model.h */,
B5BFA802117F9A96008B450B /* Persistance.h */,
B5BFA803117F9A96008B450B /* Persistance.m */,
B5BFA81B117F9CAD008B450B /* Person.h */,
B5BFA81C117F9CAD008B450B /* Person.m */,
);
name = Model;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */;
buildPhases = (
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = NSArchiveExample;
productName = NSArchiveExample;
productReference = 1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0420;
- };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */;
- compatibilityVersion = "Xcode 3.2";
+ compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
targets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1D60588D0D05DD3D006BFB54 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */,
B5BFA845117FA1B8008B450B /* BossView.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */,
B5BFA804117F9A96008B450B /* Persistance.m in Sources */,
B5BFA81D117F9CAD008B450B /* Person.m in Sources */,
B5BFA843117FA1AA008B450B /* BossViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.2;
PRODUCT_NAME = NSArchiveExample;
- SDKROOT = iphoneos;
+ SDKROOT = iphoneos5.0;
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.2;
PRODUCT_NAME = NSArchiveExample;
- SDKROOT = iphoneos;
+ SDKROOT = iphoneos5.0;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- SDKROOT = iphoneos;
+ PREBINDING = NO;
+ SDKROOT = iphoneos3.1.3;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- SDKROOT = iphoneos;
+ PREBINDING = NO;
+ SDKROOT = iphoneos3.1.3;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1D6058940D05DD3E006BFB54 /* Debug */,
1D6058950D05DD3E006BFB54 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
|
bentford/NSArchiveExample
|
5062c62e45b311c7aeccd39305a177cb22e59470
|
cleared Xcode 4 / iOS5 compiler warning
|
diff --git a/Classes/Persistance.m b/Classes/Persistance.m
index f15eec4..46a63b8 100644
--- a/Classes/Persistance.m
+++ b/Classes/Persistance.m
@@ -1,124 +1,124 @@
//
// Persistance.m
// GuestInfo
//
// Created by Ben Ford on 10/23/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "Persistance.h"
#import "Person.h"
@implementation Persistance
@synthesize boss, managers, employees;
//taken from apple code example:
//http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/TP40002974-CH4-SW32
static Persistance *sharedGlobalInstance = nil;
- (id)init {
self = [super init];
return self;
}
#pragma mark Singleton
+ (Persistance*) sharedService {
if( sharedGlobalInstance == nil )
{
[[self alloc] init];// assignment not done here
}
return sharedGlobalInstance;
}
+ (Persistance*) allocWithZone:(NSZone*)zone {
@synchronized(self) {
if (sharedGlobalInstance == nil) {
sharedGlobalInstance = [super allocWithZone:zone];
return sharedGlobalInstance; // assignment and return on first allocation
}
}
return nil; //on subsequent allocation attempts return nil
}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (id)retain {
return self;
}
- (unsigned)retainCount {
return UINT_MAX; //denotes an object that cannot be released
}
-- (void)release {
+- (oneway void)release {
//do nothing
}
- (id)autorelease {
return self;
}
#pragma mark -
#pragma mark LifeCycle
- (void)loadFromDisk {
// boss
NSString *bossFilePath = [Persistance pathForDocumentsDirectoryFile:@"boss.archive"];
self.boss = [NSKeyedUnarchiver unarchiveObjectWithFile:bossFilePath];
if( !self.boss )
self.boss = [Person defaultPerson];
// managers
NSString *managerFilePath = [Persistance pathForDocumentsDirectoryFile:@"managers.archive"];
self.managers = [NSKeyedUnarchiver unarchiveObjectWithFile:managerFilePath];
if( !self.managers )
self.managers = [NSMutableDictionary dictionaryWithCapacity:0];
// employees
NSString *employeesFilePath = [Persistance pathForDocumentsDirectoryFile:@"employees.archive"];
self.employees = [NSKeyedUnarchiver unarchiveObjectWithFile:employeesFilePath];
if( !self.employees )
self.employees = [NSMutableArray arrayWithCapacity:0];
}
- (void)saveToDisk {
NSString *bossFilePath = [Persistance pathForDocumentsDirectoryFile:@"boss.archive"];
[NSKeyedArchiver archiveRootObject:self.boss toFile:bossFilePath];
NSString *managersFilePath = [Persistance pathForDocumentsDirectoryFile:@"managers.archive"];
[NSKeyedArchiver archiveRootObject:self.managers toFile:managersFilePath];
NSString *employeesFilePath = [Persistance pathForDocumentsDirectoryFile:@"employees.archive"];
[NSKeyedArchiver archiveRootObject:self.employees toFile:employeesFilePath];
}
#pragma mark -
#pragma mark helpers
+ (NSString *)pathForDocumentsDirectoryFile:(NSString*)filename {
NSArray *paths = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
return [documentsDirectory stringByAppendingPathComponent:filename];
}
#pragma mark -
- (void)dealloc {
self.boss = nil;
self.employees = nil;
self.managers = nil;
[super dealloc];
}
@end
|
bentford/NSArchiveExample
|
55ffbaab69db00da9e03a4cb06e2e3eb0038597e
|
added ignore template that gitbox provides
|
diff --git a/.gitignore b/.gitignore
index 378eac2..0008167 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,18 @@
-build
+# osx noise
+.DS_Store
+profile
+
+# xcode noise
+build/*
+*.mode1
+*.mode1v3
+*.mode2v3
+*.perspective
+*.perspectivev3
+*.pbxuser
+*.xcworkspace
+xcuserdata
+
+# svn & cvs
+.svn
+CVS
|
bentford/NSArchiveExample
|
7a08267b69a69d8411a1454af90368b16b5b0fd8
|
added last example, showing the NSArray
|
diff --git a/Classes/ArrayEntryView.xib b/Classes/ArrayEntryView.xib
new file mode 100644
index 0000000..9b4d66d
--- /dev/null
+++ b/Classes/ArrayEntryView.xib
@@ -0,0 +1,631 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">800</int>
+ <string key="IBDocument.SystemVersion">10D2125</string>
+ <string key="IBDocument.InterfaceBuilderVersion">762</string>
+ <string key="IBDocument.AppKitVersion">1038.29</string>
+ <string key="IBDocument.HIToolboxVersion">460.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">87</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="191373211">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUITextField" id="506124688">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 62}, {280, 31}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText"/>
+ <int key="IBUIBorderStyle">3</int>
+ <string key="IBUIPlaceholder">value1</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace" id="674831291">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <object class="NSFont" key="IBUIFont" id="22225805">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">18</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBUITextField" id="150993601">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 106}, {280, 31}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText"/>
+ <int key="IBUIBorderStyle">3</int>
+ <string key="IBUIPlaceholder">value2</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <reference key="NSCustomColorSpace" ref="674831291"/>
+ </object>
+ <reference key="IBUIFont" ref="22225805"/>
+ <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBUITextField" id="1038831475">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 151}, {280, 31}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText"/>
+ <int key="IBUIBorderStyle">3</int>
+ <string key="IBUIPlaceholder">value3</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <reference key="NSCustomColorSpace" ref="674831291"/>
+ </object>
+ <reference key="IBUIFont" ref="22225805"/>
+ <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBUITextField" id="634147398">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 198}, {280, 31}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText"/>
+ <int key="IBUIBorderStyle">3</int>
+ <string key="IBUIPlaceholder">value4</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <reference key="NSCustomColorSpace" ref="674831291"/>
+ </object>
+ <reference key="IBUIFont" ref="22225805"/>
+ <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBUIButton" id="988175555">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 246}, {280, 37}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica-Bold</string>
+ <double key="NSSize">15</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <int key="IBUIButtonType">1</int>
+ <string key="IBUINormalTitle">Save</string>
+ <object class="NSColor" key="IBUIHighlightedTitleColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <object class="NSColor" key="IBUINormalTitleColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+ </object>
+ <object class="NSColor" key="IBUINormalTitleShadowColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC41AA</bytes>
+ </object>
+ </object>
+ <object class="IBUILabel" id="316963093">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{132, 20}, {42, 21}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">7</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <string key="IBUIText">Array</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAAA</bytes>
+ </object>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ </object>
+ </object>
+ <string key="NSFrameSize">{320, 460}</string>
+ <reference key="NSSuperview"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <reference key="NSCustomColorSpace" ref="674831291"/>
+ </object>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="191373211"/>
+ </object>
+ <int key="connectionID">3</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">value1</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="506124688"/>
+ </object>
+ <int key="connectionID">10</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">value2</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="150993601"/>
+ </object>
+ <int key="connectionID">11</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">value3</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="1038831475"/>
+ </object>
+ <int key="connectionID">12</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">value4</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="634147398"/>
+ </object>
+ <int key="connectionID">13</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">save</string>
+ <reference key="source" ref="988175555"/>
+ <reference key="destination" ref="372490531"/>
+ <int key="IBEventType">7</int>
+ </object>
+ <int key="connectionID">14</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="191373211"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="506124688"/>
+ <reference ref="150993601"/>
+ <reference ref="1038831475"/>
+ <reference ref="634147398"/>
+ <reference ref="988175555"/>
+ <reference ref="316963093"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="506124688"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="150993601"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="1038831475"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">7</int>
+ <reference key="object" ref="634147398"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">8</int>
+ <reference key="object" ref="988175555"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">9</int>
+ <reference key="object" ref="316963093"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>4.IBPluginDependency</string>
+ <string>5.IBPluginDependency</string>
+ <string>6.IBPluginDependency</string>
+ <string>7.IBPluginDependency</string>
+ <string>8.IBPluginDependency</string>
+ <string>9.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>ArrayEntryViewController</string>
+ <string>UIResponder</string>
+ <string>{{273, 276}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">14</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">ArrayEntryViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">save</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>value1</string>
+ <string>value2</string>
+ <string>value3</string>
+ <string>value4</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/ArrayEntryViewController.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="549554407">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIButton</string>
+ <string key="superclassName">UIControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIButton.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIControl</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UILabel</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIResponder</string>
+ <string key="superclassName">NSObject</string>
+ <reference key="sourceIdentifier" ref="549554407"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchBar</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchDisplayController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UITextField</string>
+ <string key="superclassName">UIControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="819891438">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <reference key="sourceIdentifier" ref="819891438"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../NSArchiveExample.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">87</string>
+ </data>
+</archive>
diff --git a/Classes/ArrayEntryViewController.h b/Classes/ArrayEntryViewController.h
new file mode 100644
index 0000000..b962755
--- /dev/null
+++ b/Classes/ArrayEntryViewController.h
@@ -0,0 +1,20 @@
+//
+// ArrayEntryViewController.h
+// NSArchiveExample
+//
+// Created by Ben Ford on 4/27/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface ArrayEntryViewController : UIViewController {
+ IBOutlet UITextField *value1;
+ IBOutlet UITextField *value2;
+ IBOutlet UITextField *value3;
+ IBOutlet UITextField *value4;
+}
+- (void)loadData;
+- (IBAction)save;
+@end
diff --git a/Classes/ArrayEntryViewController.m b/Classes/ArrayEntryViewController.m
new file mode 100644
index 0000000..c5c7741
--- /dev/null
+++ b/Classes/ArrayEntryViewController.m
@@ -0,0 +1,47 @@
+//
+// ArrayEntryViewController.m
+// NSArchiveExample
+//
+// Created by Ben Ford on 4/27/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "ArrayEntryViewController.h"
+#import "Persistance.h"
+
+@implementation ArrayEntryViewController
+
+- (void)viewWillAppear:(BOOL)animated {
+ [self loadData];
+}
+
+- (void)loadData {
+ value1.text = [[Persistance sharedService].array objectAtIndex:0];
+ value2.text = [[Persistance sharedService].array objectAtIndex:1];
+ value3.text = [[Persistance sharedService].array objectAtIndex:2];
+ value4.text = [[Persistance sharedService].array objectAtIndex:3];
+}
+
+- (IBAction)save {
+ // taking the short route
+ [[Persistance sharedService].array removeAllObjects];
+
+ [[Persistance sharedService].array insertObject:value1.text atIndex:0];
+ [[Persistance sharedService].array insertObject:value2.text atIndex:1];
+ [[Persistance sharedService].array insertObject:value3.text atIndex:2];
+ [[Persistance sharedService].array insertObject:value4.text atIndex:3];
+}
+
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ [value1 resignFirstResponder];
+ [value2 resignFirstResponder];
+ [value3 resignFirstResponder];
+ [value4 resignFirstResponder];
+}
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+
+@end
diff --git a/Classes/ViewAllViewController.m b/Classes/ViewAllViewController.m
index f5f4caa..e9c8e42 100644
--- a/Classes/ViewAllViewController.m
+++ b/Classes/ViewAllViewController.m
@@ -1,98 +1,96 @@
//
// ViewAllViewController.m
// NSArchiveExample
//
// Created by Ben Ford on 4/22/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "ViewAllViewController.h"
#import "Model.h"
@implementation ViewAllViewController
- (void)viewDidAppear:(BOOL)animated {
// refresh everytime
[tableview reloadData];
}
#pragma mark UITableViewDelegate
#pragma mark -
#pragma mark UITableViewDataSource
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
switch (section) {
case 0:
return @"Person Object";
break;
case 1:
return @"Dictionary";
break;
case 2:
return @"Array";
break;
}
return @"error";
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
switch (section) {
case 0:
return 1;
break;
case 1:
return [[Persistance sharedService].dictionary count];
break;
case 2:
return [[Persistance sharedService].array count];
break;
default:
return 1;
break;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell;
cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if( cell == nil ) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"] autorelease];
}
- Person *person = nil;
switch (indexPath.section) {
case 0:
cell.textLabel.text = [Persistance sharedService].boss.fullName;
break;
case 1:
if( [[[Persistance sharedService].dictionary allKeys] count] > indexPath.row ) {
NSString *key = [[[Persistance sharedService].dictionary allKeys] objectAtIndex:indexPath.row];
NSString *value = [[Persistance sharedService].dictionary objectForKey:key];
cell.textLabel.text = value;
cell.detailTextLabel.text = [NSString stringWithFormat:@"value for key: %@",key];
}
break;
case 2:
- person = [[Persistance sharedService].array objectAtIndex:indexPath.row];
- cell.textLabel.text = person.fullName;
+ cell.textLabel.text = [[Persistance sharedService].array objectAtIndex:indexPath.row];
break;
default:
cell.textLabel.text = @"error";
break;
}
return cell;
}
#pragma mark -
- (void)dealloc {
[super dealloc];
}
@end
diff --git a/MainWindow.xib b/MainWindow.xib
index 85b2be5..77c668a 100644
--- a/MainWindow.xib
+++ b/MainWindow.xib
@@ -1,723 +1,755 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">800</int>
<string key="IBDocument.SystemVersion">10D2125</string>
<string key="IBDocument.InterfaceBuilderVersion">762</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.HIToolboxVersion">460.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">87</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="18"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="841351856">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="427554174">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUICustomObject" id="664661524">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUITabBarController" id="675605402">
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
<object class="IBUIViewController" key="IBUISelectedViewController" id="404439053">
<string key="IBUITitle">Dictionary</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="415100502">
<string key="IBUITitle">Dictionary</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">DictionaryEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="NSMutableArray" key="IBUIViewControllers">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIViewController" id="780626317">
<string key="IBUITitle">Boss</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="211206031">
<string key="IBUITitle">Boss</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">PersonEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<reference ref="404439053"/>
<object class="IBUIViewController" id="976730607">
<string key="IBUITitle">Array</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="582457009">
<string key="IBUITitle">Array</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIToolbarItems" ref="0"/>
<reference key="IBUIParentViewController" ref="675605402"/>
+ <string key="IBUINibName">ArrayEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="102828398">
<string key="IBUITitle">View All</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="794213646">
<string key="IBUITitle">View All</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIToolbarItems" ref="0"/>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">ViewAllView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</object>
<object class="IBUITabBar" key="IBUITabBar" id="764819862">
<nil key="NSNextResponder"/>
<int key="NSvFlags">266</int>
<string key="NSFrame">{{129, 330}, {163, 49}}</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBUIWindow" id="117978783">
<nil key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 480}</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="664661524"/>
</object>
<int key="connectionID">4</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="117978783"/>
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">tabBar</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="675605402"/>
</object>
<int key="connectionID">25</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="664661524"/>
<reference key="parent" ref="0"/>
<string key="objectName">NSArchiveExample App Delegate</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="427554174"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="117978783"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="675605402"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="764819862"/>
<reference ref="780626317"/>
<reference ref="404439053"/>
<reference ref="976730607"/>
<reference ref="102828398"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="764819862"/>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="780626317"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="211206031"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="404439053"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="415100502"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="415100502"/>
<reference key="parent" ref="404439053"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="211206031"/>
<reference key="parent" ref="780626317"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="976730607"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="582457009"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="582457009"/>
<reference key="parent" ref="976730607"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
<reference key="object" ref="102828398"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="794213646"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="794213646"/>
<reference key="parent" ref="102828398"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>12.IBEditorWindowLastContentRect</string>
<string>12.IBPluginDependency</string>
<string>15.IBEditorWindowLastContentRect</string>
<string>15.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>17.CustomClassName</string>
<string>17.IBPluginDependency</string>
<string>18.CustomClassName</string>
<string>18.IBPluginDependency</string>
<string>19.IBPluginDependency</string>
<string>20.IBPluginDependency</string>
+ <string>21.CustomClassName</string>
<string>26.CustomClassName</string>
<string>3.CustomClassName</string>
<string>3.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIApplication</string>
<string>UIResponder</string>
<string>{{525, 346}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>{{62, 276}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>PersonEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>DictionaryEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>ArrayEntryViewController</string>
<string>ViewAllViewController</string>
<string>NSArchiveExampleAppDelegate</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">27</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">ArrayEntryViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">save</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>value1</string>
+ <string>value2</string>
+ <string>value3</string>
+ <string>value4</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/ArrayEntryViewController.h</string>
+ </object>
+ </object>
<object class="IBPartialClassDescription">
<string key="className">DictionaryEntryViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">save</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>key1</string>
<string>key2</string>
<string>value1</string>
<string>value2</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UITextField</string>
<string>UITextField</string>
<string>UITextField</string>
<string>UITextField</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/DictionaryEntryViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSArchiveExampleAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>tabBar</string>
<string>window</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UITabBarController</string>
<string>UIWindow</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/NSArchiveExampleAppDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSArchiveExampleAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">PersonEntryViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">savePerson</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>age</string>
<string>firstName</string>
<string>isFullTime</string>
<string>lastName</string>
<string>titleLabel</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UITextField</string>
<string>UITextField</string>
<string>UISwitch</string>
<string>UITextField</string>
<string>UILabel</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/PersonEntryViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">ViewAllViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">tableview</string>
<string key="NS.object.0">UITableView</string>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/ViewAllViewController.h</string>
</object>
</object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="853905935">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIApplication</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIApplication.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIBarItem</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIBarItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIControl</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UILabel</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIResponder</string>
<string key="superclassName">NSObject</string>
<reference key="sourceIdentifier" ref="853905935"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIScrollView</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIScrollView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchBar</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchDisplayController</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISwitch</string>
<string key="superclassName">UIControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISwitch.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITabBar</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITabBarController</string>
<string key="superclassName">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="79470768">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITabBarItem</string>
<string key="superclassName">UIBarItem</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBarItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITableView</string>
<string key="superclassName">UIScrollView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITableView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITextField</string>
<string key="superclassName">UIControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="101380308">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<reference key="sourceIdentifier" ref="101380308"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<reference key="sourceIdentifier" ref="79470768"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIWindow</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIWindow.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">NSArchiveExample.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">87</string>
</data>
</archive>
diff --git a/NSArchiveExample.xcodeproj/Ben.pbxuser b/NSArchiveExample.xcodeproj/Ben.pbxuser
index 9134d23..acb01ec 100644
--- a/NSArchiveExample.xcodeproj/Ben.pbxuser
+++ b/NSArchiveExample.xcodeproj/Ben.pbxuser
@@ -1,600 +1,320 @@
// !$*UTF8*$!
{
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 529}";
};
};
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{266, 0}";
sepNavVisRange = "{0, 849}";
};
};
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
activeExec = 0;
executables = (
B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
);
};
29B97313FDCFA39411CA2CEA /* Project object */ = {
activeBuildConfigurationName = Debug;
activeExecutable = B5BFA7F6117F9A63008B450B /* NSArchiveExample */;
activeTarget = 1D6058900D05DD3D006BFB54 /* NSArchiveExample */;
addToTargets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
codeSenseManager = B5BFA801117F9A81008B450B /* Code sense */;
executables = (
B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
);
perUserDictionary = {
PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID;
PBXFileTableDataSourceColumnWidthsKey = (
22,
300,
442,
);
PBXFileTableDataSourceColumnsKey = (
PBXExecutablesDataSource_ActiveFlagID,
PBXExecutablesDataSource_NameID,
PBXExecutablesDataSource_CommentsID,
);
};
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
554,
20,
48,
43,
43,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
PBXFileDataSource_Target_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 293794679;
- PBXWorkspaceStateSaveDate = 293794679;
+ PBXPerProjectTemplateStateSaveDate = 294054686;
+ PBXWorkspaceStateSaveDate = 294054686;
};
perUserProjectItems = {
- B528D2E11181860C002D3B1C = B528D2E11181860C002D3B1C /* PBXTextBookmark */;
- B528D2E21181860C002D3B1C = B528D2E21181860C002D3B1C /* PBXTextBookmark */;
- B528D2E31181860C002D3B1C = B528D2E31181860C002D3B1C /* PBXTextBookmark */;
- B528D2E41181860C002D3B1C = B528D2E41181860C002D3B1C /* PBXTextBookmark */;
- B52EA5C81182F38B0065C4CA /* PBXTextBookmark */ = B52EA5C81182F38B0065C4CA /* PBXTextBookmark */;
- B52EA5C91182F38B0065C4CA /* PBXTextBookmark */ = B52EA5C91182F38B0065C4CA /* PBXTextBookmark */;
- B52EA5CD1182F98A0065C4CA /* PBXTextBookmark */ = B52EA5CD1182F98A0065C4CA /* PBXTextBookmark */;
- B52EA5D21182F9CF0065C4CA /* PBXTextBookmark */ = B52EA5D21182F9CF0065C4CA /* PBXTextBookmark */;
- B52EA64E118441EE0065C4CA /* PBXTextBookmark */ = B52EA64E118441EE0065C4CA /* PBXTextBookmark */;
- B52EA64F118441EE0065C4CA /* PBXTextBookmark */ = B52EA64F118441EE0065C4CA /* PBXTextBookmark */;
- B52EA650118441EE0065C4CA /* PBXTextBookmark */ = B52EA650118441EE0065C4CA /* PBXTextBookmark */;
- B52EA651118441EE0065C4CA /* PBXTextBookmark */ = B52EA651118441EE0065C4CA /* PBXTextBookmark */;
- B52EA652118441EE0065C4CA /* PBXTextBookmark */ = B52EA652118441EE0065C4CA /* PBXTextBookmark */;
- B52EA653118441EE0065C4CA /* PBXTextBookmark */ = B52EA653118441EE0065C4CA /* PBXTextBookmark */;
- B52EA654118441EE0065C4CA /* PBXTextBookmark */ = B52EA654118441EE0065C4CA /* PBXTextBookmark */;
- B52EA655118441EE0065C4CA /* PBXTextBookmark */ = B52EA655118441EE0065C4CA /* PBXTextBookmark */;
- B52EA656118441EE0065C4CA /* PBXTextBookmark */ = B52EA656118441EE0065C4CA /* PBXTextBookmark */;
- B52EA65D118442430065C4CA /* PBXTextBookmark */ = B52EA65D118442430065C4CA /* PBXTextBookmark */;
- B52EA6621184426A0065C4CA /* PBXTextBookmark */ = B52EA6621184426A0065C4CA /* PBXTextBookmark */;
- B52EA667118442920065C4CA /* PBXTextBookmark */ = B52EA667118442920065C4CA /* PBXTextBookmark */;
- B52EA66C118442A00065C4CA /* PBXTextBookmark */ = B52EA66C118442A00065C4CA /* PBXTextBookmark */;
- B52EA671118442E40065C4CA /* PBXTextBookmark */ = B52EA671118442E40065C4CA /* PBXTextBookmark */;
- B52EA672118442E40065C4CA /* PBXTextBookmark */ = B52EA672118442E40065C4CA /* PBXTextBookmark */;
- B52EA673118442E40065C4CA /* PBXTextBookmark */ = B52EA673118442E40065C4CA /* PBXTextBookmark */;
- B52EA67E118443920065C4CA /* PBXTextBookmark */ = B52EA67E118443920065C4CA /* PBXTextBookmark */;
- B52EA67F118443920065C4CA /* PBXTextBookmark */ = B52EA67F118443920065C4CA /* PBXTextBookmark */;
- B52EA680118443920065C4CA /* PBXTextBookmark */ = B52EA680118443920065C4CA /* PBXTextBookmark */;
- B52EA685118443CA0065C4CA /* PBXTextBookmark */ = B52EA685118443CA0065C4CA /* PBXTextBookmark */;
- B52EA686118443CA0065C4CA /* PBXTextBookmark */ = B52EA686118443CA0065C4CA /* PBXTextBookmark */;
- B52EA687118443CA0065C4CA /* PBXTextBookmark */ = B52EA687118443CA0065C4CA /* PBXTextBookmark */;
- B5B25FA911803848001BA9A0 = B5B25FA911803848001BA9A0 /* PBXTextBookmark */;
+ B52EA64E118441EE0065C4CA = B52EA64E118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA64F118441EE0065C4CA = B52EA64F118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA650118441EE0065C4CA = B52EA650118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA651118441EE0065C4CA = B52EA651118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA652118441EE0065C4CA = B52EA652118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA653118441EE0065C4CA = B52EA653118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA67E118443920065C4CA = B52EA67E118443920065C4CA /* PBXTextBookmark */;
+ B52EA685118443CA0065C4CA = B52EA685118443CA0065C4CA /* PBXTextBookmark */;
+ B52EA686118443CA0065C4CA = B52EA686118443CA0065C4CA /* PBXTextBookmark */;
+ B52EA6881184EAA50065C4CA = B52EA6881184EAA50065C4CA /* PBXTextBookmark */;
B5B25FAA11803848001BA9A0 = B5B25FAA11803848001BA9A0 /* PBXTextBookmark */;
- B5B25FAB11803848001BA9A0 = B5B25FAB11803848001BA9A0 /* PBXTextBookmark */;
- B5B25FAC11803848001BA9A0 = B5B25FAC11803848001BA9A0 /* PBXTextBookmark */;
};
sourceControlManager = B5BFA800117F9A81008B450B /* Source Control */;
userBuildSettings = {
};
};
- B528D2E11181860C002D3B1C /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA803117F9A96008B450B /* Persistance.m */;
- name = "Persistance.m: 66";
- rLen = 20;
- rLoc = 1401;
- rType = 0;
- vrLen = 415;
- vrLoc = 1189;
- };
- B528D2E21181860C002D3B1C /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA81C117F9CAD008B450B /* Person.m */;
- name = "Person.m: 42";
- rLen = 0;
- rLoc = 1063;
- rType = 0;
- vrLen = 499;
- vrLoc = 905;
- };
- B528D2E31181860C002D3B1C /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA842117FA1AA008B450B /* BossViewController.m */;
- name = "BossViewController.m: 31";
- rLen = 0;
- rLoc = 494;
- rType = 0;
- vrLen = 558;
- vrLoc = 201;
- };
- B528D2E41181860C002D3B1C /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 640;
- vrLoc = 686;
- };
- B52EA5C81182F38B0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 640;
- vrLoc = 686;
- };
- B52EA5C91182F38B0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 640;
- vrLoc = 686;
- };
- B52EA5CD1182F98A0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 23";
- rLen = 0;
- rLoc = 690;
- rType = 0;
- vrLen = 441;
- vrLoc = 342;
- };
- B52EA5D21182F9CF0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 35";
- rLen = 0;
- rLoc = 688;
- rType = 0;
- vrLen = 381;
- vrLoc = 342;
- };
B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {732, 418}}";
sepNavSelRange = "{455, 0}";
sepNavVisRange = "{0, 461}";
};
};
B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {732, 874}}";
sepNavSelRange = "{261, 176}";
sepNavVisRange = "{0, 486}";
};
};
B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {732, 399}}";
sepNavSelRange = "{407, 0}";
sepNavVisRange = "{0, 413}";
};
};
B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {732, 855}}";
sepNavSelRange = "{437, 0}";
sepNavVisRange = "{310, 672}";
};
};
B52EA64E118441EE0065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5BFA81C117F9CAD008B450B /* Person.m */;
name = "Person.m: 42";
rLen = 0;
rLoc = 1045;
rType = 0;
vrLen = 515;
vrLoc = 888;
};
B52EA64F118441EE0065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */;
name = "PersonEntryViewController.h: 20";
rLen = 0;
rLoc = 455;
rType = 0;
vrLen = 461;
vrLoc = 0;
};
B52EA650118441EE0065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5BFA802117F9A96008B450B /* Persistance.h */;
name = "Persistance.h: 22";
rLen = 0;
rLoc = 456;
rType = 0;
vrLen = 438;
vrLoc = 21;
};
B52EA651118441EE0065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5BFA803117F9A96008B450B /* Persistance.m */;
name = "Persistance.m: 120";
rLen = 0;
rLoc = 3347;
rType = 0;
vrLen = 614;
vrLoc = 2767;
};
B52EA652118441EE0065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */;
name = "DictionaryEntryViewController.h: 19";
rLen = 0;
rLoc = 407;
rType = 0;
vrLen = 413;
vrLoc = 0;
};
B52EA653118441EE0065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */;
name = "PersonEntryViewController.m: 13";
rLen = 176;
rLoc = 261;
rType = 0;
vrLen = 486;
vrLoc = 0;
};
- B52EA654118441EE0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */;
- name = "DictionaryEntryViewController.m: 43";
- rLen = 0;
- rLoc = 1163;
- rType = 0;
- vrLen = 639;
- vrLoc = 651;
- };
- B52EA655118441EE0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 76";
- rLen = 0;
- rLoc = 2053;
- rType = 0;
- vrLen = 600;
- vrLoc = 1272;
- };
- B52EA656118441EE0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 74";
- rLen = 0;
- rLoc = 1782;
- rType = 0;
- vrLen = 738;
- vrLoc = 1272;
- };
- B52EA65D118442430065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 75";
- rLen = 0;
- rLoc = 1892;
- rType = 0;
- vrLen = 758;
- vrLoc = 1272;
- };
- B52EA6621184426A0065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 63";
- rLen = 0;
- rLoc = 1399;
- rType = 0;
- vrLen = 579;
- vrLoc = 946;
- };
- B52EA667118442920065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 76";
- rLen = 0;
- rLoc = 1977;
- rType = 0;
- vrLen = 721;
- vrLoc = 1415;
- };
- B52EA66C118442A00065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 76";
- rLen = 0;
- rLoc = 1960;
- rType = 0;
- vrLen = 727;
- vrLoc = 1415;
- };
- B52EA671118442E40065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */;
- name = "ViewAllViewController.h: 13";
- rLen = 0;
- rLoc = 267;
- rType = 0;
- vrLen = 276;
- vrLoc = 0;
- };
- B52EA672118442E40065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 76";
- rLen = 0;
- rLoc = 1960;
- rType = 0;
- vrLen = 727;
- vrLoc = 1415;
- };
- B52EA673118442E40065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 15";
- rLen = 0;
- rLoc = 307;
- rType = 0;
- vrLen = 364;
- vrLoc = 52;
- };
B52EA67E118443920065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
name = "ViewAllViewController.m: 15";
rLen = 0;
rLoc = 307;
rType = 0;
vrLen = 369;
vrLoc = 52;
};
- B52EA67F118443920065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */;
- name = "DictionaryEntryViewController.m: 43";
- rLen = 0;
- rLoc = 1163;
- rType = 0;
- vrLen = 636;
- vrLoc = 654;
- };
- B52EA680118443920065C4CA /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */;
- name = "DictionaryEntryViewController.m: 21";
- rLen = 0;
- rLoc = 437;
- rType = 0;
- vrLen = 672;
- vrLoc = 310;
- };
B52EA685118443CA0065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */;
name = "DictionaryEntryViewController.m: 21";
rLen = 0;
rLoc = 437;
rType = 0;
vrLen = 672;
vrLoc = 310;
};
B52EA686118443CA0065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */;
name = "ViewAllViewController.h: 13";
rLen = 0;
rLoc = 267;
rType = 0;
vrLen = 276;
vrLoc = 0;
};
- B52EA687118443CA0065C4CA /* PBXTextBookmark */ = {
+ B52EA6881184EAA50065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
name = "ViewAllViewController.m: 33";
rLen = 0;
rLoc = 655;
rType = 0;
- vrLen = 388;
+ vrLen = 389;
vrLoc = 385;
};
B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {732, 362}}";
sepNavSelRange = "{267, 0}";
sepNavVisRange = "{0, 276}";
};
};
B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {756, 2033}}";
sepNavSelRange = "{655, 0}";
sepNavVisRange = "{385, 388}";
};
};
- B5B25FA911803848001BA9A0 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5BFA841117FA1AA008B450B /* BossViewController.h */;
- name = "BossViewController.h: 17";
- rLen = 0;
- rLoc = 286;
- rType = 0;
- vrLen = 425;
- vrLoc = 0;
- };
B5B25FAA11803848001BA9A0 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5BFA81B117F9CAD008B450B /* Person.h */;
name = "Person.h: 23";
rLen = 0;
rLoc = 495;
rType = 0;
vrLen = 535;
vrLoc = 40;
};
- B5B25FAB11803848001BA9A0 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */;
- name = "ViewAllViewController.h: 13";
- rLen = 0;
- rLoc = 267;
- rType = 0;
- vrLen = 276;
- vrLoc = 0;
- };
- B5B25FAC11803848001BA9A0 /* PBXTextBookmark */ = {
- isa = PBXTextBookmark;
- fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
- name = "ViewAllViewController.m: 1";
- rLen = 0;
- rLoc = 0;
- rType = 0;
- vrLen = 501;
- vrLoc = 343;
- };
B5BFA7F6117F9A63008B450B /* NSArchiveExample */ = {
isa = PBXExecutable;
activeArgIndices = (
);
argumentStrings = (
);
autoAttachOnCrash = 1;
breakpointsEnabled = 0;
configStateDict = {
};
customDataFormattersEnabled = 1;
dataTipCustomDataFormattersEnabled = 1;
dataTipShowTypeColumn = 1;
dataTipSortType = 0;
debuggerPlugin = GDBDebugging;
disassemblyDisplayState = 0;
dylibVariantSuffix = "";
enableDebugStr = 1;
environmentEntries = (
);
executableSystemSymbolLevel = 0;
executableUserSymbolLevel = 0;
libgmallocEnabled = 0;
name = NSArchiveExample;
showTypeColumn = 0;
sourceDirectories = (
);
};
B5BFA800117F9A81008B450B /* Source Control */ = {
isa = PBXSourceControlManager;
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
repositoryNamesForRoots = {
"" = "";
};
};
};
B5BFA801117F9A81008B450B /* Code sense */ = {
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
B5BFA802117F9A96008B450B /* Persistance.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {732, 608}}";
sepNavSelRange = "{456, 0}";
sepNavVisRange = "{21, 438}";
};
};
B5BFA803117F9A96008B450B /* Persistance.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {828, 2166}}";
sepNavSelRange = "{3347, 0}";
sepNavVisRange = "{2767, 614}";
};
};
B5BFA81B117F9CAD008B450B /* Person.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {732, 532}}";
sepNavSelRange = "{495, 0}";
sepNavVisRange = "{40, 535}";
};
};
B5BFA81C117F9CAD008B450B /* Person.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {732, 1102}}";
sepNavSelRange = "{1045, 0}";
sepNavVisRange = "{888, 515}";
};
};
B5BFA83B117FA0E3008B450B /* Model.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
sepNavSelRange = "{161, 0}";
sepNavVisRange = "{0, 181}";
};
};
- B5BFA841117FA1AA008B450B /* BossViewController.h */ = {
- isa = PBXFileReference;
- fileEncoding = 4;
- lastKnownFileType = sourcecode.c.h;
- name = BossViewController.h;
- path = /Users/ben/Devel/iPhone/NSArchiveExample/Classes/BossViewController.h;
- sourceTree = "<absolute>";
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {732, 385}}";
- sepNavSelRange = "{311, 0}";
- sepNavVisRange = "{0, 335}";
- sepNavWindowFrame = "{{38, 157}, {1354, 1235}}";
- };
- };
- B5BFA842117FA1AA008B450B /* BossViewController.m */ = {
- isa = PBXFileReference;
- fileEncoding = 4;
- lastKnownFileType = sourcecode.c.objc;
- name = BossViewController.m;
- path = /Users/ben/Devel/iPhone/NSArchiveExample/Classes/BossViewController.m;
- sourceTree = "<absolute>";
- uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {732, 385}}";
- sepNavSelRange = "{268, 0}";
- sepNavVisRange = "{0, 274}";
- };
- };
}
diff --git a/NSArchiveExample.xcodeproj/ben.mode1v3 b/NSArchiveExample.xcodeproj/ben.mode1v3
index fbf2d0c..b5f902b 100644
--- a/NSArchiveExample.xcodeproj/ben.mode1v3
+++ b/NSArchiveExample.xcodeproj/ben.mode1v3
@@ -1,842 +1,842 @@
<?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>ActivePerspectiveName</key>
<string>Project</string>
<key>AllowedModules</key>
<array>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Name</key>
<string>Groups and Files Outline View</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Name</key>
<string>Editor</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCTaskListModule</string>
<key>Name</key>
<string>Task List</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCDetailModule</string>
<key>Name</key>
<string>File and Smart Group Detail Viewer</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>1</string>
<key>Module</key>
<string>PBXBuildResultsModule</string>
<key>Name</key>
<string>Detailed Build Results Viewer</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>1</string>
<key>Module</key>
<string>PBXProjectFindModule</string>
<key>Name</key>
<string>Project Batch Find Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCProjectFormatConflictsModule</string>
<key>Name</key>
<string>Project Format Conflicts List</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXBookmarksModule</string>
<key>Name</key>
<string>Bookmarks Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXClassBrowserModule</string>
<key>Name</key>
<string>Class Browser</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXCVSModule</string>
<key>Name</key>
<string>Source Code Control Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXDebugBreakpointsModule</string>
<key>Name</key>
<string>Debug Breakpoints Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCDockableInspector</string>
<key>Name</key>
<string>Inspector</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXOpenQuicklyModule</string>
<key>Name</key>
<string>Open Quickly Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>1</string>
<key>Module</key>
<string>PBXDebugSessionModule</string>
<key>Name</key>
<string>Debugger</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>1</string>
<key>Module</key>
<string>PBXDebugCLIModule</string>
<key>Name</key>
<string>Debug Console</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCSnapshotModule</string>
<key>Name</key>
<string>Snapshots Tool</string>
</dict>
</array>
<key>BundlePath</key>
<string>/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources</string>
<key>Description</key>
<string>DefaultDescriptionKey</string>
<key>DockingSystemVisible</key>
<false/>
<key>Extension</key>
<string>mode1v3</string>
<key>FavBarConfig</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>B5B25F6711802DFC001BA9A0</string>
<key>XCBarModuleItemNames</key>
<dict/>
<key>XCBarModuleItems</key>
<array/>
</dict>
<key>FirstTimeWindowDisplayed</key>
<false/>
<key>Identifier</key>
<string>com.apple.perspectives.project.mode1v3</string>
<key>MajorVersion</key>
<integer>33</integer>
<key>MinorVersion</key>
<integer>0</integer>
<key>Name</key>
<string>Default</string>
<key>Notifications</key>
<array/>
<key>OpenEditors</key>
<array/>
<key>PerspectiveWidths</key>
<array>
<integer>-1</integer>
<integer>-1</integer>
</array>
<key>Perspectives</key>
<array>
<dict>
<key>ChosenToolbarItems</key>
<array>
<string>active-combo-popup</string>
<string>action</string>
<string>NSToolbarFlexibleSpaceItem</string>
<string>debugger-enable-breakpoints</string>
<string>build-and-go</string>
<string>com.apple.ide.PBXToolbarStopButton</string>
<string>get-info</string>
<string>NSToolbarFlexibleSpaceItem</string>
<string>com.apple.pbx.toolbar.searchfield</string>
</array>
<key>ControllerClassBaseName</key>
<string></string>
<key>IconName</key>
<string>WindowOfProjectWithEditor</string>
<key>Identifier</key>
<string>perspective.project</string>
<key>IsVertical</key>
<false/>
<key>Layout</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
<array>
<string>1C37FBAC04509CD000000102</string>
<string>1C37FAAC04509CD000000102</string>
<string>1C37FABC05509CD000000102</string>
<string>1C37FABC05539CD112110102</string>
<string>E2644B35053B69B200211256</string>
<string>1C37FABC04509CD000100104</string>
<string>1CC0EA4004350EF90044410B</string>
<string>1CC0EA4004350EF90041110B</string>
</array>
<key>PBXProjectModuleGUID</key>
<string>1CE0B1FE06471DED0097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Files</string>
<key>PBXProjectStructureProvided</key>
<string>yes</string>
<key>PBXSmartGroupTreeModuleColumnData</key>
<dict>
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array>
<real>270</real>
</array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array>
<string>MainColumn</string>
</array>
</dict>
<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
<dict>
<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
<array>
<string>29B97314FDCFA39411CA2CEA</string>
<string>080E96DDFE201D6D7F000001</string>
<string>B5BFA81E117F9CB4008B450B</string>
<string>29B97317FDCFA39411CA2CEA</string>
<string>1C37FABC05509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
<integer>14</integer>
<integer>1</integer>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
<string>{{0, 0}, {270, 597}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
<key>XCIncludePerspectivesSwitch</key>
<true/>
<key>XCSharingToken</key>
<string>com.apple.Xcode.GFSharingToken</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {287, 615}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
<real>270</real>
</array>
<key>RubberWindowFrame</key>
<string>1 122 1085 656 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
<string>287pt</string>
</dict>
<dict>
<key>Dock</key>
<array>
<dict>
<key>BecomeActive</key>
<true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CE0B20306471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>ViewAllViewController.m</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CE0B20406471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>ViewAllViewController.m</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>B52EA687118443CA0065C4CA</string>
+ <string>B52EA6881184EAA50065C4CA</string>
<key>history</key>
<array>
<string>B5B25FAA11803848001BA9A0</string>
<string>B52EA64E118441EE0065C4CA</string>
<string>B52EA64F118441EE0065C4CA</string>
<string>B52EA650118441EE0065C4CA</string>
<string>B52EA651118441EE0065C4CA</string>
<string>B52EA652118441EE0065C4CA</string>
<string>B52EA653118441EE0065C4CA</string>
<string>B52EA685118443CA0065C4CA</string>
<string>B52EA686118443CA0065C4CA</string>
<string>B52EA67E118443920065C4CA</string>
</array>
</dict>
<key>SplitCount</key>
<string>1</string>
</dict>
<key>StatusBarVisibility</key>
<true/>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {793, 417}}</string>
<key>RubberWindowFrame</key>
<string>1 122 1085 656 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
<string>417pt</string>
</dict>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CE0B20506471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Detail</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 422}, {793, 193}}</string>
<key>RubberWindowFrame</key>
<string>1 122 1085 656 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
<key>Proportion</key>
<string>193pt</string>
</dict>
</array>
<key>Proportion</key>
<string>793pt</string>
</dict>
</array>
<key>Name</key>
<string>Project</string>
<key>ServiceClasses</key>
<array>
<string>XCModuleDock</string>
<string>PBXSmartGroupTreeModule</string>
<string>XCModuleDock</string>
<string>PBXNavigatorGroup</string>
<string>XCDetailModule</string>
</array>
<key>TableOfContents</key>
<array>
<string>B52EA5CA1182F38B0065C4CA</string>
<string>1CE0B1FE06471DED0097A5F4</string>
<string>B52EA5CB1182F38B0065C4CA</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string>
</array>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.defaultV3</string>
</dict>
<dict>
<key>ControllerClassBaseName</key>
<string></string>
<key>IconName</key>
<string>WindowOfProject</string>
<key>Identifier</key>
<string>perspective.morph</string>
<key>IsVertical</key>
<integer>0</integer>
<key>Layout</key>
<array>
<dict>
<key>BecomeActive</key>
<integer>1</integer>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
<array>
<string>1C37FBAC04509CD000000102</string>
<string>1C37FAAC04509CD000000102</string>
<string>1C08E77C0454961000C914BD</string>
<string>1C37FABC05509CD000000102</string>
<string>1C37FABC05539CD112110102</string>
<string>E2644B35053B69B200211256</string>
<string>1C37FABC04509CD000100104</string>
<string>1CC0EA4004350EF90044410B</string>
<string>1CC0EA4004350EF90041110B</string>
</array>
<key>PBXProjectModuleGUID</key>
<string>11E0B1FE06471DED0097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Files</string>
<key>PBXProjectStructureProvided</key>
<string>yes</string>
<key>PBXSmartGroupTreeModuleColumnData</key>
<dict>
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array>
<real>186</real>
</array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array>
<string>MainColumn</string>
</array>
</dict>
<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
<dict>
<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
<array>
<string>29B97314FDCFA39411CA2CEA</string>
<string>1C37FABC05509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
<string>{{0, 0}, {186, 337}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
<key>XCIncludePerspectivesSwitch</key>
<integer>1</integer>
<key>XCSharingToken</key>
<string>com.apple.Xcode.GFSharingToken</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {203, 355}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
<real>186</real>
</array>
<key>RubberWindowFrame</key>
<string>373 269 690 397 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Name</key>
<string>Morph</string>
<key>PreferredWidth</key>
<integer>300</integer>
<key>ServiceClasses</key>
<array>
<string>XCModuleDock</string>
<string>PBXSmartGroupTreeModule</string>
</array>
<key>TableOfContents</key>
<array>
<string>11E0B1FE06471DED0097A5F4</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.default.shortV3</string>
</dict>
</array>
<key>PerspectivesBarVisible</key>
<false/>
<key>ShelfIsVisible</key>
<false/>
<key>SourceDescription</key>
<string>file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec'</string>
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
<real>0.0</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
<integer>1</integer>
<key>ToolbarIsVisible</key>
<true/>
<key>ToolbarSizeMode</key>
<integer>1</integer>
<key>Type</key>
<string>Perspectives</string>
<key>UpdateMessage</key>
<string>The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'?</string>
<key>WindowJustification</key>
<integer>5</integer>
<key>WindowOrderList</key>
<array>
<string>1C78EAAD065D492600B07095</string>
<string>1CD10A99069EF8BA00B06720</string>
<string>B5B25F6811802DFC001BA9A0</string>
<string>/Users/ben/Devel/iPhone/NSArchiveExample/NSArchiveExample.xcodeproj</string>
</array>
<key>WindowString</key>
<string>1 122 1085 656 0 0 1280 778 </string>
<key>WindowToolsV3</key>
<array>
<dict>
<key>FirstTimeWindowDisplayed</key>
<false/>
<key>Identifier</key>
<string>windowTool.build</string>
<key>IsVertical</key>
<true/>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528F0623707200166675</string>
<key>PBXProjectModuleLabel</key>
<string></string>
<key>StatusBarVisibility</key>
<true/>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {500, 218}}</string>
<key>RubberWindowFrame</key>
<string>267 217 500 500 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
<string>218pt</string>
</dict>
<dict>
<key>BecomeActive</key>
<true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>XCMainBuildResultsModuleGUID</string>
<key>PBXProjectModuleLabel</key>
<string>Build Results</string>
<key>XCBuildResultsTrigger_Collapse</key>
<integer>1021</integer>
<key>XCBuildResultsTrigger_Open</key>
<integer>1011</integer>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 223}, {500, 236}}</string>
<key>RubberWindowFrame</key>
<string>267 217 500 500 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
<key>Proportion</key>
<string>236pt</string>
</dict>
</array>
<key>Proportion</key>
<string>459pt</string>
</dict>
</array>
<key>Name</key>
<string>Build Results</string>
<key>ServiceClasses</key>
<array>
<string>PBXBuildResultsModule</string>
</array>
<key>StatusbarIsVisible</key>
<true/>
<key>TableOfContents</key>
<array>
<string>B5B25F6811802DFC001BA9A0</string>
<string>B52EA5CC1182F38B0065C4CA</string>
<string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.buildV3</string>
<key>WindowContentMinSize</key>
<string>486 300</string>
<key>WindowString</key>
<string>267 217 500 500 0 0 1280 778 </string>
<key>WindowToolGUID</key>
<string>B5B25F6811802DFC001BA9A0</string>
<key>WindowToolIsVisible</key>
<false/>
</dict>
<dict>
<key>FirstTimeWindowDisplayed</key>
<false/>
<key>Identifier</key>
<string>windowTool.debugger</string>
<key>IsVertical</key>
<true/>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>Debugger</key>
<dict>
<key>HorizontalSplitView</key>
<dict>
<key>_collapsingFrameDimension</key>
<real>0.0</real>
<key>_indexOfCollapsedView</key>
<integer>0</integer>
<key>_percentageOfCollapsedView</key>
<real>0.0</real>
<key>isCollapsed</key>
<string>yes</string>
<key>sizes</key>
<array>
<string>{{0, 0}, {316, 194}}</string>
<string>{{316, 0}, {378, 194}}</string>
</array>
</dict>
<key>VerticalSplitView</key>
<dict>
<key>_collapsingFrameDimension</key>
<real>0.0</real>
<key>_indexOfCollapsedView</key>
<integer>0</integer>
<key>_percentageOfCollapsedView</key>
<real>0.0</real>
<key>isCollapsed</key>
<string>yes</string>
<key>sizes</key>
<array>
<string>{{0, 0}, {694, 194}}</string>
<string>{{0, 194}, {694, 187}}</string>
</array>
</dict>
</dict>
<key>LauncherConfigVersion</key>
<string>8</string>
<key>PBXProjectModuleGUID</key>
<string>1C162984064C10D400B95A72</string>
<key>PBXProjectModuleLabel</key>
<string>Debug - GLUTExamples (Underwater)</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>DebugConsoleVisible</key>
<string>None</string>
<key>DebugConsoleWindowFrame</key>
<string>{{200, 200}, {500, 300}}</string>
<key>DebugSTDIOWindowFrame</key>
<string>{{200, 200}, {500, 300}}</string>
<key>Frame</key>
<string>{{0, 0}, {694, 381}}</string>
<key>PBXDebugSessionStackFrameViewKey</key>
<dict>
<key>DebugVariablesTableConfiguration</key>
<array>
<string>Name</string>
<real>120</real>
<string>Value</string>
<real>85</real>
<string>Summary</string>
<real>148</real>
</array>
<key>Frame</key>
<string>{{316, 0}, {378, 194}}</string>
<key>RubberWindowFrame</key>
<string>22 333 694 422 0 0 1280 778 </string>
</dict>
<key>RubberWindowFrame</key>
<string>22 333 694 422 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXDebugSessionModule</string>
<key>Proportion</key>
<string>381pt</string>
</dict>
</array>
<key>Proportion</key>
<string>381pt</string>
</dict>
</array>
<key>Name</key>
<string>Debugger</string>
<key>ServiceClasses</key>
<array>
<string>PBXDebugSessionModule</string>
</array>
<key>StatusbarIsVisible</key>
<true/>
<key>TableOfContents</key>
<array>
<string>1CD10A99069EF8BA00B06720</string>
<string>B52EA5D31182F9CF0065C4CA</string>
<string>1C162984064C10D400B95A72</string>
<string>B52EA5D41182F9CF0065C4CA</string>
<string>B52EA5D51182F9CF0065C4CA</string>
<string>B52EA5D61182F9CF0065C4CA</string>
<string>B52EA5D71182F9CF0065C4CA</string>
<string>B52EA5D81182F9CF0065C4CA</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.debugV3</string>
<key>WindowString</key>
<string>22 333 694 422 0 0 1280 778 </string>
<key>WindowToolGUID</key>
<string>1CD10A99069EF8BA00B06720</string>
<key>WindowToolIsVisible</key>
<false/>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.find</string>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CDD528C0622207200134675</string>
<key>PBXProjectModuleLabel</key>
<string><No Editor></string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528D0623707200166675</string>
</dict>
<key>SplitCount</key>
<string>1</string>
</dict>
<key>StatusBarVisibility</key>
<integer>1</integer>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {781, 167}}</string>
<key>RubberWindowFrame</key>
<string>62 385 781 470 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
<string>781pt</string>
</dict>
</array>
<key>Proportion</key>
<string>50%</string>
</dict>
<dict>
<key>BecomeActive</key>
<integer>1</integer>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528E0623707200166675</string>
<key>PBXProjectModuleLabel</key>
<string>Project Find</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{8, 0}, {773, 254}}</string>
<key>RubberWindowFrame</key>
<string>62 385 781 470 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXProjectFindModule</string>
<key>Proportion</key>
<string>50%</string>
</dict>
</array>
<key>Proportion</key>
<string>428pt</string>
</dict>
</array>
<key>Name</key>
<string>Project Find</string>
<key>ServiceClasses</key>
<array>
<string>PBXProjectFindModule</string>
diff --git a/NSArchiveExample.xcodeproj/project.pbxproj b/NSArchiveExample.xcodeproj/project.pbxproj
index b6334aa..568e0ed 100755
--- a/NSArchiveExample.xcodeproj/project.pbxproj
+++ b/NSArchiveExample.xcodeproj/project.pbxproj
@@ -1,295 +1,305 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */; };
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
B52EA5E51182FC2D0065C4CA /* PersonEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */; };
B52EA600118439900065C4CA /* DictionaryEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */; };
B52EA601118439900065C4CA /* DictionaryEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */; };
+ B52EA6921186EB390065C4CA /* ArrayEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA6901186EB390065C4CA /* ArrayEntryViewController.m */; };
+ B52EA6931186EB390065C4CA /* ArrayEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B52EA6911186EB390065C4CA /* ArrayEntryView.xib */; };
B5B25F7F11803200001BA9A0 /* ViewAllViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */; };
B5B25F8011803200001BA9A0 /* ViewAllView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5B25F7E11803200001BA9A0 /* ViewAllView.xib */; };
B5BFA804117F9A96008B450B /* Persistance.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA803117F9A96008B450B /* Persistance.m */; };
B5BFA81D117F9CAD008B450B /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA81C117F9CAD008B450B /* Person.m */; };
B5BFA845117FA1B8008B450B /* PersonEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5BFA844117FA1B8008B450B /* PersonEntryView.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExampleAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSArchiveExampleAppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSArchiveExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NSArchiveExampleViewController.xib; sourceTree = "<group>"; };
28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExample_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "NSArchiveExample-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PersonEntryViewController.h; sourceTree = "<group>"; };
B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PersonEntryViewController.m; sourceTree = "<group>"; };
B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryEntryViewController.h; sourceTree = "<group>"; };
B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DictionaryEntryViewController.m; sourceTree = "<group>"; };
B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DictionaryEntryView.xib; sourceTree = "<group>"; };
+ B52EA68F1186EB390065C4CA /* ArrayEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayEntryViewController.h; sourceTree = "<group>"; };
+ B52EA6901186EB390065C4CA /* ArrayEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArrayEntryViewController.m; sourceTree = "<group>"; };
+ B52EA6911186EB390065C4CA /* ArrayEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ArrayEntryView.xib; sourceTree = "<group>"; };
B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewAllViewController.h; sourceTree = "<group>"; };
B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewAllViewController.m; sourceTree = "<group>"; };
B5B25F7E11803200001BA9A0 /* ViewAllView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ViewAllView.xib; sourceTree = "<group>"; };
B5BFA802117F9A96008B450B /* Persistance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Persistance.h; sourceTree = "<group>"; };
B5BFA803117F9A96008B450B /* Persistance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Persistance.m; sourceTree = "<group>"; };
B5BFA81B117F9CAD008B450B /* Person.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Person.h; sourceTree = "<group>"; };
B5BFA81C117F9CAD008B450B /* Person.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Person.m; sourceTree = "<group>"; };
B5BFA83B117FA0E3008B450B /* Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Model.h; sourceTree = "<group>"; };
B5BFA844117FA1B8008B450B /* PersonEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PersonEntryView.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
B5BFA81E117F9CB4008B450B /* Model */,
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */,
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */,
B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */,
B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */,
B5BFA844117FA1B8008B450B /* PersonEntryView.xib */,
B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */,
B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */,
B5B25F7E11803200001BA9A0 /* ViewAllView.xib */,
B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */,
B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */,
B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */,
+ B52EA68F1186EB390065C4CA /* ArrayEntryViewController.h */,
+ B52EA6901186EB390065C4CA /* ArrayEntryViewController.m */,
+ B52EA6911186EB390065C4CA /* ArrayEntryView.xib */,
);
path = Classes;
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = CustomTemplate;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */,
28AD733E0D9D9553002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
288765A40DF7441C002DB57D /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
B5BFA81E117F9CB4008B450B /* Model */ = {
isa = PBXGroup;
children = (
B5BFA83B117FA0E3008B450B /* Model.h */,
B5BFA802117F9A96008B450B /* Persistance.h */,
B5BFA803117F9A96008B450B /* Persistance.m */,
B5BFA81B117F9CAD008B450B /* Person.h */,
B5BFA81C117F9CAD008B450B /* Person.m */,
);
name = Model;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */;
buildPhases = (
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = NSArchiveExample;
productName = NSArchiveExample;
productReference = 1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */;
compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
targets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1D60588D0D05DD3D006BFB54 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */,
B5BFA845117FA1B8008B450B /* PersonEntryView.xib in Resources */,
B5B25F8011803200001BA9A0 /* ViewAllView.xib in Resources */,
B52EA601118439900065C4CA /* DictionaryEntryView.xib in Resources */,
+ B52EA6931186EB390065C4CA /* ArrayEntryView.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */,
B5BFA804117F9A96008B450B /* Persistance.m in Sources */,
B5BFA81D117F9CAD008B450B /* Person.m in Sources */,
B5B25F7F11803200001BA9A0 /* ViewAllViewController.m in Sources */,
B52EA5E51182FC2D0065C4CA /* PersonEntryViewController.m in Sources */,
B52EA600118439900065C4CA /* DictionaryEntryViewController.m in Sources */,
+ B52EA6921186EB390065C4CA /* ArrayEntryViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
PRODUCT_NAME = NSArchiveExample;
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
PRODUCT_NAME = NSArchiveExample;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = iphoneos3.1.3;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = iphoneos3.1.3;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1D6058940D05DD3E006BFB54 /* Debug */,
1D6058950D05DD3E006BFB54 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
|
bentford/NSArchiveExample
|
fba09e474be35ac22e53176864f272c0c3665cf4
|
restructured code to store 1) custom object 2) NSDictionary 3) NSArray (before I was going for a boss, manager, employee structure, but it was not practical anymore.)
|
diff --git a/Classes/DictionaryEntryView.xib b/Classes/DictionaryEntryView.xib
new file mode 100644
index 0000000..bd1762c
--- /dev/null
+++ b/Classes/DictionaryEntryView.xib
@@ -0,0 +1,624 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">800</int>
+ <string key="IBDocument.SystemVersion">10D2125</string>
+ <string key="IBDocument.InterfaceBuilderVersion">762</string>
+ <string key="IBDocument.AppKitVersion">1038.29</string>
+ <string key="IBDocument.HIToolboxVersion">460.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">87</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="191373211">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUILabel" id="731403344">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 12}, {280, 21}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">7</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <string key="IBUIText">Use a NSDictionary as a datastore</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAAA</bytes>
+ </object>
+ <nil key="IBUIHighlightedColor"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ <int key="IBUITextAlignment">1</int>
+ </object>
+ <object class="IBUITextField" id="850948791">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 73}, {280, 31}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText"/>
+ <int key="IBUIBorderStyle">3</int>
+ <string key="IBUIPlaceholder">Key1</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace" id="113897569">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <object class="NSFont" key="IBUIFont" id="649910050">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">18</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBUITextField" id="1011899595">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 118}, {280, 31}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText"/>
+ <int key="IBUIBorderStyle">3</int>
+ <string key="IBUIPlaceholder">Value1</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <reference key="NSCustomColorSpace" ref="113897569"/>
+ </object>
+ <reference key="IBUIFont" ref="649910050"/>
+ <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBUITextField" id="863673677">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 181}, {280, 31}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText"/>
+ <int key="IBUIBorderStyle">3</int>
+ <string key="IBUIPlaceholder">Key2</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <reference key="NSCustomColorSpace" ref="113897569"/>
+ </object>
+ <reference key="IBUIFont" ref="649910050"/>
+ <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBUITextField" id="314208950">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 226}, {280, 31}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <string key="IBUIText"/>
+ <int key="IBUIBorderStyle">3</int>
+ <string key="IBUIPlaceholder">Value2</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ <reference key="NSCustomColorSpace" ref="113897569"/>
+ </object>
+ <reference key="IBUIFont" ref="649910050"/>
+ <bool key="IBUIAdjustsFontSizeToFit">YES</bool>
+ <float key="IBUIMinimumFontSize">17</float>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBUIButton" id="452507315">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 367}, {280, 37}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica-Bold</string>
+ <double key="NSSize">15</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <int key="IBUIButtonType">1</int>
+ <string key="IBUINormalTitle">Save</string>
+ <object class="NSColor" key="IBUIHighlightedTitleColor" id="127927139">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <object class="NSColor" key="IBUINormalTitleColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+ </object>
+ <object class="NSColor" key="IBUINormalTitleShadowColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC41AA</bytes>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{320, 460}</string>
+ <reference key="NSSuperview"/>
+ <reference key="IBUIBackgroundColor" ref="127927139"/>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">key1</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="850948791"/>
+ </object>
+ <int key="connectionID">10</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">key2</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="863673677"/>
+ </object>
+ <int key="connectionID">11</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">value1</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="1011899595"/>
+ </object>
+ <int key="connectionID">12</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">value2</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="314208950"/>
+ </object>
+ <int key="connectionID">13</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">save</string>
+ <reference key="source" ref="452507315"/>
+ <reference key="destination" ref="372490531"/>
+ <int key="IBEventType">7</int>
+ </object>
+ <int key="connectionID">14</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="191373211"/>
+ </object>
+ <int key="connectionID">15</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="191373211"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="731403344"/>
+ <reference ref="850948791"/>
+ <reference ref="1011899595"/>
+ <reference ref="863673677"/>
+ <reference ref="314208950"/>
+ <reference ref="452507315"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="731403344"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="850948791"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="1011899595"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">7</int>
+ <reference key="object" ref="863673677"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">8</int>
+ <reference key="object" ref="314208950"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">9</int>
+ <reference key="object" ref="452507315"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>4.IBPluginDependency</string>
+ <string>5.IBPluginDependency</string>
+ <string>6.IBPluginDependency</string>
+ <string>7.IBPluginDependency</string>
+ <string>8.IBPluginDependency</string>
+ <string>9.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>DictionaryEntryViewController</string>
+ <string>UIResponder</string>
+ <string>{{339, 247}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">15</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">DictionaryEntryViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">save</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>key1</string>
+ <string>key2</string>
+ <string>value1</string>
+ <string>value2</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/DictionaryEntryViewController.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="1015977472">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIButton</string>
+ <string key="superclassName">UIControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIButton.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIControl</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UILabel</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIResponder</string>
+ <string key="superclassName">NSObject</string>
+ <reference key="sourceIdentifier" ref="1015977472"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchBar</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchDisplayController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UITextField</string>
+ <string key="superclassName">UIControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="265239825">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <reference key="sourceIdentifier" ref="265239825"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../NSArchiveExample.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">87</string>
+ </data>
+</archive>
diff --git a/Classes/DictionaryEntryViewController.h b/Classes/DictionaryEntryViewController.h
new file mode 100644
index 0000000..6c9d426
--- /dev/null
+++ b/Classes/DictionaryEntryViewController.h
@@ -0,0 +1,20 @@
+//
+// DictionaryEntryViewController.h
+// NSArchiveExample
+//
+// Created by Ben Ford on 4/25/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface DictionaryEntryViewController : UIViewController {
+ IBOutlet UITextField *key1;
+ IBOutlet UITextField *value1;
+ IBOutlet UITextField *key2;
+ IBOutlet UITextField *value2;
+}
+- (IBAction)save;
+- (void)loadData;
+@end
diff --git a/Classes/DictionaryEntryViewController.m b/Classes/DictionaryEntryViewController.m
new file mode 100644
index 0000000..d6bbcdd
--- /dev/null
+++ b/Classes/DictionaryEntryViewController.m
@@ -0,0 +1,45 @@
+//
+// DictionaryEntryViewController.m
+// NSArchiveExample
+//
+// Created by Ben Ford on 4/25/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "DictionaryEntryViewController.h"
+#import "Model.h"
+
+@implementation DictionaryEntryViewController
+
+- (void)viewDidLoad {
+ [self loadData];
+}
+
+- (void)loadData {
+
+ // check if the dictionary has enough entries, if it does, load it into the view
+ NSArray *allKeys = [[Persistance sharedService].dictionary allKeys];
+ if( [allKeys count] > 0 ) {
+ key1.text = [allKeys objectAtIndex:0];
+ value1.text = [[Persistance sharedService].dictionary objectForKey:key1.text];
+ }
+
+ if( [allKeys count] > 1 ) {
+ key2.text = [allKeys objectAtIndex:1];
+ value2.text = [[Persistance sharedService].dictionary objectForKey:key2.text];
+ }
+}
+
+- (IBAction)save {
+ [[Persistance sharedService].dictionary setObject:value1.text forKey:key1.text];
+ [[Persistance sharedService].dictionary setObject:value2.text forKey:key2.text];
+}
+
+
+- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ [key1 resignFirstResponder];
+ [key2 resignFirstResponder];
+ [value1 resignFirstResponder];
+ [value2 resignFirstResponder];
+}
+@end
diff --git a/Classes/Persistance.h b/Classes/Persistance.h
index bc1aa06..6496ed8 100644
--- a/Classes/Persistance.h
+++ b/Classes/Persistance.h
@@ -1,31 +1,31 @@
//
// Persistance.h
// GuestInfo
//
// Created by Ben Ford on 10/23/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@class Person;
@interface Persistance : NSObject {
Person *boss;
- NSMutableDictionary *managers;
- NSMutableArray *employees;
+ NSMutableDictionary *dictionary;
+ NSMutableArray *array;
}
@property (nonatomic,retain) Person *boss;
-@property (nonatomic,retain) NSMutableDictionary *managers;
-@property (nonatomic,retain) NSMutableArray *employees;
+@property (nonatomic,retain) NSMutableDictionary *dictionary;
+@property (nonatomic,retain) NSMutableArray *array;
+ (Persistance*) sharedService;
- (void)loadFromDisk;
- (void)saveToDisk;
+ (NSString *)pathForDocumentsDirectoryFile:(NSString*)filename;
@end
diff --git a/Classes/Persistance.m b/Classes/Persistance.m
index f15eec4..64c53ca 100644
--- a/Classes/Persistance.m
+++ b/Classes/Persistance.m
@@ -1,124 +1,124 @@
//
// Persistance.m
// GuestInfo
//
// Created by Ben Ford on 10/23/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "Persistance.h"
#import "Person.h"
@implementation Persistance
-@synthesize boss, managers, employees;
+@synthesize boss, dictionary, array;
//taken from apple code example:
//http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/TP40002974-CH4-SW32
static Persistance *sharedGlobalInstance = nil;
- (id)init {
self = [super init];
return self;
}
#pragma mark Singleton
+ (Persistance*) sharedService {
if( sharedGlobalInstance == nil )
{
[[self alloc] init];// assignment not done here
}
return sharedGlobalInstance;
}
+ (Persistance*) allocWithZone:(NSZone*)zone {
@synchronized(self) {
if (sharedGlobalInstance == nil) {
sharedGlobalInstance = [super allocWithZone:zone];
return sharedGlobalInstance; // assignment and return on first allocation
}
}
return nil; //on subsequent allocation attempts return nil
}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (id)retain {
return self;
}
- (unsigned)retainCount {
return UINT_MAX; //denotes an object that cannot be released
}
- (void)release {
//do nothing
}
- (id)autorelease {
return self;
}
#pragma mark -
#pragma mark LifeCycle
- (void)loadFromDisk {
// boss
NSString *bossFilePath = [Persistance pathForDocumentsDirectoryFile:@"boss.archive"];
self.boss = [NSKeyedUnarchiver unarchiveObjectWithFile:bossFilePath];
if( !self.boss )
self.boss = [Person defaultPerson];
// managers
NSString *managerFilePath = [Persistance pathForDocumentsDirectoryFile:@"managers.archive"];
- self.managers = [NSKeyedUnarchiver unarchiveObjectWithFile:managerFilePath];
+ self.dictionary = [NSKeyedUnarchiver unarchiveObjectWithFile:managerFilePath];
- if( !self.managers )
- self.managers = [NSMutableDictionary dictionaryWithCapacity:0];
+ if( !self.dictionary )
+ self.dictionary = [NSMutableDictionary dictionaryWithCapacity:0];
// employees
NSString *employeesFilePath = [Persistance pathForDocumentsDirectoryFile:@"employees.archive"];
- self.employees = [NSKeyedUnarchiver unarchiveObjectWithFile:employeesFilePath];
+ self.array = [NSKeyedUnarchiver unarchiveObjectWithFile:employeesFilePath];
- if( !self.employees )
- self.employees = [NSMutableArray arrayWithCapacity:0];
+ if( !self.array )
+ self.array = [NSMutableArray arrayWithCapacity:0];
}
- (void)saveToDisk {
- NSString *bossFilePath = [Persistance pathForDocumentsDirectoryFile:@"boss.archive"];
- [NSKeyedArchiver archiveRootObject:self.boss toFile:bossFilePath];
+ NSString *dictionaryFilePath = [Persistance pathForDocumentsDirectoryFile:@"boss.archive"];
+ [NSKeyedArchiver archiveRootObject:self.boss toFile:dictionaryFilePath];
NSString *managersFilePath = [Persistance pathForDocumentsDirectoryFile:@"managers.archive"];
- [NSKeyedArchiver archiveRootObject:self.managers toFile:managersFilePath];
+ [NSKeyedArchiver archiveRootObject:self.dictionary toFile:managersFilePath];
- NSString *employeesFilePath = [Persistance pathForDocumentsDirectoryFile:@"employees.archive"];
- [NSKeyedArchiver archiveRootObject:self.employees toFile:employeesFilePath];
+ NSString *arrayFilePath = [Persistance pathForDocumentsDirectoryFile:@"employees.archive"];
+ [NSKeyedArchiver archiveRootObject:self.array toFile:arrayFilePath];
}
#pragma mark -
#pragma mark helpers
+ (NSString *)pathForDocumentsDirectoryFile:(NSString*)filename {
NSArray *paths = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
return [documentsDirectory stringByAppendingPathComponent:filename];
}
#pragma mark -
- (void)dealloc {
self.boss = nil;
- self.employees = nil;
- self.managers = nil;
+ self.dictionary = nil;
+ self.array = nil;
[super dealloc];
}
@end
diff --git a/Classes/BossView.xib b/Classes/PersonEntryView.xib
similarity index 92%
rename from Classes/BossView.xib
rename to Classes/PersonEntryView.xib
index b18f5fa..f8fcf58 100644
--- a/Classes/BossView.xib
+++ b/Classes/PersonEntryView.xib
@@ -1,642 +1,669 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
- <int key="IBDocument.SystemTarget">784</int>
- <string key="IBDocument.SystemVersion">10D573</string>
- <string key="IBDocument.InterfaceBuilderVersion">740</string>
+ <int key="IBDocument.SystemTarget">800</int>
+ <string key="IBDocument.SystemVersion">10D2125</string>
+ <string key="IBDocument.InterfaceBuilderVersion">762</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.HIToolboxVersion">460.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">62</string>
+ <string key="NS.object.0">87</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUITextField" id="939720903">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 64}, {280, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">First Name</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace" id="382993945">
<int key="NSID">2</int>
</object>
</object>
<object class="NSFont" key="IBUIFont" id="462333560">
<string key="NSName">Helvetica</string>
<double key="NSSize">18</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIClearsOnBeginEditing">YES</bool>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
- <object class="IBUITextInputTraits" key="IBUITextInputTraits"/>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
</object>
<object class="IBUITextField" id="261189894">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 111}, {280, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">Last Name</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<reference key="NSCustomColorSpace" ref="382993945"/>
</object>
<reference key="IBUIFont" ref="462333560"/>
<bool key="IBUIClearsOnBeginEditing">YES</bool>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
- <object class="IBUITextInputTraits" key="IBUITextInputTraits"/>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
</object>
<object class="IBUITextField" id="5586189">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 164}, {280, 31}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<string key="IBUIPlaceholder">Age</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<reference key="NSCustomColorSpace" ref="382993945"/>
</object>
<reference key="IBUIFont" ref="462333560"/>
<bool key="IBUIClearsOnBeginEditing">YES</bool>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
- <object class="IBUITextInputTraits" key="IBUITextInputTraits"/>
+ <object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
</object>
<object class="IBUISwitch" id="115392934">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{147, 231}, {94, 27}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<bool key="IBUIOn">YES</bool>
</object>
<object class="IBUILabel" id="628301908">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 237}, {90, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Is Full Time</string>
<object class="NSColor" key="IBUITextColor" id="883919357">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
</object>
<object class="IBUIButton" id="268590498">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 308}, {280, 37}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Save</string>
<object class="NSColor" key="IBUIHighlightedTitleColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
</object>
<object class="IBUILabel" id="65325736">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{105, 13}, {110, 29}}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Boss</string>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">24</double>
<int key="NSfFlags">16</int>
</object>
<reference key="IBUITextColor" ref="883919357"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">1</int>
</object>
</object>
<string key="NSFrameSize">{320, 411}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<reference key="NSCustomColorSpace" ref="382993945"/>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">2</int>
</object>
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">13</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">age</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="5586189"/>
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">firstName</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="939720903"/>
</object>
<int key="connectionID">15</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">isFullTime</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="115392934"/>
</object>
<int key="connectionID">16</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">lastName</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="261189894"/>
</object>
<int key="connectionID">17</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
- <string key="label">saveBoss</string>
+ <string key="label">savePerson</string>
<reference key="source" ref="268590498"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
- <int key="connectionID">18</int>
+ <int key="connectionID">19</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">titleLabel</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="65325736"/>
+ </object>
+ <int key="connectionID">21</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="939720903"/>
<reference ref="628301908"/>
<reference ref="268590498"/>
<reference ref="115392934"/>
<reference ref="261189894"/>
<reference ref="5586189"/>
<reference ref="65325736"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="939720903"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="261189894"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="5586189"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">9</int>
<reference key="object" ref="115392934"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">10</int>
<reference key="object" ref="628301908"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">11</int>
<reference key="object" ref="268590498"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="65325736"/>
<reference key="parent" ref="191373211"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>1.IBEditorWindowLastContentRect</string>
<string>1.IBPluginDependency</string>
<string>10.IBPluginDependency</string>
<string>11.IBPluginDependency</string>
<string>12.IBPluginDependency</string>
<string>3.IBPluginDependency</string>
<string>4.IBPluginDependency</string>
<string>7.IBPluginDependency</string>
<string>9.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>BossViewController</string>
+ <string>PersonEntryViewController</string>
<string>UIResponder</string>
- <string>{{1072, 733}, {320, 480}}</string>
+ <string>{{340, 276}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">18</int>
+ <int key="maxID">21</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
- <string key="className">BossViewController</string>
+ <string key="className">PersonEntryViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">saveBoss</string>
+ <string key="NS.key.0">savePerson</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>age</string>
<string>firstName</string>
<string>isFullTime</string>
<string>lastName</string>
+ <string>titleLabel</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UITextField</string>
<string>UITextField</string>
<string>UISwitch</string>
<string>UITextField</string>
+ <string>UILabel</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
- <string key="minorKey">Classes/BossViewController.h</string>
+ <string key="minorKey">Classes/PersonEntryViewController.h</string>
</object>
</object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="117124143">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIButton</string>
<string key="superclassName">UIControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIControl</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UILabel</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIResponder</string>
<string key="superclassName">NSObject</string>
<reference key="sourceIdentifier" ref="117124143"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchBar</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchDisplayController</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISwitch</string>
<string key="superclassName">UIControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISwitch.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITextField</string>
<string key="superclassName">UIControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="507764279">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<reference key="sourceIdentifier" ref="507764279"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">../NSArchiveExample.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">3.1</string>
+ <string key="IBCocoaTouchPluginVersion">87</string>
</data>
</archive>
diff --git a/Classes/BossViewController.h b/Classes/PersonEntryViewController.h
similarity index 55%
rename from Classes/BossViewController.h
rename to Classes/PersonEntryViewController.h
index 7225c14..d693e59 100644
--- a/Classes/BossViewController.h
+++ b/Classes/PersonEntryViewController.h
@@ -1,21 +1,21 @@
//
-// BossViewController.h
+// PersonEntryViewController.h
// NSArchiveExample
//
-// Created by Ben Ford on 4/21/10.
+// Created by Ben Ford on 4/24/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
-#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
-@interface BossViewController : UIViewController {
+@interface PersonEntryViewController : UIViewController {
IBOutlet UITextField *firstName;
IBOutlet UITextField *lastName;
IBOutlet UITextField *age;
IBOutlet UISwitch *isFullTime;
+ IBOutlet UILabel *titleLabel;
}
-
-- (IBAction)saveBoss;
+- (IBAction)savePerson;
- (void)loadBoss;
@end
diff --git a/Classes/BossViewController.m b/Classes/PersonEntryViewController.m
similarity index 80%
rename from Classes/BossViewController.m
rename to Classes/PersonEntryViewController.m
index 9ad0303..2732b6b 100644
--- a/Classes/BossViewController.m
+++ b/Classes/PersonEntryViewController.m
@@ -1,43 +1,45 @@
-//
-// BossViewController.m
+ //
+// PersonEntryViewController.m
// NSArchiveExample
//
-// Created by Ben Ford on 4/21/10.
+// Created by Ben Ford on 4/24/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
-#import "BossViewController.h"
+#import "PersonEntryViewController.h"
#import "Model.h"
-@implementation BossViewController
-
-- (void)awakeFromNib {
-
+@implementation PersonEntryViewController
+- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ [firstName resignFirstResponder];
+ [lastName resignFirstResponder];
+ [age resignFirstResponder];
}
- (void)viewDidLoad {
[super viewDidLoad];
[self loadBoss];
}
-- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
- [firstName resignFirstResponder];
- [lastName resignFirstResponder];
- [age resignFirstResponder];
-}
- (void)loadBoss {
firstName.text = [Persistance sharedService].boss.firstName;
lastName.text = [Persistance sharedService].boss.lastName;
age.text = [NSString stringWithFormat:@"%d",[Persistance sharedService].boss.age];
[isFullTime setOn:[Persistance sharedService].boss.isFullTime animated:NO];
}
-- (IBAction)saveBoss {
-
+- (IBAction)savePerson {
+
[Persistance sharedService].boss.firstName = firstName.text;
[Persistance sharedService].boss.lastName = lastName.text;
[Persistance sharedService].boss.age = [age.text intValue];
[Persistance sharedService].boss.isFullTime = isFullTime.on;
}
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+
@end
diff --git a/Classes/ViewAllViewController.m b/Classes/ViewAllViewController.m
index d0002b1..f5f4caa 100644
--- a/Classes/ViewAllViewController.m
+++ b/Classes/ViewAllViewController.m
@@ -1,93 +1,98 @@
//
// ViewAllViewController.m
// NSArchiveExample
//
// Created by Ben Ford on 4/22/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "ViewAllViewController.h"
#import "Model.h"
@implementation ViewAllViewController
-
-- (void)viewDidLoad {
- [super viewDidLoad];
+- (void)viewDidAppear:(BOOL)animated {
+
+ // refresh everytime
+ [tableview reloadData];
}
#pragma mark UITableViewDelegate
#pragma mark -
#pragma mark UITableViewDataSource
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
switch (section) {
case 0:
- return @"Boss";
+ return @"Person Object";
break;
case 1:
- return @"Managers";
+ return @"Dictionary";
break;
case 2:
- return @"Employees";
+ return @"Array";
break;
}
return @"error";
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
switch (section) {
case 0:
return 1;
break;
case 1:
- return [[Persistance sharedService].managers count];
+ return [[Persistance sharedService].dictionary count];
break;
case 2:
- return [[Persistance sharedService].employees count];
+ return [[Persistance sharedService].array count];
break;
default:
return 1;
break;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell;
cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if( cell == nil ) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewStylePlain reuseIdentifier:@"cell"] autorelease];
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"] autorelease];
}
Person *person = nil;
switch (indexPath.section) {
case 0:
cell.textLabel.text = [Persistance sharedService].boss.fullName;
break;
case 1:
- person = [[Persistance sharedService].managers objectForKey:@"HeadManager"];
- cell.textLabel.text = person.fullName;
+ if( [[[Persistance sharedService].dictionary allKeys] count] > indexPath.row ) {
+ NSString *key = [[[Persistance sharedService].dictionary allKeys] objectAtIndex:indexPath.row];
+ NSString *value = [[Persistance sharedService].dictionary objectForKey:key];
+ cell.textLabel.text = value;
+ cell.detailTextLabel.text = [NSString stringWithFormat:@"value for key: %@",key];
+ }
break;
case 2:
- person = [[Persistance sharedService].employees objectAtIndex:indexPath.row];
+ person = [[Persistance sharedService].array objectAtIndex:indexPath.row];
cell.textLabel.text = person.fullName;
break;
default:
cell.textLabel.text = @"error";
break;
}
return cell;
}
#pragma mark -
- (void)dealloc {
[super dealloc];
}
@end
diff --git a/MainWindow.xib b/MainWindow.xib
index ce9a0e3..85b2be5 100644
--- a/MainWindow.xib
+++ b/MainWindow.xib
@@ -1,681 +1,723 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">800</int>
<string key="IBDocument.SystemVersion">10D2125</string>
<string key="IBDocument.InterfaceBuilderVersion">762</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.HIToolboxVersion">460.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">87</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="15"/>
+ <integer value="18"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="841351856">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="427554174">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUICustomObject" id="664661524">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUITabBarController" id="675605402">
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
- <object class="IBUIViewController" key="IBUISelectedViewController" id="780626317">
- <string key="IBUITitle">Boss</string>
- <object class="IBUITabBarItem" key="IBUITabBarItem" id="211206031">
- <string key="IBUITitle">Boss</string>
+ <object class="IBUIViewController" key="IBUISelectedViewController" id="404439053">
+ <string key="IBUITitle">Dictionary</string>
+ <object class="IBUITabBarItem" key="IBUITabBarItem" id="415100502">
+ <string key="IBUITitle">Dictionary</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
- <string key="IBUINibName">BossView</string>
+ <string key="IBUINibName">DictionaryEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="NSMutableArray" key="IBUIViewControllers">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="780626317"/>
- <object class="IBUIViewController" id="404439053">
- <string key="IBUITitle">Managers</string>
- <object class="IBUITabBarItem" key="IBUITabBarItem" id="415100502">
- <string key="IBUITitle">Managers</string>
+ <object class="IBUIViewController" id="780626317">
+ <string key="IBUITitle">Boss</string>
+ <object class="IBUITabBarItem" key="IBUITabBarItem" id="211206031">
+ <string key="IBUITitle">Boss</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
+ <string key="IBUINibName">PersonEntryView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
+ <reference ref="404439053"/>
<object class="IBUIViewController" id="976730607">
- <string key="IBUITitle">Employees</string>
+ <string key="IBUITitle">Array</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="582457009">
- <string key="IBUITitle">Employees</string>
+ <string key="IBUITitle">Array</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIToolbarItems" ref="0"/>
<reference key="IBUIParentViewController" ref="675605402"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="102828398">
<string key="IBUITitle">View All</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="794213646">
<string key="IBUITitle">View All</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIToolbarItems" ref="0"/>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">ViewAllView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</object>
<object class="IBUITabBar" key="IBUITabBar" id="764819862">
<nil key="NSNextResponder"/>
<int key="NSvFlags">266</int>
<string key="NSFrame">{{129, 330}, {163, 49}}</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBUIWindow" id="117978783">
<nil key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 480}</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="664661524"/>
</object>
<int key="connectionID">4</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="117978783"/>
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">tabBar</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="675605402"/>
</object>
<int key="connectionID">25</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="664661524"/>
<reference key="parent" ref="0"/>
<string key="objectName">NSArchiveExample App Delegate</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="427554174"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="117978783"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="675605402"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="764819862"/>
<reference ref="780626317"/>
<reference ref="404439053"/>
<reference ref="976730607"/>
<reference ref="102828398"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="764819862"/>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="780626317"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="211206031"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="404439053"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="415100502"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="415100502"/>
<reference key="parent" ref="404439053"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="211206031"/>
<reference key="parent" ref="780626317"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="976730607"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="582457009"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="582457009"/>
<reference key="parent" ref="976730607"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
<reference key="object" ref="102828398"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="794213646"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="794213646"/>
<reference key="parent" ref="102828398"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>12.IBEditorWindowLastContentRect</string>
<string>12.IBPluginDependency</string>
<string>15.IBEditorWindowLastContentRect</string>
<string>15.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>17.CustomClassName</string>
<string>17.IBPluginDependency</string>
+ <string>18.CustomClassName</string>
<string>18.IBPluginDependency</string>
<string>19.IBPluginDependency</string>
<string>20.IBPluginDependency</string>
<string>26.CustomClassName</string>
<string>3.CustomClassName</string>
<string>3.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIApplication</string>
<string>UIResponder</string>
<string>{{525, 346}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string>{{40, 778}, {0, -22}}</string>
+ <string>{{62, 276}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string>BossViewController</string>
+ <string>PersonEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>DictionaryEntryViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>ViewAllViewController</string>
<string>NSArchiveExampleAppDelegate</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">27</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
- <string key="className">BossViewController</string>
+ <string key="className">DictionaryEntryViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">saveBoss</string>
+ <string key="NS.key.0">save</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>age</string>
- <string>firstName</string>
- <string>isFullTime</string>
- <string>lastName</string>
+ <string>key1</string>
+ <string>key2</string>
+ <string>value1</string>
+ <string>value2</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UITextField</string>
<string>UITextField</string>
- <string>UISwitch</string>
+ <string>UITextField</string>
<string>UITextField</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
- <string key="minorKey">Classes/BossViewController.h</string>
+ <string key="minorKey">Classes/DictionaryEntryViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSArchiveExampleAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>tabBar</string>
<string>window</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UITabBarController</string>
<string>UIWindow</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/NSArchiveExampleAppDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSArchiveExampleAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">PersonEntryViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">savePerson</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>age</string>
+ <string>firstName</string>
+ <string>isFullTime</string>
+ <string>lastName</string>
+ <string>titleLabel</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UISwitch</string>
+ <string>UITextField</string>
+ <string>UILabel</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/PersonEntryViewController.h</string>
+ </object>
+ </object>
<object class="IBPartialClassDescription">
<string key="className">ViewAllViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">tableview</string>
<string key="NS.object.0">UITableView</string>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/ViewAllViewController.h</string>
</object>
</object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="853905935">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIApplication</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIApplication.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIBarItem</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIBarItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIControl</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
</object>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UILabel</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
+ </object>
+ </object>
<object class="IBPartialClassDescription">
<string key="className">UIResponder</string>
<string key="superclassName">NSObject</string>
<reference key="sourceIdentifier" ref="853905935"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIScrollView</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIScrollView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchBar</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchDisplayController</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISwitch</string>
<string key="superclassName">UIControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISwitch.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITabBar</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITabBarController</string>
<string key="superclassName">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="79470768">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITabBarItem</string>
<string key="superclassName">UIBarItem</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBarItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITableView</string>
<string key="superclassName">UIScrollView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITableView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITextField</string>
<string key="superclassName">UIControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="101380308">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<reference key="sourceIdentifier" ref="101380308"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<reference key="sourceIdentifier" ref="79470768"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIWindow</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIWindow.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">NSArchiveExample.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">87</string>
</data>
</archive>
diff --git a/NSArchiveExample.xcodeproj/Ben.pbxuser b/NSArchiveExample.xcodeproj/Ben.pbxuser
index d6df7e4..9134d23 100644
--- a/NSArchiveExample.xcodeproj/Ben.pbxuser
+++ b/NSArchiveExample.xcodeproj/Ben.pbxuser
@@ -1,304 +1,600 @@
// !$*UTF8*$!
{
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 529}";
};
};
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{266, 0}";
sepNavVisRange = "{0, 849}";
};
};
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
activeExec = 0;
executables = (
B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
);
};
29B97313FDCFA39411CA2CEA /* Project object */ = {
activeBuildConfigurationName = Debug;
activeExecutable = B5BFA7F6117F9A63008B450B /* NSArchiveExample */;
activeTarget = 1D6058900D05DD3D006BFB54 /* NSArchiveExample */;
addToTargets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
codeSenseManager = B5BFA801117F9A81008B450B /* Code sense */;
executables = (
B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
);
perUserDictionary = {
+ PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = {
+ PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+ PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID;
+ PBXFileTableDataSourceColumnWidthsKey = (
+ 22,
+ 300,
+ 442,
+ );
+ PBXFileTableDataSourceColumnsKey = (
+ PBXExecutablesDataSource_ActiveFlagID,
+ PBXExecutablesDataSource_NameID,
+ PBXExecutablesDataSource_CommentsID,
+ );
+ };
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
554,
20,
48,
43,
43,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
PBXFileDataSource_Target_ColumnID,
);
};
PBXPerProjectTemplateStateSaveDate = 293794679;
PBXWorkspaceStateSaveDate = 293794679;
};
perUserProjectItems = {
B528D2E11181860C002D3B1C = B528D2E11181860C002D3B1C /* PBXTextBookmark */;
B528D2E21181860C002D3B1C = B528D2E21181860C002D3B1C /* PBXTextBookmark */;
B528D2E31181860C002D3B1C = B528D2E31181860C002D3B1C /* PBXTextBookmark */;
B528D2E41181860C002D3B1C = B528D2E41181860C002D3B1C /* PBXTextBookmark */;
B52EA5C81182F38B0065C4CA /* PBXTextBookmark */ = B52EA5C81182F38B0065C4CA /* PBXTextBookmark */;
B52EA5C91182F38B0065C4CA /* PBXTextBookmark */ = B52EA5C91182F38B0065C4CA /* PBXTextBookmark */;
B52EA5CD1182F98A0065C4CA /* PBXTextBookmark */ = B52EA5CD1182F98A0065C4CA /* PBXTextBookmark */;
B52EA5D21182F9CF0065C4CA /* PBXTextBookmark */ = B52EA5D21182F9CF0065C4CA /* PBXTextBookmark */;
+ B52EA64E118441EE0065C4CA /* PBXTextBookmark */ = B52EA64E118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA64F118441EE0065C4CA /* PBXTextBookmark */ = B52EA64F118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA650118441EE0065C4CA /* PBXTextBookmark */ = B52EA650118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA651118441EE0065C4CA /* PBXTextBookmark */ = B52EA651118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA652118441EE0065C4CA /* PBXTextBookmark */ = B52EA652118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA653118441EE0065C4CA /* PBXTextBookmark */ = B52EA653118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA654118441EE0065C4CA /* PBXTextBookmark */ = B52EA654118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA655118441EE0065C4CA /* PBXTextBookmark */ = B52EA655118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA656118441EE0065C4CA /* PBXTextBookmark */ = B52EA656118441EE0065C4CA /* PBXTextBookmark */;
+ B52EA65D118442430065C4CA /* PBXTextBookmark */ = B52EA65D118442430065C4CA /* PBXTextBookmark */;
+ B52EA6621184426A0065C4CA /* PBXTextBookmark */ = B52EA6621184426A0065C4CA /* PBXTextBookmark */;
+ B52EA667118442920065C4CA /* PBXTextBookmark */ = B52EA667118442920065C4CA /* PBXTextBookmark */;
+ B52EA66C118442A00065C4CA /* PBXTextBookmark */ = B52EA66C118442A00065C4CA /* PBXTextBookmark */;
+ B52EA671118442E40065C4CA /* PBXTextBookmark */ = B52EA671118442E40065C4CA /* PBXTextBookmark */;
+ B52EA672118442E40065C4CA /* PBXTextBookmark */ = B52EA672118442E40065C4CA /* PBXTextBookmark */;
+ B52EA673118442E40065C4CA /* PBXTextBookmark */ = B52EA673118442E40065C4CA /* PBXTextBookmark */;
+ B52EA67E118443920065C4CA /* PBXTextBookmark */ = B52EA67E118443920065C4CA /* PBXTextBookmark */;
+ B52EA67F118443920065C4CA /* PBXTextBookmark */ = B52EA67F118443920065C4CA /* PBXTextBookmark */;
+ B52EA680118443920065C4CA /* PBXTextBookmark */ = B52EA680118443920065C4CA /* PBXTextBookmark */;
+ B52EA685118443CA0065C4CA /* PBXTextBookmark */ = B52EA685118443CA0065C4CA /* PBXTextBookmark */;
+ B52EA686118443CA0065C4CA /* PBXTextBookmark */ = B52EA686118443CA0065C4CA /* PBXTextBookmark */;
+ B52EA687118443CA0065C4CA /* PBXTextBookmark */ = B52EA687118443CA0065C4CA /* PBXTextBookmark */;
B5B25FA911803848001BA9A0 = B5B25FA911803848001BA9A0 /* PBXTextBookmark */;
B5B25FAA11803848001BA9A0 = B5B25FAA11803848001BA9A0 /* PBXTextBookmark */;
B5B25FAB11803848001BA9A0 = B5B25FAB11803848001BA9A0 /* PBXTextBookmark */;
B5B25FAC11803848001BA9A0 = B5B25FAC11803848001BA9A0 /* PBXTextBookmark */;
};
sourceControlManager = B5BFA800117F9A81008B450B /* Source Control */;
userBuildSettings = {
};
};
B528D2E11181860C002D3B1C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5BFA803117F9A96008B450B /* Persistance.m */;
name = "Persistance.m: 66";
rLen = 20;
- rLoc = 1403;
+ rLoc = 1401;
rType = 0;
vrLen = 415;
vrLoc = 1189;
};
B528D2E21181860C002D3B1C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5BFA81C117F9CAD008B450B /* Person.m */;
name = "Person.m: 42";
rLen = 0;
- rLoc = 1064;
+ rLoc = 1063;
rType = 0;
vrLen = 499;
vrLoc = 905;
};
B528D2E31181860C002D3B1C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5BFA842117FA1AA008B450B /* BossViewController.m */;
name = "BossViewController.m: 31";
rLen = 0;
- rLoc = 670;
+ rLoc = 494;
rType = 0;
vrLen = 558;
vrLoc = 201;
};
B528D2E41181860C002D3B1C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
name = "ViewAllViewController.m: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 640;
vrLoc = 686;
};
B52EA5C81182F38B0065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
name = "ViewAllViewController.m: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 640;
vrLoc = 686;
};
B52EA5C91182F38B0065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
name = "ViewAllViewController.m: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 640;
vrLoc = 686;
};
B52EA5CD1182F98A0065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
name = "ViewAllViewController.m: 23";
rLen = 0;
- rLoc = 640;
+ rLoc = 690;
rType = 0;
vrLen = 441;
vrLoc = 342;
};
B52EA5D21182F9CF0065C4CA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
name = "ViewAllViewController.m: 35";
rLen = 0;
- rLoc = 638;
+ rLoc = 688;
rType = 0;
vrLen = 381;
vrLoc = 342;
};
+ B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {732, 418}}";
+ sepNavSelRange = "{455, 0}";
+ sepNavVisRange = "{0, 461}";
+ };
+ };
+ B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {732, 874}}";
+ sepNavSelRange = "{261, 176}";
+ sepNavVisRange = "{0, 486}";
+ };
+ };
+ B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {732, 399}}";
+ sepNavSelRange = "{407, 0}";
+ sepNavVisRange = "{0, 413}";
+ };
+ };
+ B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {732, 855}}";
+ sepNavSelRange = "{437, 0}";
+ sepNavVisRange = "{310, 672}";
+ };
+ };
+ B52EA64E118441EE0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5BFA81C117F9CAD008B450B /* Person.m */;
+ name = "Person.m: 42";
+ rLen = 0;
+ rLoc = 1045;
+ rType = 0;
+ vrLen = 515;
+ vrLoc = 888;
+ };
+ B52EA64F118441EE0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */;
+ name = "PersonEntryViewController.h: 20";
+ rLen = 0;
+ rLoc = 455;
+ rType = 0;
+ vrLen = 461;
+ vrLoc = 0;
+ };
+ B52EA650118441EE0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5BFA802117F9A96008B450B /* Persistance.h */;
+ name = "Persistance.h: 22";
+ rLen = 0;
+ rLoc = 456;
+ rType = 0;
+ vrLen = 438;
+ vrLoc = 21;
+ };
+ B52EA651118441EE0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5BFA803117F9A96008B450B /* Persistance.m */;
+ name = "Persistance.m: 120";
+ rLen = 0;
+ rLoc = 3347;
+ rType = 0;
+ vrLen = 614;
+ vrLoc = 2767;
+ };
+ B52EA652118441EE0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */;
+ name = "DictionaryEntryViewController.h: 19";
+ rLen = 0;
+ rLoc = 407;
+ rType = 0;
+ vrLen = 413;
+ vrLoc = 0;
+ };
+ B52EA653118441EE0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */;
+ name = "PersonEntryViewController.m: 13";
+ rLen = 176;
+ rLoc = 261;
+ rType = 0;
+ vrLen = 486;
+ vrLoc = 0;
+ };
+ B52EA654118441EE0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */;
+ name = "DictionaryEntryViewController.m: 43";
+ rLen = 0;
+ rLoc = 1163;
+ rType = 0;
+ vrLen = 639;
+ vrLoc = 651;
+ };
+ B52EA655118441EE0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 76";
+ rLen = 0;
+ rLoc = 2053;
+ rType = 0;
+ vrLen = 600;
+ vrLoc = 1272;
+ };
+ B52EA656118441EE0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 74";
+ rLen = 0;
+ rLoc = 1782;
+ rType = 0;
+ vrLen = 738;
+ vrLoc = 1272;
+ };
+ B52EA65D118442430065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 75";
+ rLen = 0;
+ rLoc = 1892;
+ rType = 0;
+ vrLen = 758;
+ vrLoc = 1272;
+ };
+ B52EA6621184426A0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 63";
+ rLen = 0;
+ rLoc = 1399;
+ rType = 0;
+ vrLen = 579;
+ vrLoc = 946;
+ };
+ B52EA667118442920065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 76";
+ rLen = 0;
+ rLoc = 1977;
+ rType = 0;
+ vrLen = 721;
+ vrLoc = 1415;
+ };
+ B52EA66C118442A00065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 76";
+ rLen = 0;
+ rLoc = 1960;
+ rType = 0;
+ vrLen = 727;
+ vrLoc = 1415;
+ };
+ B52EA671118442E40065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */;
+ name = "ViewAllViewController.h: 13";
+ rLen = 0;
+ rLoc = 267;
+ rType = 0;
+ vrLen = 276;
+ vrLoc = 0;
+ };
+ B52EA672118442E40065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 76";
+ rLen = 0;
+ rLoc = 1960;
+ rType = 0;
+ vrLen = 727;
+ vrLoc = 1415;
+ };
+ B52EA673118442E40065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 15";
+ rLen = 0;
+ rLoc = 307;
+ rType = 0;
+ vrLen = 364;
+ vrLoc = 52;
+ };
+ B52EA67E118443920065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 15";
+ rLen = 0;
+ rLoc = 307;
+ rType = 0;
+ vrLen = 369;
+ vrLoc = 52;
+ };
+ B52EA67F118443920065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */;
+ name = "DictionaryEntryViewController.m: 43";
+ rLen = 0;
+ rLoc = 1163;
+ rType = 0;
+ vrLen = 636;
+ vrLoc = 654;
+ };
+ B52EA680118443920065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */;
+ name = "DictionaryEntryViewController.m: 21";
+ rLen = 0;
+ rLoc = 437;
+ rType = 0;
+ vrLen = 672;
+ vrLoc = 310;
+ };
+ B52EA685118443CA0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */;
+ name = "DictionaryEntryViewController.m: 21";
+ rLen = 0;
+ rLoc = 437;
+ rType = 0;
+ vrLen = 672;
+ vrLoc = 310;
+ };
+ B52EA686118443CA0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */;
+ name = "ViewAllViewController.h: 13";
+ rLen = 0;
+ rLoc = 267;
+ rType = 0;
+ vrLen = 276;
+ vrLoc = 0;
+ };
+ B52EA687118443CA0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 33";
+ rLen = 0;
+ rLoc = 655;
+ rType = 0;
+ vrLen = 388;
+ vrLoc = 385;
+ };
B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {732, 397}}";
+ sepNavIntBoundsRect = "{{0, 0}, {732, 362}}";
sepNavSelRange = "{267, 0}";
sepNavVisRange = "{0, 276}";
};
};
B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {756, 1881}}";
- sepNavSelRange = "{638, 0}";
- sepNavVisRange = "{342, 381}";
+ sepNavIntBoundsRect = "{{0, 0}, {756, 2033}}";
+ sepNavSelRange = "{655, 0}";
+ sepNavVisRange = "{385, 388}";
};
};
B5B25FA911803848001BA9A0 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5BFA841117FA1AA008B450B /* BossViewController.h */;
name = "BossViewController.h: 17";
rLen = 0;
- rLoc = 378;
+ rLoc = 286;
rType = 0;
vrLen = 425;
vrLoc = 0;
};
B5B25FAA11803848001BA9A0 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5BFA81B117F9CAD008B450B /* Person.h */;
name = "Person.h: 23";
rLen = 0;
rLoc = 495;
rType = 0;
vrLen = 535;
vrLoc = 40;
};
B5B25FAB11803848001BA9A0 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */;
name = "ViewAllViewController.h: 13";
rLen = 0;
rLoc = 267;
rType = 0;
vrLen = 276;
vrLoc = 0;
};
B5B25FAC11803848001BA9A0 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
name = "ViewAllViewController.m: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 501;
vrLoc = 343;
};
B5BFA7F6117F9A63008B450B /* NSArchiveExample */ = {
isa = PBXExecutable;
activeArgIndices = (
);
argumentStrings = (
);
autoAttachOnCrash = 1;
breakpointsEnabled = 0;
configStateDict = {
};
customDataFormattersEnabled = 1;
dataTipCustomDataFormattersEnabled = 1;
dataTipShowTypeColumn = 1;
dataTipSortType = 0;
debuggerPlugin = GDBDebugging;
disassemblyDisplayState = 0;
dylibVariantSuffix = "";
enableDebugStr = 1;
environmentEntries = (
);
executableSystemSymbolLevel = 0;
executableUserSymbolLevel = 0;
libgmallocEnabled = 0;
name = NSArchiveExample;
showTypeColumn = 0;
sourceDirectories = (
);
};
B5BFA800117F9A81008B450B /* Source Control */ = {
isa = PBXSourceControlManager;
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
repositoryNamesForRoots = {
"" = "";
};
};
};
B5BFA801117F9A81008B450B /* Code sense */ = {
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
B5BFA802117F9A96008B450B /* Persistance.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
- sepNavSelRange = "{622, 0}";
- sepNavVisRange = "{0, 628}";
+ sepNavIntBoundsRect = "{{0, 0}, {732, 608}}";
+ sepNavSelRange = "{456, 0}";
+ sepNavVisRange = "{21, 438}";
};
};
B5BFA803117F9A96008B450B /* Persistance.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1292, 2375}}";
- sepNavSelRange = "{1403, 20}";
- sepNavVisRange = "{1189, 415}";
+ sepNavIntBoundsRect = "{{0, 0}, {828, 2166}}";
+ sepNavSelRange = "{3347, 0}";
+ sepNavVisRange = "{2767, 614}";
};
};
B5BFA81B117F9CAD008B450B /* Person.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {732, 532}}";
sepNavSelRange = "{495, 0}";
sepNavVisRange = "{40, 535}";
};
};
B5BFA81C117F9CAD008B450B /* Person.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {732, 1102}}";
- sepNavSelRange = "{1064, 0}";
- sepNavVisRange = "{905, 499}";
+ sepNavSelRange = "{1045, 0}";
+ sepNavVisRange = "{888, 515}";
};
};
B5BFA83B117FA0E3008B450B /* Model.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
sepNavSelRange = "{161, 0}";
sepNavVisRange = "{0, 181}";
};
};
B5BFA841117FA1AA008B450B /* BossViewController.h */ = {
+ isa = PBXFileReference;
+ fileEncoding = 4;
+ lastKnownFileType = sourcecode.c.h;
+ name = BossViewController.h;
+ path = /Users/ben/Devel/iPhone/NSArchiveExample/Classes/BossViewController.h;
+ sourceTree = "<absolute>";
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {476, 418}}";
- sepNavSelRange = "{378, 0}";
- sepNavVisRange = "{0, 425}";
+ sepNavIntBoundsRect = "{{0, 0}, {732, 385}}";
+ sepNavSelRange = "{311, 0}";
+ sepNavVisRange = "{0, 335}";
sepNavWindowFrame = "{{38, 157}, {1354, 1235}}";
};
};
B5BFA842117FA1AA008B450B /* BossViewController.m */ = {
+ isa = PBXFileReference;
+ fileEncoding = 4;
+ lastKnownFileType = sourcecode.c.objc;
+ name = BossViewController.m;
+ path = /Users/ben/Devel/iPhone/NSArchiveExample/Classes/BossViewController.m;
+ sourceTree = "<absolute>";
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {732, 836}}";
- sepNavSelRange = "{670, 0}";
- sepNavVisRange = "{201, 558}";
+ sepNavIntBoundsRect = "{{0, 0}, {732, 385}}";
+ sepNavSelRange = "{268, 0}";
+ sepNavVisRange = "{0, 274}";
};
};
}
diff --git a/NSArchiveExample.xcodeproj/ben.mode1v3 b/NSArchiveExample.xcodeproj/ben.mode1v3
index d656e15..fbf2d0c 100644
--- a/NSArchiveExample.xcodeproj/ben.mode1v3
+++ b/NSArchiveExample.xcodeproj/ben.mode1v3
@@ -1,1091 +1,1097 @@
<?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>ActivePerspectiveName</key>
<string>Project</string>
<key>AllowedModules</key>
<array>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Name</key>
<string>Groups and Files Outline View</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Name</key>
<string>Editor</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCTaskListModule</string>
<key>Name</key>
<string>Task List</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCDetailModule</string>
<key>Name</key>
<string>File and Smart Group Detail Viewer</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>1</string>
<key>Module</key>
<string>PBXBuildResultsModule</string>
<key>Name</key>
<string>Detailed Build Results Viewer</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>1</string>
<key>Module</key>
<string>PBXProjectFindModule</string>
<key>Name</key>
<string>Project Batch Find Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCProjectFormatConflictsModule</string>
<key>Name</key>
<string>Project Format Conflicts List</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXBookmarksModule</string>
<key>Name</key>
<string>Bookmarks Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXClassBrowserModule</string>
<key>Name</key>
<string>Class Browser</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXCVSModule</string>
<key>Name</key>
<string>Source Code Control Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXDebugBreakpointsModule</string>
<key>Name</key>
<string>Debug Breakpoints Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCDockableInspector</string>
<key>Name</key>
<string>Inspector</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXOpenQuicklyModule</string>
<key>Name</key>
<string>Open Quickly Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>1</string>
<key>Module</key>
<string>PBXDebugSessionModule</string>
<key>Name</key>
<string>Debugger</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>1</string>
<key>Module</key>
<string>PBXDebugCLIModule</string>
<key>Name</key>
<string>Debug Console</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCSnapshotModule</string>
<key>Name</key>
<string>Snapshots Tool</string>
</dict>
</array>
<key>BundlePath</key>
<string>/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources</string>
<key>Description</key>
<string>DefaultDescriptionKey</string>
<key>DockingSystemVisible</key>
<false/>
<key>Extension</key>
<string>mode1v3</string>
<key>FavBarConfig</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>B5B25F6711802DFC001BA9A0</string>
<key>XCBarModuleItemNames</key>
<dict/>
<key>XCBarModuleItems</key>
<array/>
</dict>
<key>FirstTimeWindowDisplayed</key>
<false/>
<key>Identifier</key>
<string>com.apple.perspectives.project.mode1v3</string>
<key>MajorVersion</key>
<integer>33</integer>
<key>MinorVersion</key>
<integer>0</integer>
<key>Name</key>
<string>Default</string>
<key>Notifications</key>
<array/>
<key>OpenEditors</key>
<array/>
<key>PerspectiveWidths</key>
<array>
<integer>-1</integer>
<integer>-1</integer>
</array>
<key>Perspectives</key>
<array>
<dict>
<key>ChosenToolbarItems</key>
<array>
<string>active-combo-popup</string>
<string>action</string>
<string>NSToolbarFlexibleSpaceItem</string>
<string>debugger-enable-breakpoints</string>
<string>build-and-go</string>
<string>com.apple.ide.PBXToolbarStopButton</string>
<string>get-info</string>
<string>NSToolbarFlexibleSpaceItem</string>
<string>com.apple.pbx.toolbar.searchfield</string>
</array>
<key>ControllerClassBaseName</key>
<string></string>
<key>IconName</key>
<string>WindowOfProjectWithEditor</string>
<key>Identifier</key>
<string>perspective.project</string>
<key>IsVertical</key>
<false/>
<key>Layout</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
<array>
<string>1C37FBAC04509CD000000102</string>
<string>1C37FAAC04509CD000000102</string>
<string>1C37FABC05509CD000000102</string>
<string>1C37FABC05539CD112110102</string>
<string>E2644B35053B69B200211256</string>
<string>1C37FABC04509CD000100104</string>
<string>1CC0EA4004350EF90044410B</string>
<string>1CC0EA4004350EF90041110B</string>
</array>
<key>PBXProjectModuleGUID</key>
<string>1CE0B1FE06471DED0097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Files</string>
<key>PBXProjectStructureProvided</key>
<string>yes</string>
<key>PBXSmartGroupTreeModuleColumnData</key>
<dict>
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array>
<real>270</real>
</array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array>
<string>MainColumn</string>
</array>
</dict>
<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
<dict>
<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
<array>
<string>29B97314FDCFA39411CA2CEA</string>
<string>080E96DDFE201D6D7F000001</string>
<string>B5BFA81E117F9CB4008B450B</string>
+ <string>29B97317FDCFA39411CA2CEA</string>
<string>1C37FABC05509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
<integer>14</integer>
<integer>1</integer>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
<string>{{0, 0}, {270, 597}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
<key>XCIncludePerspectivesSwitch</key>
<true/>
<key>XCSharingToken</key>
<string>com.apple.Xcode.GFSharingToken</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {287, 615}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
<real>270</real>
</array>
<key>RubberWindowFrame</key>
<string>1 122 1085 656 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
<string>287pt</string>
</dict>
<dict>
<key>Dock</key>
<array>
<dict>
<key>BecomeActive</key>
<true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CE0B20306471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>ViewAllViewController.m</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CE0B20406471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>ViewAllViewController.m</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>B52EA5D21182F9CF0065C4CA</string>
+ <string>B52EA687118443CA0065C4CA</string>
<key>history</key>
<array>
- <string>B5B25FA911803848001BA9A0</string>
<string>B5B25FAA11803848001BA9A0</string>
- <string>B5B25FAB11803848001BA9A0</string>
- <string>B528D2E11181860C002D3B1C</string>
- <string>B528D2E21181860C002D3B1C</string>
- <string>B528D2E31181860C002D3B1C</string>
- <string>B52EA5C81182F38B0065C4CA</string>
+ <string>B52EA64E118441EE0065C4CA</string>
+ <string>B52EA64F118441EE0065C4CA</string>
+ <string>B52EA650118441EE0065C4CA</string>
+ <string>B52EA651118441EE0065C4CA</string>
+ <string>B52EA652118441EE0065C4CA</string>
+ <string>B52EA653118441EE0065C4CA</string>
+ <string>B52EA685118443CA0065C4CA</string>
+ <string>B52EA686118443CA0065C4CA</string>
+ <string>B52EA67E118443920065C4CA</string>
</array>
</dict>
<key>SplitCount</key>
<string>1</string>
</dict>
<key>StatusBarVisibility</key>
<true/>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {793, 417}}</string>
<key>RubberWindowFrame</key>
<string>1 122 1085 656 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
<string>417pt</string>
</dict>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CE0B20506471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Detail</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 422}, {793, 193}}</string>
<key>RubberWindowFrame</key>
<string>1 122 1085 656 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
<key>Proportion</key>
<string>193pt</string>
</dict>
</array>
<key>Proportion</key>
<string>793pt</string>
</dict>
</array>
<key>Name</key>
<string>Project</string>
<key>ServiceClasses</key>
<array>
<string>XCModuleDock</string>
<string>PBXSmartGroupTreeModule</string>
<string>XCModuleDock</string>
<string>PBXNavigatorGroup</string>
<string>XCDetailModule</string>
</array>
<key>TableOfContents</key>
<array>
<string>B52EA5CA1182F38B0065C4CA</string>
<string>1CE0B1FE06471DED0097A5F4</string>
<string>B52EA5CB1182F38B0065C4CA</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string>
</array>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.defaultV3</string>
</dict>
<dict>
<key>ControllerClassBaseName</key>
<string></string>
<key>IconName</key>
<string>WindowOfProject</string>
<key>Identifier</key>
<string>perspective.morph</string>
<key>IsVertical</key>
<integer>0</integer>
<key>Layout</key>
<array>
<dict>
<key>BecomeActive</key>
<integer>1</integer>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
<array>
<string>1C37FBAC04509CD000000102</string>
<string>1C37FAAC04509CD000000102</string>
<string>1C08E77C0454961000C914BD</string>
<string>1C37FABC05509CD000000102</string>
<string>1C37FABC05539CD112110102</string>
<string>E2644B35053B69B200211256</string>
<string>1C37FABC04509CD000100104</string>
<string>1CC0EA4004350EF90044410B</string>
<string>1CC0EA4004350EF90041110B</string>
</array>
<key>PBXProjectModuleGUID</key>
<string>11E0B1FE06471DED0097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Files</string>
<key>PBXProjectStructureProvided</key>
<string>yes</string>
<key>PBXSmartGroupTreeModuleColumnData</key>
<dict>
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array>
<real>186</real>
</array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array>
<string>MainColumn</string>
</array>
</dict>
<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
<dict>
<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
<array>
<string>29B97314FDCFA39411CA2CEA</string>
<string>1C37FABC05509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
<string>{{0, 0}, {186, 337}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
<key>XCIncludePerspectivesSwitch</key>
<integer>1</integer>
<key>XCSharingToken</key>
<string>com.apple.Xcode.GFSharingToken</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {203, 355}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
<real>186</real>
</array>
<key>RubberWindowFrame</key>
<string>373 269 690 397 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Name</key>
<string>Morph</string>
<key>PreferredWidth</key>
<integer>300</integer>
<key>ServiceClasses</key>
<array>
<string>XCModuleDock</string>
<string>PBXSmartGroupTreeModule</string>
</array>
<key>TableOfContents</key>
<array>
<string>11E0B1FE06471DED0097A5F4</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.default.shortV3</string>
</dict>
</array>
<key>PerspectivesBarVisible</key>
<false/>
<key>ShelfIsVisible</key>
<false/>
<key>SourceDescription</key>
<string>file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec'</string>
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
<real>0.0</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
<integer>1</integer>
<key>ToolbarIsVisible</key>
<true/>
<key>ToolbarSizeMode</key>
<integer>1</integer>
<key>Type</key>
<string>Perspectives</string>
<key>UpdateMessage</key>
<string>The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'?</string>
<key>WindowJustification</key>
<integer>5</integer>
<key>WindowOrderList</key>
<array>
<string>1C78EAAD065D492600B07095</string>
<string>1CD10A99069EF8BA00B06720</string>
<string>B5B25F6811802DFC001BA9A0</string>
<string>/Users/ben/Devel/iPhone/NSArchiveExample/NSArchiveExample.xcodeproj</string>
</array>
<key>WindowString</key>
<string>1 122 1085 656 0 0 1280 778 </string>
<key>WindowToolsV3</key>
<array>
<dict>
<key>FirstTimeWindowDisplayed</key>
<false/>
<key>Identifier</key>
<string>windowTool.build</string>
<key>IsVertical</key>
<true/>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528F0623707200166675</string>
<key>PBXProjectModuleLabel</key>
<string></string>
<key>StatusBarVisibility</key>
<true/>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {500, 218}}</string>
<key>RubberWindowFrame</key>
<string>267 217 500 500 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
<string>218pt</string>
</dict>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>XCMainBuildResultsModuleGUID</string>
<key>PBXProjectModuleLabel</key>
<string>Build Results</string>
<key>XCBuildResultsTrigger_Collapse</key>
<integer>1021</integer>
<key>XCBuildResultsTrigger_Open</key>
<integer>1011</integer>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 223}, {500, 236}}</string>
<key>RubberWindowFrame</key>
<string>267 217 500 500 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
<key>Proportion</key>
<string>236pt</string>
</dict>
</array>
<key>Proportion</key>
<string>459pt</string>
</dict>
</array>
<key>Name</key>
<string>Build Results</string>
<key>ServiceClasses</key>
<array>
<string>PBXBuildResultsModule</string>
</array>
<key>StatusbarIsVisible</key>
<true/>
<key>TableOfContents</key>
<array>
<string>B5B25F6811802DFC001BA9A0</string>
<string>B52EA5CC1182F38B0065C4CA</string>
<string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.buildV3</string>
<key>WindowContentMinSize</key>
<string>486 300</string>
<key>WindowString</key>
<string>267 217 500 500 0 0 1280 778 </string>
<key>WindowToolGUID</key>
<string>B5B25F6811802DFC001BA9A0</string>
<key>WindowToolIsVisible</key>
<false/>
</dict>
<dict>
<key>FirstTimeWindowDisplayed</key>
<false/>
<key>Identifier</key>
<string>windowTool.debugger</string>
<key>IsVertical</key>
<true/>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>Debugger</key>
<dict>
<key>HorizontalSplitView</key>
<dict>
<key>_collapsingFrameDimension</key>
<real>0.0</real>
<key>_indexOfCollapsedView</key>
<integer>0</integer>
<key>_percentageOfCollapsedView</key>
<real>0.0</real>
<key>isCollapsed</key>
<string>yes</string>
<key>sizes</key>
<array>
<string>{{0, 0}, {316, 194}}</string>
<string>{{316, 0}, {378, 194}}</string>
</array>
</dict>
<key>VerticalSplitView</key>
<dict>
<key>_collapsingFrameDimension</key>
<real>0.0</real>
<key>_indexOfCollapsedView</key>
<integer>0</integer>
<key>_percentageOfCollapsedView</key>
<real>0.0</real>
<key>isCollapsed</key>
<string>yes</string>
<key>sizes</key>
<array>
<string>{{0, 0}, {694, 194}}</string>
<string>{{0, 194}, {694, 187}}</string>
</array>
</dict>
</dict>
<key>LauncherConfigVersion</key>
<string>8</string>
<key>PBXProjectModuleGUID</key>
<string>1C162984064C10D400B95A72</string>
<key>PBXProjectModuleLabel</key>
<string>Debug - GLUTExamples (Underwater)</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>DebugConsoleVisible</key>
<string>None</string>
<key>DebugConsoleWindowFrame</key>
<string>{{200, 200}, {500, 300}}</string>
<key>DebugSTDIOWindowFrame</key>
<string>{{200, 200}, {500, 300}}</string>
<key>Frame</key>
<string>{{0, 0}, {694, 381}}</string>
<key>PBXDebugSessionStackFrameViewKey</key>
<dict>
<key>DebugVariablesTableConfiguration</key>
<array>
<string>Name</string>
<real>120</real>
<string>Value</string>
<real>85</real>
<string>Summary</string>
<real>148</real>
</array>
<key>Frame</key>
<string>{{316, 0}, {378, 194}}</string>
<key>RubberWindowFrame</key>
<string>22 333 694 422 0 0 1280 778 </string>
</dict>
<key>RubberWindowFrame</key>
<string>22 333 694 422 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXDebugSessionModule</string>
<key>Proportion</key>
<string>381pt</string>
</dict>
</array>
<key>Proportion</key>
<string>381pt</string>
</dict>
</array>
<key>Name</key>
<string>Debugger</string>
<key>ServiceClasses</key>
<array>
<string>PBXDebugSessionModule</string>
</array>
<key>StatusbarIsVisible</key>
<true/>
<key>TableOfContents</key>
<array>
<string>1CD10A99069EF8BA00B06720</string>
<string>B52EA5D31182F9CF0065C4CA</string>
<string>1C162984064C10D400B95A72</string>
<string>B52EA5D41182F9CF0065C4CA</string>
<string>B52EA5D51182F9CF0065C4CA</string>
<string>B52EA5D61182F9CF0065C4CA</string>
<string>B52EA5D71182F9CF0065C4CA</string>
<string>B52EA5D81182F9CF0065C4CA</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.debugV3</string>
<key>WindowString</key>
<string>22 333 694 422 0 0 1280 778 </string>
<key>WindowToolGUID</key>
<string>1CD10A99069EF8BA00B06720</string>
<key>WindowToolIsVisible</key>
<false/>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.find</string>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CDD528C0622207200134675</string>
<key>PBXProjectModuleLabel</key>
<string><No Editor></string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528D0623707200166675</string>
</dict>
<key>SplitCount</key>
<string>1</string>
</dict>
<key>StatusBarVisibility</key>
<integer>1</integer>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {781, 167}}</string>
<key>RubberWindowFrame</key>
<string>62 385 781 470 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
<string>781pt</string>
</dict>
</array>
<key>Proportion</key>
<string>50%</string>
</dict>
<dict>
<key>BecomeActive</key>
<integer>1</integer>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528E0623707200166675</string>
<key>PBXProjectModuleLabel</key>
<string>Project Find</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{8, 0}, {773, 254}}</string>
<key>RubberWindowFrame</key>
<string>62 385 781 470 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXProjectFindModule</string>
<key>Proportion</key>
<string>50%</string>
</dict>
</array>
<key>Proportion</key>
<string>428pt</string>
</dict>
</array>
<key>Name</key>
<string>Project Find</string>
<key>ServiceClasses</key>
<array>
<string>PBXProjectFindModule</string>
</array>
<key>StatusbarIsVisible</key>
<integer>1</integer>
<key>TableOfContents</key>
<array>
<string>1C530D57069F1CE1000CFCEE</string>
<string>1C530D58069F1CE1000CFCEE</string>
<string>1C530D59069F1CE1000CFCEE</string>
<string>1CDD528C0622207200134675</string>
<string>1C530D5A069F1CE1000CFCEE</string>
<string>1CE0B1FE06471DED0097A5F4</string>
<string>1CD0528E0623707200166675</string>
</array>
<key>WindowString</key>
<string>62 385 781 470 0 0 1440 878 </string>
<key>WindowToolGUID</key>
<string>1C530D57069F1CE1000CFCEE</string>
<key>WindowToolIsVisible</key>
<integer>0</integer>
</dict>
<dict>
<key>Identifier</key>
<string>MENUSEPARATOR</string>
</dict>
<dict>
<key>FirstTimeWindowDisplayed</key>
<false/>
<key>Identifier</key>
<string>windowTool.debuggerConsole</string>
<key>IsVertical</key>
<true/>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1C78EAAC065D492600B07095</string>
<key>PBXProjectModuleLabel</key>
<string>Debugger Console</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {650, 209}}</string>
<key>RubberWindowFrame</key>
<string>22 505 650 250 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXDebugCLIModule</string>
<key>Proportion</key>
<string>209pt</string>
</dict>
</array>
<key>Proportion</key>
<string>209pt</string>
</dict>
</array>
<key>Name</key>
<string>Debugger Console</string>
<key>ServiceClasses</key>
<array>
<string>PBXDebugCLIModule</string>
</array>
<key>StatusbarIsVisible</key>
<true/>
<key>TableOfContents</key>
<array>
<string>1C78EAAD065D492600B07095</string>
<string>B52EA5D91182F9CF0065C4CA</string>
<string>1C78EAAC065D492600B07095</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.consoleV3</string>
<key>WindowString</key>
<string>22 505 650 250 0 0 1280 778 </string>
<key>WindowToolGUID</key>
<string>1C78EAAD065D492600B07095</string>
<key>WindowToolIsVisible</key>
<false/>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.snapshots</string>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>Module</key>
<string>XCSnapshotModule</string>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Name</key>
<string>Snapshots</string>
<key>ServiceClasses</key>
<array>
<string>XCSnapshotModule</string>
</array>
<key>StatusbarIsVisible</key>
<string>Yes</string>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.snapshots</string>
<key>WindowString</key>
<string>315 824 300 550 0 0 1440 878 </string>
<key>WindowToolIsVisible</key>
<string>Yes</string>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.scm</string>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1C78EAB2065D492600B07095</string>
<key>PBXProjectModuleLabel</key>
<string><No Editor></string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1C78EAB3065D492600B07095</string>
</dict>
<key>SplitCount</key>
<string>1</string>
</dict>
<key>StatusBarVisibility</key>
<integer>1</integer>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {452, 0}}</string>
<key>RubberWindowFrame</key>
<string>743 379 452 308 0 0 1280 1002 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
<string>0pt</string>
</dict>
<dict>
<key>BecomeActive</key>
<integer>1</integer>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD052920623707200166675</string>
<key>PBXProjectModuleLabel</key>
<string>SCM</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>ConsoleFrame</key>
<string>{{0, 259}, {452, 0}}</string>
<key>Frame</key>
<string>{{0, 7}, {452, 259}}</string>
<key>RubberWindowFrame</key>
<string>743 379 452 308 0 0 1280 1002 </string>
<key>TableConfiguration</key>
<array>
<string>Status</string>
<real>30</real>
<string>FileName</string>
<real>199</real>
<string>Path</string>
<real>197.0950012207031</real>
</array>
<key>TableFrame</key>
<string>{{0, 0}, {452, 250}}</string>
</dict>
<key>Module</key>
<string>PBXCVSModule</string>
<key>Proportion</key>
<string>262pt</string>
</dict>
</array>
<key>Proportion</key>
<string>266pt</string>
</dict>
</array>
<key>Name</key>
<string>SCM</string>
<key>ServiceClasses</key>
<array>
<string>PBXCVSModule</string>
</array>
<key>StatusbarIsVisible</key>
<integer>1</integer>
<key>TableOfContents</key>
<array>
<string>1C78EAB4065D492600B07095</string>
<string>1C78EAB5065D492600B07095</string>
<string>1C78EAB2065D492600B07095</string>
<string>1CD052920623707200166675</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.scm</string>
<key>WindowString</key>
<string>743 379 452 308 0 0 1280 1002 </string>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.breakpoints</string>
<key>IsVertical</key>
<integer>0</integer>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>BecomeActive</key>
<integer>1</integer>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
<array>
<string>1C77FABC04509CD000000102</string>
</array>
<key>PBXProjectModuleGUID</key>
<string>1CE0B1FE06471DED0097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Files</string>
<key>PBXProjectStructureProvided</key>
<string>no</string>
<key>PBXSmartGroupTreeModuleColumnData</key>
<dict>
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array>
<real>168</real>
</array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array>
<string>MainColumn</string>
</array>
</dict>
<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
diff --git a/NSArchiveExample.xcodeproj/project.pbxproj b/NSArchiveExample.xcodeproj/project.pbxproj
index 96db396..b6334aa 100755
--- a/NSArchiveExample.xcodeproj/project.pbxproj
+++ b/NSArchiveExample.xcodeproj/project.pbxproj
@@ -1,285 +1,295 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */; };
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
+ B52EA5E51182FC2D0065C4CA /* PersonEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */; };
+ B52EA600118439900065C4CA /* DictionaryEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */; };
+ B52EA601118439900065C4CA /* DictionaryEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */; };
B5B25F7F11803200001BA9A0 /* ViewAllViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */; };
B5B25F8011803200001BA9A0 /* ViewAllView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5B25F7E11803200001BA9A0 /* ViewAllView.xib */; };
B5BFA804117F9A96008B450B /* Persistance.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA803117F9A96008B450B /* Persistance.m */; };
B5BFA81D117F9CAD008B450B /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA81C117F9CAD008B450B /* Person.m */; };
- B5BFA843117FA1AA008B450B /* BossViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA842117FA1AA008B450B /* BossViewController.m */; };
- B5BFA845117FA1B8008B450B /* BossView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5BFA844117FA1B8008B450B /* BossView.xib */; };
+ B5BFA845117FA1B8008B450B /* PersonEntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5BFA844117FA1B8008B450B /* PersonEntryView.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExampleAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSArchiveExampleAppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSArchiveExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NSArchiveExampleViewController.xib; sourceTree = "<group>"; };
28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExample_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "NSArchiveExample-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
+ B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PersonEntryViewController.h; sourceTree = "<group>"; };
+ B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PersonEntryViewController.m; sourceTree = "<group>"; };
+ B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryEntryViewController.h; sourceTree = "<group>"; };
+ B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DictionaryEntryViewController.m; sourceTree = "<group>"; };
+ B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DictionaryEntryView.xib; sourceTree = "<group>"; };
B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewAllViewController.h; sourceTree = "<group>"; };
B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewAllViewController.m; sourceTree = "<group>"; };
B5B25F7E11803200001BA9A0 /* ViewAllView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ViewAllView.xib; sourceTree = "<group>"; };
B5BFA802117F9A96008B450B /* Persistance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Persistance.h; sourceTree = "<group>"; };
B5BFA803117F9A96008B450B /* Persistance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Persistance.m; sourceTree = "<group>"; };
B5BFA81B117F9CAD008B450B /* Person.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Person.h; sourceTree = "<group>"; };
B5BFA81C117F9CAD008B450B /* Person.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Person.m; sourceTree = "<group>"; };
B5BFA83B117FA0E3008B450B /* Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Model.h; sourceTree = "<group>"; };
- B5BFA841117FA1AA008B450B /* BossViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BossViewController.h; sourceTree = "<group>"; };
- B5BFA842117FA1AA008B450B /* BossViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BossViewController.m; sourceTree = "<group>"; };
- B5BFA844117FA1B8008B450B /* BossView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BossView.xib; sourceTree = "<group>"; };
+ B5BFA844117FA1B8008B450B /* PersonEntryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PersonEntryView.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
B5BFA81E117F9CB4008B450B /* Model */,
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */,
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */,
- B5BFA841117FA1AA008B450B /* BossViewController.h */,
- B5BFA842117FA1AA008B450B /* BossViewController.m */,
- B5BFA844117FA1B8008B450B /* BossView.xib */,
+ B52EA5E31182FC2D0065C4CA /* PersonEntryViewController.h */,
+ B52EA5E41182FC2D0065C4CA /* PersonEntryViewController.m */,
+ B5BFA844117FA1B8008B450B /* PersonEntryView.xib */,
B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */,
B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */,
B5B25F7E11803200001BA9A0 /* ViewAllView.xib */,
+ B52EA5FD118439900065C4CA /* DictionaryEntryViewController.h */,
+ B52EA5FE118439900065C4CA /* DictionaryEntryViewController.m */,
+ B52EA5FF118439900065C4CA /* DictionaryEntryView.xib */,
);
path = Classes;
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = CustomTemplate;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */,
28AD733E0D9D9553002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
288765A40DF7441C002DB57D /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
B5BFA81E117F9CB4008B450B /* Model */ = {
isa = PBXGroup;
children = (
B5BFA83B117FA0E3008B450B /* Model.h */,
B5BFA802117F9A96008B450B /* Persistance.h */,
B5BFA803117F9A96008B450B /* Persistance.m */,
B5BFA81B117F9CAD008B450B /* Person.h */,
B5BFA81C117F9CAD008B450B /* Person.m */,
);
name = Model;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */;
buildPhases = (
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = NSArchiveExample;
productName = NSArchiveExample;
productReference = 1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */;
compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
targets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1D60588D0D05DD3D006BFB54 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */,
- B5BFA845117FA1B8008B450B /* BossView.xib in Resources */,
+ B5BFA845117FA1B8008B450B /* PersonEntryView.xib in Resources */,
B5B25F8011803200001BA9A0 /* ViewAllView.xib in Resources */,
+ B52EA601118439900065C4CA /* DictionaryEntryView.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */,
B5BFA804117F9A96008B450B /* Persistance.m in Sources */,
B5BFA81D117F9CAD008B450B /* Person.m in Sources */,
- B5BFA843117FA1AA008B450B /* BossViewController.m in Sources */,
B5B25F7F11803200001BA9A0 /* ViewAllViewController.m in Sources */,
+ B52EA5E51182FC2D0065C4CA /* PersonEntryViewController.m in Sources */,
+ B52EA600118439900065C4CA /* DictionaryEntryViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
PRODUCT_NAME = NSArchiveExample;
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
PRODUCT_NAME = NSArchiveExample;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = iphoneos3.1.3;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = iphoneos3.1.3;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1D6058940D05DD3E006BFB54 /* Debug */,
1D6058950D05DD3E006BFB54 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
|
bentford/NSArchiveExample
|
bec59428eeedfc41e0071bb1d6b86a4e882d3dcb
|
added sections to view all view
|
diff --git a/Classes/ViewAllViewController.m b/Classes/ViewAllViewController.m
index aa15ba7..d0002b1 100644
--- a/Classes/ViewAllViewController.m
+++ b/Classes/ViewAllViewController.m
@@ -1,74 +1,93 @@
//
// ViewAllViewController.m
// NSArchiveExample
//
// Created by Ben Ford on 4/22/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "ViewAllViewController.h"
#import "Model.h"
@implementation ViewAllViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
#pragma mark UITableViewDelegate
#pragma mark -
#pragma mark UITableViewDataSource
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
+ switch (section) {
+ case 0:
+ return @"Boss";
+ break;
+ case 1:
+ return @"Managers";
+ break;
+ case 2:
+ return @"Employees";
+ break;
+ }
+ return @"error";
+}
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+ return 3;
+}
+
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
switch (section) {
case 0:
return 1;
break;
case 1:
return [[Persistance sharedService].managers count];
break;
case 2:
return [[Persistance sharedService].employees count];
break;
default:
return 1;
break;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell;
cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if( cell == nil ) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewStylePlain reuseIdentifier:@"cell"] autorelease];
}
Person *person = nil;
switch (indexPath.section) {
case 0:
cell.textLabel.text = [Persistance sharedService].boss.fullName;
break;
case 1:
person = [[Persistance sharedService].managers objectForKey:@"HeadManager"];
cell.textLabel.text = person.fullName;
break;
case 2:
person = [[Persistance sharedService].employees objectAtIndex:indexPath.row];
cell.textLabel.text = person.fullName;
break;
default:
cell.textLabel.text = @"error";
break;
}
return cell;
}
#pragma mark -
- (void)dealloc {
[super dealloc];
}
@end
diff --git a/NSArchiveExample.xcodeproj/Ben.pbxuser b/NSArchiveExample.xcodeproj/Ben.pbxuser
index 0021d07..d6df7e4 100644
--- a/NSArchiveExample.xcodeproj/Ben.pbxuser
+++ b/NSArchiveExample.xcodeproj/Ben.pbxuser
@@ -1,156 +1,304 @@
// !$*UTF8*$!
{
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 529}";
};
};
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{266, 0}";
sepNavVisRange = "{0, 849}";
};
};
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
activeExec = 0;
executables = (
B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
);
};
29B97313FDCFA39411CA2CEA /* Project object */ = {
activeBuildConfigurationName = Debug;
activeExecutable = B5BFA7F6117F9A63008B450B /* NSArchiveExample */;
activeTarget = 1D6058900D05DD3D006BFB54 /* NSArchiveExample */;
addToTargets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
codeSenseManager = B5BFA801117F9A81008B450B /* Code sense */;
executables = (
B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
);
perUserDictionary = {
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
- 286,
+ 554,
20,
- 48.16259765625,
+ 48,
43,
43,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
PBXFileDataSource_Target_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 293613031;
- PBXWorkspaceStateSaveDate = 293613031;
+ PBXPerProjectTemplateStateSaveDate = 293794679;
+ PBXWorkspaceStateSaveDate = 293794679;
+ };
+ perUserProjectItems = {
+ B528D2E11181860C002D3B1C = B528D2E11181860C002D3B1C /* PBXTextBookmark */;
+ B528D2E21181860C002D3B1C = B528D2E21181860C002D3B1C /* PBXTextBookmark */;
+ B528D2E31181860C002D3B1C = B528D2E31181860C002D3B1C /* PBXTextBookmark */;
+ B528D2E41181860C002D3B1C = B528D2E41181860C002D3B1C /* PBXTextBookmark */;
+ B52EA5C81182F38B0065C4CA /* PBXTextBookmark */ = B52EA5C81182F38B0065C4CA /* PBXTextBookmark */;
+ B52EA5C91182F38B0065C4CA /* PBXTextBookmark */ = B52EA5C91182F38B0065C4CA /* PBXTextBookmark */;
+ B52EA5CD1182F98A0065C4CA /* PBXTextBookmark */ = B52EA5CD1182F98A0065C4CA /* PBXTextBookmark */;
+ B52EA5D21182F9CF0065C4CA /* PBXTextBookmark */ = B52EA5D21182F9CF0065C4CA /* PBXTextBookmark */;
+ B5B25FA911803848001BA9A0 = B5B25FA911803848001BA9A0 /* PBXTextBookmark */;
+ B5B25FAA11803848001BA9A0 = B5B25FAA11803848001BA9A0 /* PBXTextBookmark */;
+ B5B25FAB11803848001BA9A0 = B5B25FAB11803848001BA9A0 /* PBXTextBookmark */;
+ B5B25FAC11803848001BA9A0 = B5B25FAC11803848001BA9A0 /* PBXTextBookmark */;
};
sourceControlManager = B5BFA800117F9A81008B450B /* Source Control */;
userBuildSettings = {
};
};
+ B528D2E11181860C002D3B1C /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5BFA803117F9A96008B450B /* Persistance.m */;
+ name = "Persistance.m: 66";
+ rLen = 20;
+ rLoc = 1403;
+ rType = 0;
+ vrLen = 415;
+ vrLoc = 1189;
+ };
+ B528D2E21181860C002D3B1C /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5BFA81C117F9CAD008B450B /* Person.m */;
+ name = "Person.m: 42";
+ rLen = 0;
+ rLoc = 1064;
+ rType = 0;
+ vrLen = 499;
+ vrLoc = 905;
+ };
+ B528D2E31181860C002D3B1C /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5BFA842117FA1AA008B450B /* BossViewController.m */;
+ name = "BossViewController.m: 31";
+ rLen = 0;
+ rLoc = 670;
+ rType = 0;
+ vrLen = 558;
+ vrLoc = 201;
+ };
+ B528D2E41181860C002D3B1C /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 640;
+ vrLoc = 686;
+ };
+ B52EA5C81182F38B0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 640;
+ vrLoc = 686;
+ };
+ B52EA5C91182F38B0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 640;
+ vrLoc = 686;
+ };
+ B52EA5CD1182F98A0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 23";
+ rLen = 0;
+ rLoc = 640;
+ rType = 0;
+ vrLen = 441;
+ vrLoc = 342;
+ };
+ B52EA5D21182F9CF0065C4CA /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 35";
+ rLen = 0;
+ rLoc = 638;
+ rType = 0;
+ vrLen = 381;
+ vrLoc = 342;
+ };
+ B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {732, 397}}";
+ sepNavSelRange = "{267, 0}";
+ sepNavVisRange = "{0, 276}";
+ };
+ };
+ B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {756, 1881}}";
+ sepNavSelRange = "{638, 0}";
+ sepNavVisRange = "{342, 381}";
+ };
+ };
+ B5B25FA911803848001BA9A0 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5BFA841117FA1AA008B450B /* BossViewController.h */;
+ name = "BossViewController.h: 17";
+ rLen = 0;
+ rLoc = 378;
+ rType = 0;
+ vrLen = 425;
+ vrLoc = 0;
+ };
+ B5B25FAA11803848001BA9A0 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5BFA81B117F9CAD008B450B /* Person.h */;
+ name = "Person.h: 23";
+ rLen = 0;
+ rLoc = 495;
+ rType = 0;
+ vrLen = 535;
+ vrLoc = 40;
+ };
+ B5B25FAB11803848001BA9A0 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */;
+ name = "ViewAllViewController.h: 13";
+ rLen = 0;
+ rLoc = 267;
+ rType = 0;
+ vrLen = 276;
+ vrLoc = 0;
+ };
+ B5B25FAC11803848001BA9A0 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */;
+ name = "ViewAllViewController.m: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 501;
+ vrLoc = 343;
+ };
B5BFA7F6117F9A63008B450B /* NSArchiveExample */ = {
isa = PBXExecutable;
activeArgIndices = (
);
argumentStrings = (
);
autoAttachOnCrash = 1;
breakpointsEnabled = 0;
configStateDict = {
};
customDataFormattersEnabled = 1;
dataTipCustomDataFormattersEnabled = 1;
dataTipShowTypeColumn = 1;
dataTipSortType = 0;
debuggerPlugin = GDBDebugging;
disassemblyDisplayState = 0;
dylibVariantSuffix = "";
enableDebugStr = 1;
environmentEntries = (
);
executableSystemSymbolLevel = 0;
executableUserSymbolLevel = 0;
libgmallocEnabled = 0;
name = NSArchiveExample;
showTypeColumn = 0;
sourceDirectories = (
);
};
B5BFA800117F9A81008B450B /* Source Control */ = {
isa = PBXSourceControlManager;
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
repositoryNamesForRoots = {
"" = "";
};
};
};
B5BFA801117F9A81008B450B /* Code sense */ = {
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
B5BFA802117F9A96008B450B /* Persistance.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{622, 0}";
sepNavVisRange = "{0, 628}";
};
};
B5BFA803117F9A96008B450B /* Persistance.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1450, 2472}}";
- sepNavSelRange = "{2824, 0}";
- sepNavVisRange = "{0, 1153}";
+ sepNavIntBoundsRect = "{{0, 0}, {1292, 2375}}";
+ sepNavSelRange = "{1403, 20}";
+ sepNavVisRange = "{1189, 415}";
};
};
B5BFA81B117F9CAD008B450B /* Person.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {476, 494}}";
- sepNavSelRange = "{511, 0}";
- sepNavVisRange = "{37, 486}";
+ sepNavIntBoundsRect = "{{0, 0}, {732, 532}}";
+ sepNavSelRange = "{495, 0}";
+ sepNavVisRange = "{40, 535}";
};
};
B5BFA81C117F9CAD008B450B /* Person.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {596, 1045}}";
- sepNavSelRange = "{1187, 0}";
- sepNavVisRange = "{233, 575}";
+ sepNavIntBoundsRect = "{{0, 0}, {732, 1102}}";
+ sepNavSelRange = "{1064, 0}";
+ sepNavVisRange = "{905, 499}";
};
};
B5BFA83B117FA0E3008B450B /* Model.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
sepNavSelRange = "{161, 0}";
sepNavVisRange = "{0, 181}";
};
};
B5BFA841117FA1AA008B450B /* BossViewController.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {476, 418}}";
sepNavSelRange = "{378, 0}";
sepNavVisRange = "{0, 425}";
sepNavWindowFrame = "{{38, 157}, {1354, 1235}}";
};
};
B5BFA842117FA1AA008B450B /* BossViewController.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {732, 836}}";
- sepNavSelRange = "{1126, 0}";
- sepNavVisRange = "{237, 606}";
+ sepNavSelRange = "{670, 0}";
+ sepNavVisRange = "{201, 558}";
};
};
}
diff --git a/NSArchiveExample.xcodeproj/ben.mode1v3 b/NSArchiveExample.xcodeproj/ben.mode1v3
index 0fdf2f6..d656e15 100644
--- a/NSArchiveExample.xcodeproj/ben.mode1v3
+++ b/NSArchiveExample.xcodeproj/ben.mode1v3
@@ -1,1400 +1,1401 @@
<?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>ActivePerspectiveName</key>
<string>Project</string>
<key>AllowedModules</key>
<array>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Name</key>
<string>Groups and Files Outline View</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Name</key>
<string>Editor</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCTaskListModule</string>
<key>Name</key>
<string>Task List</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCDetailModule</string>
<key>Name</key>
<string>File and Smart Group Detail Viewer</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>1</string>
<key>Module</key>
<string>PBXBuildResultsModule</string>
<key>Name</key>
<string>Detailed Build Results Viewer</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>1</string>
<key>Module</key>
<string>PBXProjectFindModule</string>
<key>Name</key>
<string>Project Batch Find Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCProjectFormatConflictsModule</string>
<key>Name</key>
<string>Project Format Conflicts List</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXBookmarksModule</string>
<key>Name</key>
<string>Bookmarks Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXClassBrowserModule</string>
<key>Name</key>
<string>Class Browser</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXCVSModule</string>
<key>Name</key>
<string>Source Code Control Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXDebugBreakpointsModule</string>
<key>Name</key>
<string>Debug Breakpoints Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCDockableInspector</string>
<key>Name</key>
<string>Inspector</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>PBXOpenQuicklyModule</string>
<key>Name</key>
<string>Open Quickly Tool</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>1</string>
<key>Module</key>
<string>PBXDebugSessionModule</string>
<key>Name</key>
<string>Debugger</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>1</string>
<key>Module</key>
<string>PBXDebugCLIModule</string>
<key>Name</key>
<string>Debug Console</string>
</dict>
<dict>
<key>BundleLoadPath</key>
<string></string>
<key>MaxInstances</key>
<string>n</string>
<key>Module</key>
<string>XCSnapshotModule</string>
<key>Name</key>
<string>Snapshots Tool</string>
</dict>
</array>
<key>BundlePath</key>
<string>/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources</string>
<key>Description</key>
<string>DefaultDescriptionKey</string>
<key>DockingSystemVisible</key>
<false/>
<key>Extension</key>
<string>mode1v3</string>
<key>FavBarConfig</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>B5B25F6711802DFC001BA9A0</string>
<key>XCBarModuleItemNames</key>
<dict/>
<key>XCBarModuleItems</key>
<array/>
</dict>
<key>FirstTimeWindowDisplayed</key>
<false/>
<key>Identifier</key>
<string>com.apple.perspectives.project.mode1v3</string>
<key>MajorVersion</key>
<integer>33</integer>
<key>MinorVersion</key>
<integer>0</integer>
<key>Name</key>
<string>Default</string>
<key>Notifications</key>
<array/>
<key>OpenEditors</key>
<array/>
<key>PerspectiveWidths</key>
<array>
<integer>-1</integer>
<integer>-1</integer>
</array>
<key>Perspectives</key>
<array>
<dict>
<key>ChosenToolbarItems</key>
<array>
<string>active-combo-popup</string>
<string>action</string>
<string>NSToolbarFlexibleSpaceItem</string>
<string>debugger-enable-breakpoints</string>
<string>build-and-go</string>
<string>com.apple.ide.PBXToolbarStopButton</string>
<string>get-info</string>
<string>NSToolbarFlexibleSpaceItem</string>
<string>com.apple.pbx.toolbar.searchfield</string>
</array>
<key>ControllerClassBaseName</key>
<string></string>
<key>IconName</key>
<string>WindowOfProjectWithEditor</string>
<key>Identifier</key>
<string>perspective.project</string>
<key>IsVertical</key>
<false/>
<key>Layout</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
<array>
<string>1C37FBAC04509CD000000102</string>
<string>1C37FAAC04509CD000000102</string>
<string>1C37FABC05509CD000000102</string>
<string>1C37FABC05539CD112110102</string>
<string>E2644B35053B69B200211256</string>
<string>1C37FABC04509CD000100104</string>
<string>1CC0EA4004350EF90044410B</string>
<string>1CC0EA4004350EF90041110B</string>
</array>
<key>PBXProjectModuleGUID</key>
<string>1CE0B1FE06471DED0097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Files</string>
<key>PBXProjectStructureProvided</key>
<string>yes</string>
<key>PBXSmartGroupTreeModuleColumnData</key>
<dict>
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array>
<real>270</real>
</array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array>
<string>MainColumn</string>
</array>
</dict>
<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
<dict>
<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
<array>
<string>29B97314FDCFA39411CA2CEA</string>
<string>080E96DDFE201D6D7F000001</string>
<string>B5BFA81E117F9CB4008B450B</string>
<string>1C37FABC05509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>7</integer>
- <integer>2</integer>
+ <integer>14</integer>
<integer>1</integer>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
<string>{{0, 0}, {270, 597}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
<key>XCIncludePerspectivesSwitch</key>
<true/>
<key>XCSharingToken</key>
<string>com.apple.Xcode.GFSharingToken</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {287, 615}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
<real>270</real>
</array>
<key>RubberWindowFrame</key>
<string>1 122 1085 656 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
<string>287pt</string>
</dict>
<dict>
<key>Dock</key>
<array>
<dict>
<key>BecomeActive</key>
<true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CE0B20306471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
- <string>Person.m</string>
+ <string>ViewAllViewController.m</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CE0B20406471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
- <string>Person.m</string>
+ <string>ViewAllViewController.m</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>B528D2DD11815D1F002D3B1C</string>
+ <string>B52EA5D21182F9CF0065C4CA</string>
<key>history</key>
<array>
<string>B5B25FA911803848001BA9A0</string>
<string>B5B25FAA11803848001BA9A0</string>
<string>B5B25FAB11803848001BA9A0</string>
- <string>B5B25FAC11803848001BA9A0</string>
- <string>B5B25FAD11803848001BA9A0</string>
- <string>B5B25FAE11803848001BA9A0</string>
- <string>B5B25FB011803848001BA9A0</string>
+ <string>B528D2E11181860C002D3B1C</string>
+ <string>B528D2E21181860C002D3B1C</string>
+ <string>B528D2E31181860C002D3B1C</string>
+ <string>B52EA5C81182F38B0065C4CA</string>
</array>
</dict>
<key>SplitCount</key>
<string>1</string>
</dict>
<key>StatusBarVisibility</key>
<true/>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {793, 423}}</string>
+ <string>{{0, 0}, {793, 417}}</string>
<key>RubberWindowFrame</key>
<string>1 122 1085 656 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>423pt</string>
+ <string>417pt</string>
</dict>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CE0B20506471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Detail</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 428}, {793, 187}}</string>
+ <string>{{0, 422}, {793, 193}}</string>
<key>RubberWindowFrame</key>
<string>1 122 1085 656 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
<key>Proportion</key>
- <string>187pt</string>
+ <string>193pt</string>
</dict>
</array>
<key>Proportion</key>
<string>793pt</string>
</dict>
</array>
<key>Name</key>
<string>Project</string>
<key>ServiceClasses</key>
<array>
<string>XCModuleDock</string>
<string>PBXSmartGroupTreeModule</string>
<string>XCModuleDock</string>
<string>PBXNavigatorGroup</string>
<string>XCDetailModule</string>
</array>
<key>TableOfContents</key>
<array>
- <string>B528D2DE11815D1F002D3B1C</string>
+ <string>B52EA5CA1182F38B0065C4CA</string>
<string>1CE0B1FE06471DED0097A5F4</string>
- <string>B528D2DF11815D1F002D3B1C</string>
+ <string>B52EA5CB1182F38B0065C4CA</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string>
</array>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.defaultV3</string>
</dict>
<dict>
<key>ControllerClassBaseName</key>
<string></string>
<key>IconName</key>
<string>WindowOfProject</string>
<key>Identifier</key>
<string>perspective.morph</string>
<key>IsVertical</key>
<integer>0</integer>
<key>Layout</key>
<array>
<dict>
<key>BecomeActive</key>
<integer>1</integer>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
<array>
<string>1C37FBAC04509CD000000102</string>
<string>1C37FAAC04509CD000000102</string>
<string>1C08E77C0454961000C914BD</string>
<string>1C37FABC05509CD000000102</string>
<string>1C37FABC05539CD112110102</string>
<string>E2644B35053B69B200211256</string>
<string>1C37FABC04509CD000100104</string>
<string>1CC0EA4004350EF90044410B</string>
<string>1CC0EA4004350EF90041110B</string>
</array>
<key>PBXProjectModuleGUID</key>
<string>11E0B1FE06471DED0097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Files</string>
<key>PBXProjectStructureProvided</key>
<string>yes</string>
<key>PBXSmartGroupTreeModuleColumnData</key>
<dict>
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array>
<real>186</real>
</array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array>
<string>MainColumn</string>
</array>
</dict>
<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
<dict>
<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
<array>
<string>29B97314FDCFA39411CA2CEA</string>
<string>1C37FABC05509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
<string>{{0, 0}, {186, 337}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
<key>XCIncludePerspectivesSwitch</key>
<integer>1</integer>
<key>XCSharingToken</key>
<string>com.apple.Xcode.GFSharingToken</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {203, 355}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
<real>186</real>
</array>
<key>RubberWindowFrame</key>
<string>373 269 690 397 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Name</key>
<string>Morph</string>
<key>PreferredWidth</key>
<integer>300</integer>
<key>ServiceClasses</key>
<array>
<string>XCModuleDock</string>
<string>PBXSmartGroupTreeModule</string>
</array>
<key>TableOfContents</key>
<array>
<string>11E0B1FE06471DED0097A5F4</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.default.shortV3</string>
</dict>
</array>
<key>PerspectivesBarVisible</key>
<false/>
<key>ShelfIsVisible</key>
<false/>
<key>SourceDescription</key>
<string>file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec'</string>
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
<real>0.0</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
<integer>1</integer>
<key>ToolbarIsVisible</key>
<true/>
<key>ToolbarSizeMode</key>
<integer>1</integer>
<key>Type</key>
<string>Perspectives</string>
<key>UpdateMessage</key>
<string>The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'?</string>
<key>WindowJustification</key>
<integer>5</integer>
<key>WindowOrderList</key>
<array>
+ <string>1C78EAAD065D492600B07095</string>
+ <string>1CD10A99069EF8BA00B06720</string>
<string>B5B25F6811802DFC001BA9A0</string>
<string>/Users/ben/Devel/iPhone/NSArchiveExample/NSArchiveExample.xcodeproj</string>
</array>
<key>WindowString</key>
<string>1 122 1085 656 0 0 1280 778 </string>
<key>WindowToolsV3</key>
<array>
<dict>
<key>FirstTimeWindowDisplayed</key>
<false/>
<key>Identifier</key>
<string>windowTool.build</string>
<key>IsVertical</key>
<true/>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528F0623707200166675</string>
<key>PBXProjectModuleLabel</key>
<string></string>
<key>StatusBarVisibility</key>
<true/>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {500, 218}}</string>
<key>RubberWindowFrame</key>
<string>267 217 500 500 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
<string>218pt</string>
</dict>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>XCMainBuildResultsModuleGUID</string>
<key>PBXProjectModuleLabel</key>
<string>Build Results</string>
<key>XCBuildResultsTrigger_Collapse</key>
<integer>1021</integer>
<key>XCBuildResultsTrigger_Open</key>
<integer>1011</integer>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 223}, {500, 236}}</string>
<key>RubberWindowFrame</key>
<string>267 217 500 500 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
<key>Proportion</key>
<string>236pt</string>
</dict>
</array>
<key>Proportion</key>
<string>459pt</string>
</dict>
</array>
<key>Name</key>
<string>Build Results</string>
<key>ServiceClasses</key>
<array>
<string>PBXBuildResultsModule</string>
</array>
<key>StatusbarIsVisible</key>
<true/>
<key>TableOfContents</key>
<array>
<string>B5B25F6811802DFC001BA9A0</string>
- <string>B528D2E011815D1F002D3B1C</string>
+ <string>B52EA5CC1182F38B0065C4CA</string>
<string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.buildV3</string>
<key>WindowContentMinSize</key>
<string>486 300</string>
<key>WindowString</key>
<string>267 217 500 500 0 0 1280 778 </string>
<key>WindowToolGUID</key>
<string>B5B25F6811802DFC001BA9A0</string>
<key>WindowToolIsVisible</key>
<false/>
</dict>
<dict>
<key>FirstTimeWindowDisplayed</key>
<false/>
<key>Identifier</key>
<string>windowTool.debugger</string>
<key>IsVertical</key>
<true/>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>Debugger</key>
<dict>
<key>HorizontalSplitView</key>
<dict>
<key>_collapsingFrameDimension</key>
<real>0.0</real>
<key>_indexOfCollapsedView</key>
<integer>0</integer>
<key>_percentageOfCollapsedView</key>
<real>0.0</real>
<key>isCollapsed</key>
<string>yes</string>
<key>sizes</key>
<array>
- <string>{{0, 0}, {316, 185}}</string>
- <string>{{316, 0}, {378, 185}}</string>
+ <string>{{0, 0}, {316, 194}}</string>
+ <string>{{316, 0}, {378, 194}}</string>
</array>
</dict>
<key>VerticalSplitView</key>
<dict>
<key>_collapsingFrameDimension</key>
<real>0.0</real>
<key>_indexOfCollapsedView</key>
<integer>0</integer>
<key>_percentageOfCollapsedView</key>
<real>0.0</real>
<key>isCollapsed</key>
<string>yes</string>
<key>sizes</key>
<array>
- <string>{{0, 0}, {694, 185}}</string>
- <string>{{0, 185}, {694, 196}}</string>
+ <string>{{0, 0}, {694, 194}}</string>
+ <string>{{0, 194}, {694, 187}}</string>
</array>
</dict>
</dict>
<key>LauncherConfigVersion</key>
<string>8</string>
<key>PBXProjectModuleGUID</key>
<string>1C162984064C10D400B95A72</string>
<key>PBXProjectModuleLabel</key>
<string>Debug - GLUTExamples (Underwater)</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>DebugConsoleVisible</key>
<string>None</string>
<key>DebugConsoleWindowFrame</key>
<string>{{200, 200}, {500, 300}}</string>
<key>DebugSTDIOWindowFrame</key>
<string>{{200, 200}, {500, 300}}</string>
<key>Frame</key>
<string>{{0, 0}, {694, 381}}</string>
<key>PBXDebugSessionStackFrameViewKey</key>
<dict>
<key>DebugVariablesTableConfiguration</key>
<array>
<string>Name</string>
<real>120</real>
<string>Value</string>
<real>85</real>
<string>Summary</string>
<real>148</real>
</array>
<key>Frame</key>
- <string>{{316, 0}, {378, 185}}</string>
+ <string>{{316, 0}, {378, 194}}</string>
<key>RubberWindowFrame</key>
<string>22 333 694 422 0 0 1280 778 </string>
</dict>
<key>RubberWindowFrame</key>
<string>22 333 694 422 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXDebugSessionModule</string>
<key>Proportion</key>
<string>381pt</string>
</dict>
</array>
<key>Proportion</key>
<string>381pt</string>
</dict>
</array>
<key>Name</key>
<string>Debugger</string>
<key>ServiceClasses</key>
<array>
<string>PBXDebugSessionModule</string>
</array>
<key>StatusbarIsVisible</key>
<true/>
<key>TableOfContents</key>
<array>
<string>1CD10A99069EF8BA00B06720</string>
- <string>B5B25FB111803848001BA9A0</string>
+ <string>B52EA5D31182F9CF0065C4CA</string>
<string>1C162984064C10D400B95A72</string>
- <string>B5B25FB211803848001BA9A0</string>
- <string>B5B25FB311803848001BA9A0</string>
- <string>B5B25FB411803848001BA9A0</string>
- <string>B5B25FB511803848001BA9A0</string>
- <string>B5B25FB611803848001BA9A0</string>
+ <string>B52EA5D41182F9CF0065C4CA</string>
+ <string>B52EA5D51182F9CF0065C4CA</string>
+ <string>B52EA5D61182F9CF0065C4CA</string>
+ <string>B52EA5D71182F9CF0065C4CA</string>
+ <string>B52EA5D81182F9CF0065C4CA</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.debugV3</string>
<key>WindowString</key>
<string>22 333 694 422 0 0 1280 778 </string>
<key>WindowToolGUID</key>
<string>1CD10A99069EF8BA00B06720</string>
<key>WindowToolIsVisible</key>
<false/>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.find</string>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CDD528C0622207200134675</string>
<key>PBXProjectModuleLabel</key>
<string><No Editor></string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528D0623707200166675</string>
</dict>
<key>SplitCount</key>
<string>1</string>
</dict>
<key>StatusBarVisibility</key>
<integer>1</integer>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {781, 167}}</string>
<key>RubberWindowFrame</key>
<string>62 385 781 470 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
<string>781pt</string>
</dict>
</array>
<key>Proportion</key>
<string>50%</string>
</dict>
<dict>
<key>BecomeActive</key>
<integer>1</integer>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528E0623707200166675</string>
<key>PBXProjectModuleLabel</key>
<string>Project Find</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{8, 0}, {773, 254}}</string>
<key>RubberWindowFrame</key>
<string>62 385 781 470 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXProjectFindModule</string>
<key>Proportion</key>
<string>50%</string>
</dict>
</array>
<key>Proportion</key>
<string>428pt</string>
</dict>
</array>
<key>Name</key>
<string>Project Find</string>
<key>ServiceClasses</key>
<array>
<string>PBXProjectFindModule</string>
</array>
<key>StatusbarIsVisible</key>
<integer>1</integer>
<key>TableOfContents</key>
<array>
<string>1C530D57069F1CE1000CFCEE</string>
<string>1C530D58069F1CE1000CFCEE</string>
<string>1C530D59069F1CE1000CFCEE</string>
<string>1CDD528C0622207200134675</string>
<string>1C530D5A069F1CE1000CFCEE</string>
<string>1CE0B1FE06471DED0097A5F4</string>
<string>1CD0528E0623707200166675</string>
</array>
<key>WindowString</key>
<string>62 385 781 470 0 0 1440 878 </string>
<key>WindowToolGUID</key>
<string>1C530D57069F1CE1000CFCEE</string>
<key>WindowToolIsVisible</key>
<integer>0</integer>
</dict>
<dict>
<key>Identifier</key>
<string>MENUSEPARATOR</string>
</dict>
<dict>
<key>FirstTimeWindowDisplayed</key>
<false/>
<key>Identifier</key>
<string>windowTool.debuggerConsole</string>
<key>IsVertical</key>
<true/>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1C78EAAC065D492600B07095</string>
<key>PBXProjectModuleLabel</key>
<string>Debugger Console</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {650, 209}}</string>
<key>RubberWindowFrame</key>
<string>22 505 650 250 0 0 1280 778 </string>
</dict>
<key>Module</key>
<string>PBXDebugCLIModule</string>
<key>Proportion</key>
<string>209pt</string>
</dict>
</array>
<key>Proportion</key>
<string>209pt</string>
</dict>
</array>
<key>Name</key>
<string>Debugger Console</string>
<key>ServiceClasses</key>
<array>
<string>PBXDebugCLIModule</string>
</array>
<key>StatusbarIsVisible</key>
<true/>
<key>TableOfContents</key>
<array>
<string>1C78EAAD065D492600B07095</string>
- <string>B5B25FB711803848001BA9A0</string>
+ <string>B52EA5D91182F9CF0065C4CA</string>
<string>1C78EAAC065D492600B07095</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.consoleV3</string>
<key>WindowString</key>
<string>22 505 650 250 0 0 1280 778 </string>
<key>WindowToolGUID</key>
<string>1C78EAAD065D492600B07095</string>
<key>WindowToolIsVisible</key>
<false/>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.snapshots</string>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>Module</key>
<string>XCSnapshotModule</string>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Name</key>
<string>Snapshots</string>
<key>ServiceClasses</key>
<array>
<string>XCSnapshotModule</string>
</array>
<key>StatusbarIsVisible</key>
<string>Yes</string>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.snapshots</string>
<key>WindowString</key>
<string>315 824 300 550 0 0 1440 878 </string>
<key>WindowToolIsVisible</key>
<string>Yes</string>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.scm</string>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1C78EAB2065D492600B07095</string>
<key>PBXProjectModuleLabel</key>
<string><No Editor></string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1C78EAB3065D492600B07095</string>
</dict>
<key>SplitCount</key>
<string>1</string>
</dict>
<key>StatusBarVisibility</key>
<integer>1</integer>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {452, 0}}</string>
<key>RubberWindowFrame</key>
<string>743 379 452 308 0 0 1280 1002 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
<string>0pt</string>
</dict>
<dict>
<key>BecomeActive</key>
<integer>1</integer>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD052920623707200166675</string>
<key>PBXProjectModuleLabel</key>
<string>SCM</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>ConsoleFrame</key>
<string>{{0, 259}, {452, 0}}</string>
<key>Frame</key>
<string>{{0, 7}, {452, 259}}</string>
<key>RubberWindowFrame</key>
<string>743 379 452 308 0 0 1280 1002 </string>
<key>TableConfiguration</key>
<array>
<string>Status</string>
<real>30</real>
<string>FileName</string>
<real>199</real>
<string>Path</string>
<real>197.0950012207031</real>
</array>
<key>TableFrame</key>
<string>{{0, 0}, {452, 250}}</string>
</dict>
<key>Module</key>
<string>PBXCVSModule</string>
<key>Proportion</key>
<string>262pt</string>
</dict>
</array>
<key>Proportion</key>
<string>266pt</string>
</dict>
</array>
<key>Name</key>
<string>SCM</string>
<key>ServiceClasses</key>
<array>
<string>PBXCVSModule</string>
</array>
<key>StatusbarIsVisible</key>
<integer>1</integer>
<key>TableOfContents</key>
<array>
<string>1C78EAB4065D492600B07095</string>
<string>1C78EAB5065D492600B07095</string>
<string>1C78EAB2065D492600B07095</string>
<string>1CD052920623707200166675</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.scm</string>
<key>WindowString</key>
<string>743 379 452 308 0 0 1280 1002 </string>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.breakpoints</string>
<key>IsVertical</key>
<integer>0</integer>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>BecomeActive</key>
<integer>1</integer>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
<array>
<string>1C77FABC04509CD000000102</string>
</array>
<key>PBXProjectModuleGUID</key>
<string>1CE0B1FE06471DED0097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Files</string>
<key>PBXProjectStructureProvided</key>
<string>no</string>
<key>PBXSmartGroupTreeModuleColumnData</key>
<dict>
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array>
<real>168</real>
</array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array>
<string>MainColumn</string>
</array>
</dict>
<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
<dict>
<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
<array>
<string>1C77FABC04509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
<string>{{0, 0}, {168, 350}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
<key>XCIncludePerspectivesSwitch</key>
<integer>0</integer>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {185, 368}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
<real>168</real>
</array>
<key>RubberWindowFrame</key>
<string>315 424 744 409 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
<string>185pt</string>
</dict>
<dict>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CA1AED706398EBD00589147</string>
<key>PBXProjectModuleLabel</key>
<string>Detail</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{190, 0}, {554, 368}}</string>
<key>RubberWindowFrame</key>
<string>315 424 744 409 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
<key>Proportion</key>
<string>554pt</string>
</dict>
</array>
<key>Proportion</key>
<string>368pt</string>
</dict>
</array>
<key>MajorVersion</key>
<integer>3</integer>
<key>MinorVersion</key>
<integer>0</integer>
<key>Name</key>
<string>Breakpoints</string>
<key>ServiceClasses</key>
<array>
<string>PBXSmartGroupTreeModule</string>
<string>XCDetailModule</string>
</array>
<key>StatusbarIsVisible</key>
<integer>1</integer>
<key>TableOfContents</key>
<array>
<string>1CDDB66807F98D9800BB5817</string>
<string>1CDDB66907F98D9800BB5817</string>
<string>1CE0B1FE06471DED0097A5F4</string>
<string>1CA1AED706398EBD00589147</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.breakpointsV3</string>
<key>WindowString</key>
<string>315 424 744 409 0 0 1440 878 </string>
<key>WindowToolGUID</key>
<string>1CDDB66807F98D9800BB5817</string>
<key>WindowToolIsVisible</key>
<integer>1</integer>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.debugAnimator</string>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Name</key>
<string>Debug Visualizer</string>
<key>ServiceClasses</key>
<array>
<string>PBXNavigatorGroup</string>
</array>
<key>StatusbarIsVisible</key>
<integer>1</integer>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.debugAnimatorV3</string>
<key>WindowString</key>
<string>100 100 700 500 0 0 1280 1002 </string>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.bookmarks</string>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>Module</key>
<string>PBXBookmarksModule</string>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Name</key>
<string>Bookmarks</string>
<key>ServiceClasses</key>
<array>
<string>PBXBookmarksModule</string>
</array>
<key>StatusbarIsVisible</key>
<integer>0</integer>
<key>WindowString</key>
<string>538 42 401 187 0 0 1280 1002 </string>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.projectFormatConflicts</string>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>Module</key>
<string>XCProjectFormatConflictsModule</string>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Name</key>
<string>Project Format Conflicts</string>
<key>ServiceClasses</key>
<array>
<string>XCProjectFormatConflictsModule</string>
</array>
<key>StatusbarIsVisible</key>
<integer>0</integer>
<key>WindowContentMinSize</key>
<string>450 300</string>
<key>WindowString</key>
<string>50 850 472 307 0 0 1440 877</string>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.classBrowser</string>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>BecomeActive</key>
<integer>1</integer>
<key>ContentConfiguration</key>
<dict>
<key>OptionsSetName</key>
<string>Hierarchy, all classes</string>
<key>PBXProjectModuleGUID</key>
<string>1CA6456E063B45B4001379D8</string>
<key>PBXProjectModuleLabel</key>
<string>Class Browser - NSObject</string>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>ClassesFrame</key>
<string>{{0, 0}, {374, 96}}</string>
<key>ClassesTreeTableConfiguration</key>
<array>
<string>PBXClassNameColumnIdentifier</string>
<real>208</real>
<string>PBXClassBookColumnIdentifier</string>
<real>22</real>
</array>
<key>Frame</key>
<string>{{0, 0}, {630, 331}}</string>
<key>MembersFrame</key>
<string>{{0, 105}, {374, 395}}</string>
<key>MembersTreeTableConfiguration</key>
<array>
<string>PBXMemberTypeIconColumnIdentifier</string>
<real>22</real>
<string>PBXMemberNameColumnIdentifier</string>
<real>216</real>
<string>PBXMemberTypeColumnIdentifier</string>
<real>97</real>
<string>PBXMemberBookColumnIdentifier</string>
<real>22</real>
</array>
<key>PBXModuleWindowStatusBarHidden2</key>
<integer>1</integer>
<key>RubberWindowFrame</key>
<string>385 179 630 352 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXClassBrowserModule</string>
<key>Proportion</key>
<string>332pt</string>
</dict>
</array>
<key>Proportion</key>
<string>332pt</string>
</dict>
</array>
<key>Name</key>
<string>Class Browser</string>
<key>ServiceClasses</key>
<array>
<string>PBXClassBrowserModule</string>
</array>
<key>StatusbarIsVisible</key>
<integer>0</integer>
<key>TableOfContents</key>
<array>
<string>1C0AD2AF069F1E9B00FABCE6</string>
<string>1C0AD2B0069F1E9B00FABCE6</string>
<string>1CA6456E063B45B4001379D8</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.classbrowser</string>
<key>WindowString</key>
<string>385 179 630 352 0 0 1440 878 </string>
<key>WindowToolGUID</key>
<string>1C0AD2AF069F1E9B00FABCE6</string>
<key>WindowToolIsVisible</key>
<integer>0</integer>
</dict>
<dict>
<key>Identifier</key>
<string>windowTool.refactoring</string>
<key>IncludeInToolsMenu</key>
<integer>0</integer>
<key>Layout</key>
<array>
<dict>
<key>Dock</key>
<array>
<dict>
<key>BecomeActive</key>
<integer>1</integer>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{0, 0}, {500, 335}</string>
<key>RubberWindowFrame</key>
<string>{0, 0}, {500, 335}</string>
</dict>
<key>Module</key>
<string>XCRefactoringModule</string>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Proportion</key>
<string>100%</string>
</dict>
</array>
<key>Name</key>
<string>Refactoring</string>
<key>ServiceClasses</key>
<array>
<string>XCRefactoringModule</string>
</array>
<key>WindowString</key>
<string>200 200 500 356 0 0 1920 1200 </string>
</dict>
</array>
</dict>
</plist>
|
bentford/NSArchiveExample
|
0c156aac2bc879edc6be92330492374de09fd378
|
Fixed bug where last name was not being saved.
|
diff --git a/Classes/Person.m b/Classes/Person.m
index ba6091c..7634429 100644
--- a/Classes/Person.m
+++ b/Classes/Person.m
@@ -1,57 +1,57 @@
//
// Person.m
// NSArchiveExample
//
// Created by Ben Ford on 4/21/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "Person.h"
@implementation Person
@synthesize firstName, lastName, age, isFullTime;
+ (Person *)defaultPerson {
return [[[Person alloc] init] autorelease];
}
- (id)init {
if( self = [super init] ) {
self.firstName = [NSString string];
self.lastName = [NSString string];
self.age = 0;
self.isFullTime = YES;
}
return self;
}
#pragma mark NSCoding
- (id)initWithCoder:(NSCoder *)coder {
self = [super init];
if( self ) {
self.firstName = [coder decodeObjectForKey:@"firstName"];
self.lastName = [coder decodeObjectForKey:@"lastName"];
self.age = [coder decodeIntForKey:@"age"];
self.isFullTime = [coder decodeBoolForKey:@"isFullTime"];
}
return self;
}
- (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeObject:self.firstName forKey:@"firstName"];
- [coder encodeObject:self.firstName forKey:@"lastName"];
+ [coder encodeObject:self.lastName forKey:@"lastName"];
[coder encodeInt:self.age forKey:@"age"];
[coder encodeBool:self.isFullTime forKey:@"isFullTime"];
}
#pragma mark -
- (NSString *)fullName {
return [NSString stringWithFormat:@"%@ %@", self.firstName, self.lastName];
}
- (void)dealloc {
self.firstName = nil;
self.lastName = nil;
[super dealloc];
}
@end
diff --git a/NSArchiveExample.xcodeproj/ben.mode1v3 b/NSArchiveExample.xcodeproj/ben.mode1v3
new file mode 100644
index 0000000..0fdf2f6
--- /dev/null
+++ b/NSArchiveExample.xcodeproj/ben.mode1v3
@@ -0,0 +1,1400 @@
+<?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>ActivePerspectiveName</key>
+ <string>Project</string>
+ <key>AllowedModules</key>
+ <array>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXSmartGroupTreeModule</string>
+ <key>Name</key>
+ <string>Groups and Files Outline View</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Name</key>
+ <string>Editor</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCTaskListModule</string>
+ <key>Name</key>
+ <string>Task List</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCDetailModule</string>
+ <key>Name</key>
+ <string>File and Smart Group Detail Viewer</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>1</string>
+ <key>Module</key>
+ <string>PBXBuildResultsModule</string>
+ <key>Name</key>
+ <string>Detailed Build Results Viewer</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>1</string>
+ <key>Module</key>
+ <string>PBXProjectFindModule</string>
+ <key>Name</key>
+ <string>Project Batch Find Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCProjectFormatConflictsModule</string>
+ <key>Name</key>
+ <string>Project Format Conflicts List</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXBookmarksModule</string>
+ <key>Name</key>
+ <string>Bookmarks Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXClassBrowserModule</string>
+ <key>Name</key>
+ <string>Class Browser</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXCVSModule</string>
+ <key>Name</key>
+ <string>Source Code Control Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXDebugBreakpointsModule</string>
+ <key>Name</key>
+ <string>Debug Breakpoints Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCDockableInspector</string>
+ <key>Name</key>
+ <string>Inspector</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXOpenQuicklyModule</string>
+ <key>Name</key>
+ <string>Open Quickly Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>1</string>
+ <key>Module</key>
+ <string>PBXDebugSessionModule</string>
+ <key>Name</key>
+ <string>Debugger</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>1</string>
+ <key>Module</key>
+ <string>PBXDebugCLIModule</string>
+ <key>Name</key>
+ <string>Debug Console</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCSnapshotModule</string>
+ <key>Name</key>
+ <string>Snapshots Tool</string>
+ </dict>
+ </array>
+ <key>BundlePath</key>
+ <string>/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources</string>
+ <key>Description</key>
+ <string>DefaultDescriptionKey</string>
+ <key>DockingSystemVisible</key>
+ <false/>
+ <key>Extension</key>
+ <string>mode1v3</string>
+ <key>FavBarConfig</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>B5B25F6711802DFC001BA9A0</string>
+ <key>XCBarModuleItemNames</key>
+ <dict/>
+ <key>XCBarModuleItems</key>
+ <array/>
+ </dict>
+ <key>FirstTimeWindowDisplayed</key>
+ <false/>
+ <key>Identifier</key>
+ <string>com.apple.perspectives.project.mode1v3</string>
+ <key>MajorVersion</key>
+ <integer>33</integer>
+ <key>MinorVersion</key>
+ <integer>0</integer>
+ <key>Name</key>
+ <string>Default</string>
+ <key>Notifications</key>
+ <array/>
+ <key>OpenEditors</key>
+ <array/>
+ <key>PerspectiveWidths</key>
+ <array>
+ <integer>-1</integer>
+ <integer>-1</integer>
+ </array>
+ <key>Perspectives</key>
+ <array>
+ <dict>
+ <key>ChosenToolbarItems</key>
+ <array>
+ <string>active-combo-popup</string>
+ <string>action</string>
+ <string>NSToolbarFlexibleSpaceItem</string>
+ <string>debugger-enable-breakpoints</string>
+ <string>build-and-go</string>
+ <string>com.apple.ide.PBXToolbarStopButton</string>
+ <string>get-info</string>
+ <string>NSToolbarFlexibleSpaceItem</string>
+ <string>com.apple.pbx.toolbar.searchfield</string>
+ </array>
+ <key>ControllerClassBaseName</key>
+ <string></string>
+ <key>IconName</key>
+ <string>WindowOfProjectWithEditor</string>
+ <key>Identifier</key>
+ <string>perspective.project</string>
+ <key>IsVertical</key>
+ <false/>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXBottomSmartGroupGIDs</key>
+ <array>
+ <string>1C37FBAC04509CD000000102</string>
+ <string>1C37FAAC04509CD000000102</string>
+ <string>1C37FABC05509CD000000102</string>
+ <string>1C37FABC05539CD112110102</string>
+ <string>E2644B35053B69B200211256</string>
+ <string>1C37FABC04509CD000100104</string>
+ <string>1CC0EA4004350EF90044410B</string>
+ <string>1CC0EA4004350EF90041110B</string>
+ </array>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CE0B1FE06471DED0097A5F4</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Files</string>
+ <key>PBXProjectStructureProvided</key>
+ <string>yes</string>
+ <key>PBXSmartGroupTreeModuleColumnData</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
+ <array>
+ <real>270</real>
+ </array>
+ <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
+ <array>
+ <string>MainColumn</string>
+ </array>
+ </dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
+ <array>
+ <string>29B97314FDCFA39411CA2CEA</string>
+ <string>080E96DDFE201D6D7F000001</string>
+ <string>B5BFA81E117F9CB4008B450B</string>
+ <string>1C37FABC05509CD000000102</string>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
+ <array>
+ <array>
+ <integer>7</integer>
+ <integer>2</integer>
+ <integer>1</integer>
+ <integer>0</integer>
+ </array>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
+ <string>{{0, 0}, {270, 597}}</string>
+ </dict>
+ <key>PBXTopSmartGroupGIDs</key>
+ <array/>
+ <key>XCIncludePerspectivesSwitch</key>
+ <true/>
+ <key>XCSharingToken</key>
+ <string>com.apple.Xcode.GFSharingToken</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {287, 615}}</string>
+ <key>GroupTreeTableConfiguration</key>
+ <array>
+ <string>MainColumn</string>
+ <real>270</real>
+ </array>
+ <key>RubberWindowFrame</key>
+ <string>1 122 1085 656 0 0 1280 778 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXSmartGroupTreeModule</string>
+ <key>Proportion</key>
+ <string>287pt</string>
+ </dict>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>BecomeActive</key>
+ <true/>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CE0B20306471E060097A5F4</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Person.m</string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CE0B20406471E060097A5F4</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Person.m</string>
+ <key>_historyCapacity</key>
+ <integer>0</integer>
+ <key>bookmark</key>
+ <string>B528D2DD11815D1F002D3B1C</string>
+ <key>history</key>
+ <array>
+ <string>B5B25FA911803848001BA9A0</string>
+ <string>B5B25FAA11803848001BA9A0</string>
+ <string>B5B25FAB11803848001BA9A0</string>
+ <string>B5B25FAC11803848001BA9A0</string>
+ <string>B5B25FAD11803848001BA9A0</string>
+ <string>B5B25FAE11803848001BA9A0</string>
+ <string>B5B25FB011803848001BA9A0</string>
+ </array>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <true/>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {793, 423}}</string>
+ <key>RubberWindowFrame</key>
+ <string>1 122 1085 656 0 0 1280 778 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>423pt</string>
+ </dict>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CE0B20506471E060097A5F4</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Detail</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 428}, {793, 187}}</string>
+ <key>RubberWindowFrame</key>
+ <string>1 122 1085 656 0 0 1280 778 </string>
+ </dict>
+ <key>Module</key>
+ <string>XCDetailModule</string>
+ <key>Proportion</key>
+ <string>187pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>793pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Project</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>XCModuleDock</string>
+ <string>PBXSmartGroupTreeModule</string>
+ <string>XCModuleDock</string>
+ <string>PBXNavigatorGroup</string>
+ <string>XCDetailModule</string>
+ </array>
+ <key>TableOfContents</key>
+ <array>
+ <string>B528D2DE11815D1F002D3B1C</string>
+ <string>1CE0B1FE06471DED0097A5F4</string>
+ <string>B528D2DF11815D1F002D3B1C</string>
+ <string>1CE0B20306471E060097A5F4</string>
+ <string>1CE0B20506471E060097A5F4</string>
+ </array>
+ <key>ToolbarConfigUserDefaultsMinorVersion</key>
+ <string>2</string>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.defaultV3</string>
+ </dict>
+ <dict>
+ <key>ControllerClassBaseName</key>
+ <string></string>
+ <key>IconName</key>
+ <string>WindowOfProject</string>
+ <key>Identifier</key>
+ <string>perspective.morph</string>
+ <key>IsVertical</key>
+ <integer>0</integer>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXBottomSmartGroupGIDs</key>
+ <array>
+ <string>1C37FBAC04509CD000000102</string>
+ <string>1C37FAAC04509CD000000102</string>
+ <string>1C08E77C0454961000C914BD</string>
+ <string>1C37FABC05509CD000000102</string>
+ <string>1C37FABC05539CD112110102</string>
+ <string>E2644B35053B69B200211256</string>
+ <string>1C37FABC04509CD000100104</string>
+ <string>1CC0EA4004350EF90044410B</string>
+ <string>1CC0EA4004350EF90041110B</string>
+ </array>
+ <key>PBXProjectModuleGUID</key>
+ <string>11E0B1FE06471DED0097A5F4</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Files</string>
+ <key>PBXProjectStructureProvided</key>
+ <string>yes</string>
+ <key>PBXSmartGroupTreeModuleColumnData</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
+ <array>
+ <real>186</real>
+ </array>
+ <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
+ <array>
+ <string>MainColumn</string>
+ </array>
+ </dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
+ <array>
+ <string>29B97314FDCFA39411CA2CEA</string>
+ <string>1C37FABC05509CD000000102</string>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
+ <array>
+ <array>
+ <integer>0</integer>
+ </array>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
+ <string>{{0, 0}, {186, 337}}</string>
+ </dict>
+ <key>PBXTopSmartGroupGIDs</key>
+ <array/>
+ <key>XCIncludePerspectivesSwitch</key>
+ <integer>1</integer>
+ <key>XCSharingToken</key>
+ <string>com.apple.Xcode.GFSharingToken</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {203, 355}}</string>
+ <key>GroupTreeTableConfiguration</key>
+ <array>
+ <string>MainColumn</string>
+ <real>186</real>
+ </array>
+ <key>RubberWindowFrame</key>
+ <string>373 269 690 397 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXSmartGroupTreeModule</string>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Morph</string>
+ <key>PreferredWidth</key>
+ <integer>300</integer>
+ <key>ServiceClasses</key>
+ <array>
+ <string>XCModuleDock</string>
+ <string>PBXSmartGroupTreeModule</string>
+ </array>
+ <key>TableOfContents</key>
+ <array>
+ <string>11E0B1FE06471DED0097A5F4</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.default.shortV3</string>
+ </dict>
+ </array>
+ <key>PerspectivesBarVisible</key>
+ <false/>
+ <key>ShelfIsVisible</key>
+ <false/>
+ <key>SourceDescription</key>
+ <string>file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec'</string>
+ <key>StatusbarIsVisible</key>
+ <true/>
+ <key>TimeStamp</key>
+ <real>0.0</real>
+ <key>ToolbarConfigUserDefaultsMinorVersion</key>
+ <string>2</string>
+ <key>ToolbarDisplayMode</key>
+ <integer>1</integer>
+ <key>ToolbarIsVisible</key>
+ <true/>
+ <key>ToolbarSizeMode</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Perspectives</string>
+ <key>UpdateMessage</key>
+ <string>The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'?</string>
+ <key>WindowJustification</key>
+ <integer>5</integer>
+ <key>WindowOrderList</key>
+ <array>
+ <string>B5B25F6811802DFC001BA9A0</string>
+ <string>/Users/ben/Devel/iPhone/NSArchiveExample/NSArchiveExample.xcodeproj</string>
+ </array>
+ <key>WindowString</key>
+ <string>1 122 1085 656 0 0 1280 778 </string>
+ <key>WindowToolsV3</key>
+ <array>
+ <dict>
+ <key>FirstTimeWindowDisplayed</key>
+ <false/>
+ <key>Identifier</key>
+ <string>windowTool.build</string>
+ <key>IsVertical</key>
+ <true/>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD0528F0623707200166675</string>
+ <key>PBXProjectModuleLabel</key>
+ <string></string>
+ <key>StatusBarVisibility</key>
+ <true/>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {500, 218}}</string>
+ <key>RubberWindowFrame</key>
+ <string>267 217 500 500 0 0 1280 778 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>218pt</string>
+ </dict>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>XCMainBuildResultsModuleGUID</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Build Results</string>
+ <key>XCBuildResultsTrigger_Collapse</key>
+ <integer>1021</integer>
+ <key>XCBuildResultsTrigger_Open</key>
+ <integer>1011</integer>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 223}, {500, 236}}</string>
+ <key>RubberWindowFrame</key>
+ <string>267 217 500 500 0 0 1280 778 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXBuildResultsModule</string>
+ <key>Proportion</key>
+ <string>236pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>459pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Build Results</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXBuildResultsModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <true/>
+ <key>TableOfContents</key>
+ <array>
+ <string>B5B25F6811802DFC001BA9A0</string>
+ <string>B528D2E011815D1F002D3B1C</string>
+ <string>1CD0528F0623707200166675</string>
+ <string>XCMainBuildResultsModuleGUID</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.buildV3</string>
+ <key>WindowContentMinSize</key>
+ <string>486 300</string>
+ <key>WindowString</key>
+ <string>267 217 500 500 0 0 1280 778 </string>
+ <key>WindowToolGUID</key>
+ <string>B5B25F6811802DFC001BA9A0</string>
+ <key>WindowToolIsVisible</key>
+ <false/>
+ </dict>
+ <dict>
+ <key>FirstTimeWindowDisplayed</key>
+ <false/>
+ <key>Identifier</key>
+ <string>windowTool.debugger</string>
+ <key>IsVertical</key>
+ <true/>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>Debugger</key>
+ <dict>
+ <key>HorizontalSplitView</key>
+ <dict>
+ <key>_collapsingFrameDimension</key>
+ <real>0.0</real>
+ <key>_indexOfCollapsedView</key>
+ <integer>0</integer>
+ <key>_percentageOfCollapsedView</key>
+ <real>0.0</real>
+ <key>isCollapsed</key>
+ <string>yes</string>
+ <key>sizes</key>
+ <array>
+ <string>{{0, 0}, {316, 185}}</string>
+ <string>{{316, 0}, {378, 185}}</string>
+ </array>
+ </dict>
+ <key>VerticalSplitView</key>
+ <dict>
+ <key>_collapsingFrameDimension</key>
+ <real>0.0</real>
+ <key>_indexOfCollapsedView</key>
+ <integer>0</integer>
+ <key>_percentageOfCollapsedView</key>
+ <real>0.0</real>
+ <key>isCollapsed</key>
+ <string>yes</string>
+ <key>sizes</key>
+ <array>
+ <string>{{0, 0}, {694, 185}}</string>
+ <string>{{0, 185}, {694, 196}}</string>
+ </array>
+ </dict>
+ </dict>
+ <key>LauncherConfigVersion</key>
+ <string>8</string>
+ <key>PBXProjectModuleGUID</key>
+ <string>1C162984064C10D400B95A72</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Debug - GLUTExamples (Underwater)</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>DebugConsoleVisible</key>
+ <string>None</string>
+ <key>DebugConsoleWindowFrame</key>
+ <string>{{200, 200}, {500, 300}}</string>
+ <key>DebugSTDIOWindowFrame</key>
+ <string>{{200, 200}, {500, 300}}</string>
+ <key>Frame</key>
+ <string>{{0, 0}, {694, 381}}</string>
+ <key>PBXDebugSessionStackFrameViewKey</key>
+ <dict>
+ <key>DebugVariablesTableConfiguration</key>
+ <array>
+ <string>Name</string>
+ <real>120</real>
+ <string>Value</string>
+ <real>85</real>
+ <string>Summary</string>
+ <real>148</real>
+ </array>
+ <key>Frame</key>
+ <string>{{316, 0}, {378, 185}}</string>
+ <key>RubberWindowFrame</key>
+ <string>22 333 694 422 0 0 1280 778 </string>
+ </dict>
+ <key>RubberWindowFrame</key>
+ <string>22 333 694 422 0 0 1280 778 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXDebugSessionModule</string>
+ <key>Proportion</key>
+ <string>381pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>381pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Debugger</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXDebugSessionModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <true/>
+ <key>TableOfContents</key>
+ <array>
+ <string>1CD10A99069EF8BA00B06720</string>
+ <string>B5B25FB111803848001BA9A0</string>
+ <string>1C162984064C10D400B95A72</string>
+ <string>B5B25FB211803848001BA9A0</string>
+ <string>B5B25FB311803848001BA9A0</string>
+ <string>B5B25FB411803848001BA9A0</string>
+ <string>B5B25FB511803848001BA9A0</string>
+ <string>B5B25FB611803848001BA9A0</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.debugV3</string>
+ <key>WindowString</key>
+ <string>22 333 694 422 0 0 1280 778 </string>
+ <key>WindowToolGUID</key>
+ <string>1CD10A99069EF8BA00B06720</string>
+ <key>WindowToolIsVisible</key>
+ <false/>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.find</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CDD528C0622207200134675</string>
+ <key>PBXProjectModuleLabel</key>
+ <string><No Editor></string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD0528D0623707200166675</string>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <integer>1</integer>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {781, 167}}</string>
+ <key>RubberWindowFrame</key>
+ <string>62 385 781 470 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>781pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>50%</string>
+ </dict>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD0528E0623707200166675</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Project Find</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{8, 0}, {773, 254}}</string>
+ <key>RubberWindowFrame</key>
+ <string>62 385 781 470 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXProjectFindModule</string>
+ <key>Proportion</key>
+ <string>50%</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>428pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Project Find</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXProjectFindModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1C530D57069F1CE1000CFCEE</string>
+ <string>1C530D58069F1CE1000CFCEE</string>
+ <string>1C530D59069F1CE1000CFCEE</string>
+ <string>1CDD528C0622207200134675</string>
+ <string>1C530D5A069F1CE1000CFCEE</string>
+ <string>1CE0B1FE06471DED0097A5F4</string>
+ <string>1CD0528E0623707200166675</string>
+ </array>
+ <key>WindowString</key>
+ <string>62 385 781 470 0 0 1440 878 </string>
+ <key>WindowToolGUID</key>
+ <string>1C530D57069F1CE1000CFCEE</string>
+ <key>WindowToolIsVisible</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>MENUSEPARATOR</string>
+ </dict>
+ <dict>
+ <key>FirstTimeWindowDisplayed</key>
+ <false/>
+ <key>Identifier</key>
+ <string>windowTool.debuggerConsole</string>
+ <key>IsVertical</key>
+ <true/>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1C78EAAC065D492600B07095</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Debugger Console</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {650, 209}}</string>
+ <key>RubberWindowFrame</key>
+ <string>22 505 650 250 0 0 1280 778 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXDebugCLIModule</string>
+ <key>Proportion</key>
+ <string>209pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>209pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Debugger Console</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXDebugCLIModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <true/>
+ <key>TableOfContents</key>
+ <array>
+ <string>1C78EAAD065D492600B07095</string>
+ <string>B5B25FB711803848001BA9A0</string>
+ <string>1C78EAAC065D492600B07095</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.consoleV3</string>
+ <key>WindowString</key>
+ <string>22 505 650 250 0 0 1280 778 </string>
+ <key>WindowToolGUID</key>
+ <string>1C78EAAD065D492600B07095</string>
+ <key>WindowToolIsVisible</key>
+ <false/>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.snapshots</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>Module</key>
+ <string>XCSnapshotModule</string>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Snapshots</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>XCSnapshotModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <string>Yes</string>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.snapshots</string>
+ <key>WindowString</key>
+ <string>315 824 300 550 0 0 1440 878 </string>
+ <key>WindowToolIsVisible</key>
+ <string>Yes</string>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.scm</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1C78EAB2065D492600B07095</string>
+ <key>PBXProjectModuleLabel</key>
+ <string><No Editor></string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1C78EAB3065D492600B07095</string>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <integer>1</integer>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {452, 0}}</string>
+ <key>RubberWindowFrame</key>
+ <string>743 379 452 308 0 0 1280 1002 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>0pt</string>
+ </dict>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD052920623707200166675</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>SCM</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>ConsoleFrame</key>
+ <string>{{0, 259}, {452, 0}}</string>
+ <key>Frame</key>
+ <string>{{0, 7}, {452, 259}}</string>
+ <key>RubberWindowFrame</key>
+ <string>743 379 452 308 0 0 1280 1002 </string>
+ <key>TableConfiguration</key>
+ <array>
+ <string>Status</string>
+ <real>30</real>
+ <string>FileName</string>
+ <real>199</real>
+ <string>Path</string>
+ <real>197.0950012207031</real>
+ </array>
+ <key>TableFrame</key>
+ <string>{{0, 0}, {452, 250}}</string>
+ </dict>
+ <key>Module</key>
+ <string>PBXCVSModule</string>
+ <key>Proportion</key>
+ <string>262pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>266pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>SCM</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXCVSModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1C78EAB4065D492600B07095</string>
+ <string>1C78EAB5065D492600B07095</string>
+ <string>1C78EAB2065D492600B07095</string>
+ <string>1CD052920623707200166675</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.scm</string>
+ <key>WindowString</key>
+ <string>743 379 452 308 0 0 1280 1002 </string>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.breakpoints</string>
+ <key>IsVertical</key>
+ <integer>0</integer>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXBottomSmartGroupGIDs</key>
+ <array>
+ <string>1C77FABC04509CD000000102</string>
+ </array>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CE0B1FE06471DED0097A5F4</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Files</string>
+ <key>PBXProjectStructureProvided</key>
+ <string>no</string>
+ <key>PBXSmartGroupTreeModuleColumnData</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
+ <array>
+ <real>168</real>
+ </array>
+ <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
+ <array>
+ <string>MainColumn</string>
+ </array>
+ </dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
+ <array>
+ <string>1C77FABC04509CD000000102</string>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
+ <array>
+ <array>
+ <integer>0</integer>
+ </array>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
+ <string>{{0, 0}, {168, 350}}</string>
+ </dict>
+ <key>PBXTopSmartGroupGIDs</key>
+ <array/>
+ <key>XCIncludePerspectivesSwitch</key>
+ <integer>0</integer>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {185, 368}}</string>
+ <key>GroupTreeTableConfiguration</key>
+ <array>
+ <string>MainColumn</string>
+ <real>168</real>
+ </array>
+ <key>RubberWindowFrame</key>
+ <string>315 424 744 409 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXSmartGroupTreeModule</string>
+ <key>Proportion</key>
+ <string>185pt</string>
+ </dict>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CA1AED706398EBD00589147</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Detail</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{190, 0}, {554, 368}}</string>
+ <key>RubberWindowFrame</key>
+ <string>315 424 744 409 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>XCDetailModule</string>
+ <key>Proportion</key>
+ <string>554pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>368pt</string>
+ </dict>
+ </array>
+ <key>MajorVersion</key>
+ <integer>3</integer>
+ <key>MinorVersion</key>
+ <integer>0</integer>
+ <key>Name</key>
+ <string>Breakpoints</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXSmartGroupTreeModule</string>
+ <string>XCDetailModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1CDDB66807F98D9800BB5817</string>
+ <string>1CDDB66907F98D9800BB5817</string>
+ <string>1CE0B1FE06471DED0097A5F4</string>
+ <string>1CA1AED706398EBD00589147</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.breakpointsV3</string>
+ <key>WindowString</key>
+ <string>315 424 744 409 0 0 1440 878 </string>
+ <key>WindowToolGUID</key>
+ <string>1CDDB66807F98D9800BB5817</string>
+ <key>WindowToolIsVisible</key>
+ <integer>1</integer>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.debugAnimator</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Debug Visualizer</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXNavigatorGroup</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.debugAnimatorV3</string>
+ <key>WindowString</key>
+ <string>100 100 700 500 0 0 1280 1002 </string>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.bookmarks</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>Module</key>
+ <string>PBXBookmarksModule</string>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Bookmarks</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXBookmarksModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>0</integer>
+ <key>WindowString</key>
+ <string>538 42 401 187 0 0 1280 1002 </string>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.projectFormatConflicts</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>Module</key>
+ <string>XCProjectFormatConflictsModule</string>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Project Format Conflicts</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>XCProjectFormatConflictsModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>0</integer>
+ <key>WindowContentMinSize</key>
+ <string>450 300</string>
+ <key>WindowString</key>
+ <string>50 850 472 307 0 0 1440 877</string>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.classBrowser</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>OptionsSetName</key>
+ <string>Hierarchy, all classes</string>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CA6456E063B45B4001379D8</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Class Browser - NSObject</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>ClassesFrame</key>
+ <string>{{0, 0}, {374, 96}}</string>
+ <key>ClassesTreeTableConfiguration</key>
+ <array>
+ <string>PBXClassNameColumnIdentifier</string>
+ <real>208</real>
+ <string>PBXClassBookColumnIdentifier</string>
+ <real>22</real>
+ </array>
+ <key>Frame</key>
+ <string>{{0, 0}, {630, 331}}</string>
+ <key>MembersFrame</key>
+ <string>{{0, 105}, {374, 395}}</string>
+ <key>MembersTreeTableConfiguration</key>
+ <array>
+ <string>PBXMemberTypeIconColumnIdentifier</string>
+ <real>22</real>
+ <string>PBXMemberNameColumnIdentifier</string>
+ <real>216</real>
+ <string>PBXMemberTypeColumnIdentifier</string>
+ <real>97</real>
+ <string>PBXMemberBookColumnIdentifier</string>
+ <real>22</real>
+ </array>
+ <key>PBXModuleWindowStatusBarHidden2</key>
+ <integer>1</integer>
+ <key>RubberWindowFrame</key>
+ <string>385 179 630 352 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXClassBrowserModule</string>
+ <key>Proportion</key>
+ <string>332pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>332pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Class Browser</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXClassBrowserModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>0</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1C0AD2AF069F1E9B00FABCE6</string>
+ <string>1C0AD2B0069F1E9B00FABCE6</string>
+ <string>1CA6456E063B45B4001379D8</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.classbrowser</string>
+ <key>WindowString</key>
+ <string>385 179 630 352 0 0 1440 878 </string>
+ <key>WindowToolGUID</key>
+ <string>1C0AD2AF069F1E9B00FABCE6</string>
+ <key>WindowToolIsVisible</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.refactoring</string>
+ <key>IncludeInToolsMenu</key>
+ <integer>0</integer>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{0, 0}, {500, 335}</string>
+ <key>RubberWindowFrame</key>
+ <string>{0, 0}, {500, 335}</string>
+ </dict>
+ <key>Module</key>
+ <string>XCRefactoringModule</string>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Refactoring</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>XCRefactoringModule</string>
+ </array>
+ <key>WindowString</key>
+ <string>200 200 500 356 0 0 1920 1200 </string>
+ </dict>
+ </array>
+</dict>
+</plist>
|
bentford/NSArchiveExample
|
4fc5c09b5c57e1e2faa9c3da26d2123a558c1194
|
added initial behavior for view all tab
|
diff --git a/Classes/BossViewController.m b/Classes/BossViewController.m
index 68e423d..9ad0303 100644
--- a/Classes/BossViewController.m
+++ b/Classes/BossViewController.m
@@ -1,43 +1,43 @@
//
// BossViewController.m
// NSArchiveExample
//
// Created by Ben Ford on 4/21/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "BossViewController.h"
#import "Model.h"
@implementation BossViewController
- (void)awakeFromNib {
}
- (void)viewDidLoad {
[super viewDidLoad];
[self loadBoss];
}
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[firstName resignFirstResponder];
[lastName resignFirstResponder];
[age resignFirstResponder];
}
- (void)loadBoss {
firstName.text = [Persistance sharedService].boss.firstName;
- lastName.text = [Persistance sharedService].boss.firstName;
+ lastName.text = [Persistance sharedService].boss.lastName;
age.text = [NSString stringWithFormat:@"%d",[Persistance sharedService].boss.age];
[isFullTime setOn:[Persistance sharedService].boss.isFullTime animated:NO];
}
- (IBAction)saveBoss {
[Persistance sharedService].boss.firstName = firstName.text;
[Persistance sharedService].boss.lastName = lastName.text;
[Persistance sharedService].boss.age = [age.text intValue];
[Persistance sharedService].boss.isFullTime = isFullTime.on;
}
@end
diff --git a/Classes/ViewAllView.xib b/Classes/ViewAllView.xib
new file mode 100644
index 0000000..51c52f3
--- /dev/null
+++ b/Classes/ViewAllView.xib
@@ -0,0 +1,408 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">800</int>
+ <string key="IBDocument.SystemVersion">10D2125</string>
+ <string key="IBDocument.InterfaceBuilderVersion">762</string>
+ <string key="IBDocument.AppKitVersion">1038.29</string>
+ <string key="IBDocument.HIToolboxVersion">460.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">87</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="4"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="191373211">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUITableView" id="883053803">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrameSize">{320, 411}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <object class="NSColor" key="IBUIBackgroundColor" id="926392961">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIBouncesZoom">NO</bool>
+ <int key="IBUISeparatorStyle">1</int>
+ <int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
+ <bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
+ <float key="IBUIRowHeight">44</float>
+ <float key="IBUISectionHeaderHeight">22</float>
+ <float key="IBUISectionFooterHeight">22</float>
+ </object>
+ </object>
+ <string key="NSFrameSize">{320, 411}</string>
+ <reference key="NSSuperview"/>
+ <reference key="IBUIBackgroundColor" ref="926392961"/>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
+ <int key="IBUIStatusBarStyle">2</int>
+ </object>
+ <object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="191373211"/>
+ </object>
+ <int key="connectionID">3</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">tableview</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="883053803"/>
+ </object>
+ <int key="connectionID">5</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">dataSource</string>
+ <reference key="source" ref="883053803"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="883053803"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="191373211"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="883053803"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="883053803"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>4.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>ViewAllViewController</string>
+ <string>UIResponder</string>
+ <string>{{393, 194}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">7</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">ViewAllViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">tableview</string>
+ <string key="NS.object.0">UITableView</string>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/ViewAllViewController.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="5489046">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIResponder</string>
+ <string key="superclassName">NSObject</string>
+ <reference key="sourceIdentifier" ref="5489046"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIScrollView</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIScrollView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchBar</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchDisplayController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UITableView</string>
+ <string key="superclassName">UIScrollView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITableView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../NSArchiveExample.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">87</string>
+ </data>
+</archive>
diff --git a/Classes/ViewAllViewController.h b/Classes/ViewAllViewController.h
new file mode 100644
index 0000000..06631e3
--- /dev/null
+++ b/Classes/ViewAllViewController.h
@@ -0,0 +1,16 @@
+//
+// ViewAllViewController.h
+// NSArchiveExample
+//
+// Created by Ben Ford on 4/22/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface ViewAllViewController : UIViewController {
+ IBOutlet UITableView *tableview;
+}
+
+@end
diff --git a/Classes/ViewAllViewController.m b/Classes/ViewAllViewController.m
new file mode 100644
index 0000000..aa15ba7
--- /dev/null
+++ b/Classes/ViewAllViewController.m
@@ -0,0 +1,74 @@
+//
+// ViewAllViewController.m
+// NSArchiveExample
+//
+// Created by Ben Ford on 4/22/10.
+// Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "ViewAllViewController.h"
+#import "Model.h"
+
+@implementation ViewAllViewController
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+}
+
+#pragma mark UITableViewDelegate
+
+#pragma mark -
+
+#pragma mark UITableViewDataSource
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ switch (section) {
+ case 0:
+ return 1;
+ break;
+ case 1:
+ return [[Persistance sharedService].managers count];
+ break;
+ case 2:
+ return [[Persistance sharedService].employees count];
+ break;
+ default:
+ return 1;
+ break;
+ }
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+ UITableViewCell *cell;
+ cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
+ if( cell == nil ) {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewStylePlain reuseIdentifier:@"cell"] autorelease];
+ }
+ Person *person = nil;
+
+ switch (indexPath.section) {
+ case 0:
+ cell.textLabel.text = [Persistance sharedService].boss.fullName;
+ break;
+ case 1:
+ person = [[Persistance sharedService].managers objectForKey:@"HeadManager"];
+ cell.textLabel.text = person.fullName;
+ break;
+ case 2:
+ person = [[Persistance sharedService].employees objectAtIndex:indexPath.row];
+ cell.textLabel.text = person.fullName;
+ break;
+ default:
+ cell.textLabel.text = @"error";
+ break;
+ }
+
+ return cell;
+}
+#pragma mark -
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+
+@end
diff --git a/MainWindow.xib b/MainWindow.xib
index d9fcb35..ce9a0e3 100644
--- a/MainWindow.xib
+++ b/MainWindow.xib
@@ -1,650 +1,681 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">800</int>
<string key="IBDocument.SystemVersion">10D2125</string>
<string key="IBDocument.InterfaceBuilderVersion">762</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.HIToolboxVersion">460.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">87</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="15"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="841351856">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="427554174">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUICustomObject" id="664661524">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUITabBarController" id="675605402">
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
<object class="IBUIViewController" key="IBUISelectedViewController" id="780626317">
<string key="IBUITitle">Boss</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="211206031">
<string key="IBUITitle">Boss</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">BossView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="NSMutableArray" key="IBUIViewControllers">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="780626317"/>
<object class="IBUIViewController" id="404439053">
<string key="IBUITitle">Managers</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="415100502">
<string key="IBUITitle">Managers</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="976730607">
<string key="IBUITitle">Employees</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="582457009">
<string key="IBUITitle">Employees</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIToolbarItems" ref="0"/>
<reference key="IBUIParentViewController" ref="675605402"/>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
- <object class="IBUIViewController" id="619467790">
+ <object class="IBUIViewController" id="102828398">
<string key="IBUITitle">View All</string>
- <object class="IBUITabBarItem" key="IBUITabBarItem" id="461979782">
+ <object class="IBUITabBarItem" key="IBUITabBarItem" id="794213646">
<string key="IBUITitle">View All</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIToolbarItems" ref="0"/>
<reference key="IBUIParentViewController" ref="675605402"/>
+ <string key="IBUINibName">ViewAllView</string>
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
<int key="interfaceOrientation">1</int>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
</object>
<object class="IBUITabBar" key="IBUITabBar" id="764819862">
<nil key="NSNextResponder"/>
<int key="NSvFlags">266</int>
<string key="NSFrame">{{129, 330}, {163, 49}}</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBUIWindow" id="117978783">
<nil key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 480}</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="664661524"/>
</object>
<int key="connectionID">4</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="117978783"/>
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">tabBar</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="675605402"/>
</object>
<int key="connectionID">25</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="664661524"/>
<reference key="parent" ref="0"/>
<string key="objectName">NSArchiveExample App Delegate</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="427554174"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="117978783"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="675605402"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="764819862"/>
<reference ref="780626317"/>
<reference ref="404439053"/>
<reference ref="976730607"/>
- <reference ref="619467790"/>
+ <reference ref="102828398"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="764819862"/>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="780626317"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="211206031"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="404439053"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="415100502"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="415100502"/>
<reference key="parent" ref="404439053"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="211206031"/>
<reference key="parent" ref="780626317"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="976730607"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="582457009"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="582457009"/>
<reference key="parent" ref="976730607"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
- <reference key="object" ref="619467790"/>
+ <reference key="object" ref="102828398"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="461979782"/>
+ <reference ref="794213646"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
- <reference key="object" ref="461979782"/>
- <reference key="parent" ref="619467790"/>
+ <reference key="object" ref="794213646"/>
+ <reference key="parent" ref="102828398"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>12.IBEditorWindowLastContentRect</string>
<string>12.IBPluginDependency</string>
<string>15.IBEditorWindowLastContentRect</string>
<string>15.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>17.CustomClassName</string>
<string>17.IBPluginDependency</string>
<string>18.IBPluginDependency</string>
<string>19.IBPluginDependency</string>
<string>20.IBPluginDependency</string>
+ <string>26.CustomClassName</string>
<string>3.CustomClassName</string>
<string>3.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIApplication</string>
<string>UIResponder</string>
<string>{{525, 346}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>{{40, 778}, {0, -22}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>BossViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>ViewAllViewController</string>
<string>NSArchiveExampleAppDelegate</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">27</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">BossViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">saveBoss</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>age</string>
<string>firstName</string>
<string>isFullTime</string>
<string>lastName</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UITextField</string>
<string>UITextField</string>
<string>UISwitch</string>
<string>UITextField</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/BossViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSArchiveExampleAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>tabBar</string>
<string>window</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UITabBarController</string>
<string>UIWindow</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/NSArchiveExampleAppDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSArchiveExampleAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">ViewAllViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">tableview</string>
+ <string key="NS.object.0">UITableView</string>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/ViewAllViewController.h</string>
+ </object>
+ </object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="853905935">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIApplication</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIApplication.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIBarItem</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIBarItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIControl</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIResponder</string>
<string key="superclassName">NSObject</string>
<reference key="sourceIdentifier" ref="853905935"/>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIScrollView</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIScrollView.h</string>
+ </object>
+ </object>
<object class="IBPartialClassDescription">
<string key="className">UISearchBar</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchDisplayController</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISwitch</string>
<string key="superclassName">UIControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISwitch.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITabBar</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITabBarController</string>
<string key="superclassName">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="79470768">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITabBarItem</string>
<string key="superclassName">UIBarItem</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBarItem.h</string>
</object>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UITableView</string>
+ <string key="superclassName">UIScrollView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITableView.h</string>
+ </object>
+ </object>
<object class="IBPartialClassDescription">
<string key="className">UITextField</string>
<string key="superclassName">UIControl</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="648731867">
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="101380308">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
- <reference key="sourceIdentifier" ref="648731867"/>
+ <reference key="sourceIdentifier" ref="101380308"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<reference key="sourceIdentifier" ref="79470768"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIWindow</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIWindow.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">NSArchiveExample.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">87</string>
</data>
</archive>
diff --git a/NSArchiveExample.xcodeproj/Ben.pbxuser b/NSArchiveExample.xcodeproj/Ben.pbxuser
index b2680dc..0021d07 100644
--- a/NSArchiveExample.xcodeproj/Ben.pbxuser
+++ b/NSArchiveExample.xcodeproj/Ben.pbxuser
@@ -1,148 +1,156 @@
// !$*UTF8*$!
{
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 529}";
};
};
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{266, 0}";
sepNavVisRange = "{0, 849}";
};
};
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
activeExec = 0;
executables = (
B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
);
};
29B97313FDCFA39411CA2CEA /* Project object */ = {
activeBuildConfigurationName = Debug;
activeExecutable = B5BFA7F6117F9A63008B450B /* NSArchiveExample */;
activeTarget = 1D6058900D05DD3D006BFB54 /* NSArchiveExample */;
addToTargets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
codeSenseManager = B5BFA801117F9A81008B450B /* Code sense */;
executables = (
B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
);
perUserDictionary = {
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
286,
20,
48.16259765625,
43,
43,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
PBXFileDataSource_Target_ColumnID,
);
};
PBXPerProjectTemplateStateSaveDate = 293613031;
PBXWorkspaceStateSaveDate = 293613031;
};
sourceControlManager = B5BFA800117F9A81008B450B /* Source Control */;
userBuildSettings = {
};
};
B5BFA7F6117F9A63008B450B /* NSArchiveExample */ = {
isa = PBXExecutable;
activeArgIndices = (
);
argumentStrings = (
);
autoAttachOnCrash = 1;
breakpointsEnabled = 0;
configStateDict = {
};
customDataFormattersEnabled = 1;
dataTipCustomDataFormattersEnabled = 1;
dataTipShowTypeColumn = 1;
dataTipSortType = 0;
debuggerPlugin = GDBDebugging;
disassemblyDisplayState = 0;
+ dylibVariantSuffix = "";
enableDebugStr = 1;
environmentEntries = (
);
executableSystemSymbolLevel = 0;
executableUserSymbolLevel = 0;
libgmallocEnabled = 0;
name = NSArchiveExample;
showTypeColumn = 0;
sourceDirectories = (
);
};
B5BFA800117F9A81008B450B /* Source Control */ = {
isa = PBXSourceControlManager;
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
repositoryNamesForRoots = {
"" = "";
};
};
};
B5BFA801117F9A81008B450B /* Code sense */ = {
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
B5BFA802117F9A96008B450B /* Persistance.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{622, 0}";
sepNavVisRange = "{0, 628}";
};
};
B5BFA803117F9A96008B450B /* Persistance.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1450, 2472}}";
sepNavSelRange = "{2824, 0}";
sepNavVisRange = "{0, 1153}";
};
};
B5BFA81B117F9CAD008B450B /* Person.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
+ sepNavIntBoundsRect = "{{0, 0}, {476, 494}}";
sepNavSelRange = "{511, 0}";
- sepNavVisRange = "{0, 517}";
+ sepNavVisRange = "{37, 486}";
};
};
B5BFA81C117F9CAD008B450B /* Person.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
- sepNavSelRange = "{260, 0}";
- sepNavVisRange = "{0, 1166}";
+ sepNavIntBoundsRect = "{{0, 0}, {596, 1045}}";
+ sepNavSelRange = "{1187, 0}";
+ sepNavVisRange = "{233, 575}";
};
};
B5BFA83B117FA0E3008B450B /* Model.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
sepNavSelRange = "{161, 0}";
sepNavVisRange = "{0, 181}";
};
};
B5BFA841117FA1AA008B450B /* BossViewController.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
- sepNavSelRange = "{0, 0}";
- sepNavVisRange = "{0, 247}";
+ sepNavIntBoundsRect = "{{0, 0}, {476, 418}}";
+ sepNavSelRange = "{378, 0}";
+ sepNavVisRange = "{0, 425}";
sepNavWindowFrame = "{{38, 157}, {1354, 1235}}";
};
};
+ B5BFA842117FA1AA008B450B /* BossViewController.m */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {732, 836}}";
+ sepNavSelRange = "{1126, 0}";
+ sepNavVisRange = "{237, 606}";
+ };
+ };
}
diff --git a/NSArchiveExample.xcodeproj/project.pbxproj b/NSArchiveExample.xcodeproj/project.pbxproj
index 4bdd270..96db396 100755
--- a/NSArchiveExample.xcodeproj/project.pbxproj
+++ b/NSArchiveExample.xcodeproj/project.pbxproj
@@ -1,275 +1,285 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */; };
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
+ B5B25F7F11803200001BA9A0 /* ViewAllViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */; };
+ B5B25F8011803200001BA9A0 /* ViewAllView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5B25F7E11803200001BA9A0 /* ViewAllView.xib */; };
B5BFA804117F9A96008B450B /* Persistance.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA803117F9A96008B450B /* Persistance.m */; };
B5BFA81D117F9CAD008B450B /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA81C117F9CAD008B450B /* Person.m */; };
B5BFA843117FA1AA008B450B /* BossViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B5BFA842117FA1AA008B450B /* BossViewController.m */; };
B5BFA845117FA1B8008B450B /* BossView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B5BFA844117FA1B8008B450B /* BossView.xib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExampleAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSArchiveExampleAppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSArchiveExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NSArchiveExampleViewController.xib; sourceTree = "<group>"; };
28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArchiveExample_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "NSArchiveExample-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
+ B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewAllViewController.h; sourceTree = "<group>"; };
+ B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewAllViewController.m; sourceTree = "<group>"; };
+ B5B25F7E11803200001BA9A0 /* ViewAllView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ViewAllView.xib; sourceTree = "<group>"; };
B5BFA802117F9A96008B450B /* Persistance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Persistance.h; sourceTree = "<group>"; };
B5BFA803117F9A96008B450B /* Persistance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Persistance.m; sourceTree = "<group>"; };
B5BFA81B117F9CAD008B450B /* Person.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Person.h; sourceTree = "<group>"; };
B5BFA81C117F9CAD008B450B /* Person.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Person.m; sourceTree = "<group>"; };
B5BFA83B117FA0E3008B450B /* Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Model.h; sourceTree = "<group>"; };
B5BFA841117FA1AA008B450B /* BossViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BossViewController.h; sourceTree = "<group>"; };
B5BFA842117FA1AA008B450B /* BossViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BossViewController.m; sourceTree = "<group>"; };
B5BFA844117FA1B8008B450B /* BossView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BossView.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
B5BFA81E117F9CB4008B450B /* Model */,
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */,
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */,
B5BFA841117FA1AA008B450B /* BossViewController.h */,
B5BFA842117FA1AA008B450B /* BossViewController.m */,
B5BFA844117FA1B8008B450B /* BossView.xib */,
+ B5B25F7C11803200001BA9A0 /* ViewAllViewController.h */,
+ B5B25F7D11803200001BA9A0 /* ViewAllViewController.m */,
+ B5B25F7E11803200001BA9A0 /* ViewAllView.xib */,
);
path = Classes;
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = CustomTemplate;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* NSArchiveExample_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
2899E5210DE3E06400AC0155 /* NSArchiveExampleViewController.xib */,
28AD733E0D9D9553002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* NSArchiveExample-Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
288765A40DF7441C002DB57D /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
B5BFA81E117F9CB4008B450B /* Model */ = {
isa = PBXGroup;
children = (
B5BFA83B117FA0E3008B450B /* Model.h */,
B5BFA802117F9A96008B450B /* Persistance.h */,
B5BFA803117F9A96008B450B /* Persistance.m */,
B5BFA81B117F9CAD008B450B /* Person.h */,
B5BFA81C117F9CAD008B450B /* Person.m */,
);
name = Model;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */;
buildPhases = (
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = NSArchiveExample;
productName = NSArchiveExample;
productReference = 1D6058910D05DD3D006BFB54 /* NSArchiveExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */;
compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
targets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1D60588D0D05DD3D006BFB54 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
2899E5220DE3E06400AC0155 /* NSArchiveExampleViewController.xib in Resources */,
B5BFA845117FA1B8008B450B /* BossView.xib in Resources */,
+ B5B25F8011803200001BA9A0 /* ViewAllView.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* NSArchiveExampleAppDelegate.m in Sources */,
B5BFA804117F9A96008B450B /* Persistance.m in Sources */,
B5BFA81D117F9CAD008B450B /* Person.m in Sources */,
B5BFA843117FA1AA008B450B /* BossViewController.m in Sources */,
+ B5B25F7F11803200001BA9A0 /* ViewAllViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
PRODUCT_NAME = NSArchiveExample;
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NSArchiveExample_Prefix.pch;
INFOPLIST_FILE = "NSArchiveExample-Info.plist";
PRODUCT_NAME = NSArchiveExample;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = iphoneos3.1.3;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = iphoneos3.1.3;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1D6058940D05DD3E006BFB54 /* Debug */,
1D6058950D05DD3E006BFB54 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSArchiveExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
|
bentford/NSArchiveExample
|
c642b7c333c9924bf0bd383b9b2f7c2a6458d753
|
goes with previous commit (added helper property fullName)
|
diff --git a/Classes/Person.h b/Classes/Person.h
index 7ed09f5..6feaaff 100644
--- a/Classes/Person.h
+++ b/Classes/Person.h
@@ -1,25 +1,27 @@
//
// Person.h
// NSArchiveExample
//
// Created by Ben Ford on 4/21/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Person : NSObject <NSCoding> {
NSString *firstName;
NSString *lastName;
NSInteger age;
BOOL isFullTime;
}
@property (nonatomic,retain) NSString *firstName;
@property (nonatomic,retain) NSString *lastName;
@property (nonatomic) NSInteger age;
@property (nonatomic) BOOL isFullTime;
+@property (nonatomic,readonly) NSString *fullName;
+
+ (Person *)defaultPerson;
- (id)init;
@end
|
bentford/NSArchiveExample
|
1c77744545c5f433682244a64e3724b91655fdf7
|
Fixed persistance bug and added helper property for fullName
|
diff --git a/Classes/Person.m b/Classes/Person.m
index 0e078d8..ba6091c 100644
--- a/Classes/Person.m
+++ b/Classes/Person.m
@@ -1,54 +1,57 @@
//
// Person.m
// NSArchiveExample
//
// Created by Ben Ford on 4/21/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "Person.h"
@implementation Person
@synthesize firstName, lastName, age, isFullTime;
+ (Person *)defaultPerson {
return [[[Person alloc] init] autorelease];
}
- (id)init {
if( self = [super init] ) {
self.firstName = [NSString string];
self.lastName = [NSString string];
self.age = 0;
self.isFullTime = YES;
}
return self;
}
#pragma mark NSCoding
- (id)initWithCoder:(NSCoder *)coder {
self = [super init];
if( self ) {
self.firstName = [coder decodeObjectForKey:@"firstName"];
self.lastName = [coder decodeObjectForKey:@"lastName"];
self.age = [coder decodeIntForKey:@"age"];
self.isFullTime = [coder decodeBoolForKey:@"isFullTime"];
}
return self;
}
- (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeObject:self.firstName forKey:@"firstName"];
- [coder encodeObject:self.firstName forKey:@"firstName"];
+ [coder encodeObject:self.firstName forKey:@"lastName"];
[coder encodeInt:self.age forKey:@"age"];
[coder encodeBool:self.isFullTime forKey:@"isFullTime"];
}
#pragma mark -
+- (NSString *)fullName {
+ return [NSString stringWithFormat:@"%@ %@", self.firstName, self.lastName];
+}
- (void)dealloc {
self.firstName = nil;
self.lastName = nil;
[super dealloc];
}
@end
|
bentford/NSArchiveExample
|
b66f9bba22cdfdcce4793412970eaaa04b6b2c48
|
fixed several bugs:
|
diff --git a/Classes/BossViewController.m b/Classes/BossViewController.m
index 8f57ca4..68e423d 100644
--- a/Classes/BossViewController.m
+++ b/Classes/BossViewController.m
@@ -1,43 +1,43 @@
//
// BossViewController.m
// NSArchiveExample
//
// Created by Ben Ford on 4/21/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "BossViewController.h"
#import "Model.h"
@implementation BossViewController
- (void)awakeFromNib {
}
- (void)viewDidLoad {
[super viewDidLoad];
[self loadBoss];
}
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[firstName resignFirstResponder];
[lastName resignFirstResponder];
[age resignFirstResponder];
}
- (void)loadBoss {
firstName.text = [Persistance sharedService].boss.firstName;
lastName.text = [Persistance sharedService].boss.firstName;
age.text = [NSString stringWithFormat:@"%d",[Persistance sharedService].boss.age];
[isFullTime setOn:[Persistance sharedService].boss.isFullTime animated:NO];
}
- (IBAction)saveBoss {
[Persistance sharedService].boss.firstName = firstName.text;
[Persistance sharedService].boss.lastName = lastName.text;
[Persistance sharedService].boss.age = [age.text intValue];
- [Persistance sharedService].boss.isFullTime = isFullTime.state;
+ [Persistance sharedService].boss.isFullTime = isFullTime.on;
}
@end
diff --git a/Classes/Person.m b/Classes/Person.m
index 22e8cab..0e078d8 100644
--- a/Classes/Person.m
+++ b/Classes/Person.m
@@ -1,54 +1,54 @@
//
// Person.m
// NSArchiveExample
//
// Created by Ben Ford on 4/21/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "Person.h"
@implementation Person
@synthesize firstName, lastName, age, isFullTime;
+ (Person *)defaultPerson {
return [[[Person alloc] init] autorelease];
}
- (id)init {
if( self = [super init] ) {
self.firstName = [NSString string];
self.lastName = [NSString string];
self.age = 0;
self.isFullTime = YES;
}
return self;
}
#pragma mark NSCoding
- (id)initWithCoder:(NSCoder *)coder {
self = [super init];
if( self ) {
self.firstName = [coder decodeObjectForKey:@"firstName"];
self.lastName = [coder decodeObjectForKey:@"lastName"];
- self.age = [[coder decodeObjectForKey:@"age"] intValue];
- self.age = [[coder decodeObjectForKey:@"isFullTime"] boolValue];
+ self.age = [coder decodeIntForKey:@"age"];
+ self.isFullTime = [coder decodeBoolForKey:@"isFullTime"];
}
return self;
}
- (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeObject:self.firstName forKey:@"firstName"];
[coder encodeObject:self.firstName forKey:@"firstName"];
- [coder encodeObject:[NSNumber numberWithInt:self.age] forKey:@"age"];
- [coder encodeObject:[NSNumber numberWithInt:self.isFullTime] forKey:@"isFullTime"];
+ [coder encodeInt:self.age forKey:@"age"];
+ [coder encodeBool:self.isFullTime forKey:@"isFullTime"];
}
#pragma mark -
- (void)dealloc {
self.firstName = nil;
self.lastName = nil;
[super dealloc];
}
@end
diff --git a/MainWindow.xib b/MainWindow.xib
index a4ac352..d9fcb35 100644
--- a/MainWindow.xib
+++ b/MainWindow.xib
@@ -1,548 +1,650 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
- <int key="IBDocument.SystemTarget">784</int>
- <string key="IBDocument.SystemVersion">10D573</string>
- <string key="IBDocument.InterfaceBuilderVersion">740</string>
+ <int key="IBDocument.SystemTarget">800</int>
+ <string key="IBDocument.SystemVersion">10D2125</string>
+ <string key="IBDocument.InterfaceBuilderVersion">762</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.HIToolboxVersion">460.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">62</string>
+ <string key="NS.object.0">87</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="15"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="841351856">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="427554174">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUICustomObject" id="664661524">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
- <object class="IBUICustomObject" id="664661524"/>
<object class="IBUITabBarController" id="675605402">
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
+ <int key="interfaceOrientation">1</int>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIHorizontal">NO</bool>
<object class="IBUIViewController" key="IBUISelectedViewController" id="780626317">
<string key="IBUITitle">Boss</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="211206031">
<string key="IBUITitle">Boss</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
<string key="IBUINibName">BossView</string>
+ <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
+ <int key="interfaceOrientation">1</int>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIHorizontal">NO</bool>
</object>
<object class="NSMutableArray" key="IBUIViewControllers">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="780626317"/>
<object class="IBUIViewController" id="404439053">
<string key="IBUITitle">Managers</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="415100502">
<string key="IBUITitle">Managers</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIParentViewController" ref="675605402"/>
+ <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
+ <int key="interfaceOrientation">1</int>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="976730607">
<string key="IBUITitle">Employees</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="582457009">
<string key="IBUITitle">Employees</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
<reference key="IBUIToolbarItems" ref="0"/>
<reference key="IBUIParentViewController" ref="675605402"/>
+ <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
+ <int key="interfaceOrientation">1</int>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIHorizontal">NO</bool>
+ </object>
+ <object class="IBUIViewController" id="619467790">
+ <string key="IBUITitle">View All</string>
+ <object class="IBUITabBarItem" key="IBUITabBarItem" id="461979782">
+ <string key="IBUITitle">View All</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUITabBar"/>
+ </object>
+ <reference key="IBUIToolbarItems" ref="0"/>
+ <reference key="IBUIParentViewController" ref="675605402"/>
+ <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
+ <int key="interfaceOrientation">1</int>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIHorizontal">NO</bool>
</object>
</object>
<object class="IBUITabBar" key="IBUITabBar" id="764819862">
<nil key="NSNextResponder"/>
<int key="NSvFlags">266</int>
<string key="NSFrame">{{129, 330}, {163, 49}}</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBUIWindow" id="117978783">
<nil key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 480}</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="841351856"/>
<reference key="destination" ref="664661524"/>
</object>
<int key="connectionID">4</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="117978783"/>
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">tabBar</string>
<reference key="source" ref="664661524"/>
<reference key="destination" ref="675605402"/>
</object>
<int key="connectionID">25</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="841351856"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="664661524"/>
<reference key="parent" ref="0"/>
<string key="objectName">NSArchiveExample App Delegate</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="427554174"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="117978783"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="675605402"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="764819862"/>
<reference ref="780626317"/>
<reference ref="404439053"/>
<reference ref="976730607"/>
+ <reference ref="619467790"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="764819862"/>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="780626317"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="211206031"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="404439053"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="415100502"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="415100502"/>
<reference key="parent" ref="404439053"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="211206031"/>
<reference key="parent" ref="780626317"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="976730607"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="582457009"/>
</object>
<reference key="parent" ref="675605402"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="582457009"/>
<reference key="parent" ref="976730607"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">26</int>
+ <reference key="object" ref="619467790"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="461979782"/>
+ </object>
+ <reference key="parent" ref="675605402"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">27</int>
+ <reference key="object" ref="461979782"/>
+ <reference key="parent" ref="619467790"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>12.IBEditorWindowLastContentRect</string>
<string>12.IBPluginDependency</string>
<string>15.IBEditorWindowLastContentRect</string>
<string>15.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>17.CustomClassName</string>
<string>17.IBPluginDependency</string>
<string>18.IBPluginDependency</string>
<string>19.IBPluginDependency</string>
<string>20.IBPluginDependency</string>
<string>3.CustomClassName</string>
<string>3.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UIApplication</string>
<string>UIResponder</string>
<string>{{525, 346}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string>{{0, 905}, {320, 480}}</string>
+ <string>{{40, 778}, {0, -22}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>BossViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>NSArchiveExampleAppDelegate</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">25</int>
+ <int key="maxID">27</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">BossViewController</string>
<string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">saveBoss</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>age</string>
+ <string>firstName</string>
+ <string>isFullTime</string>
+ <string>lastName</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UITextField</string>
+ <string>UITextField</string>
+ <string>UISwitch</string>
+ <string>UITextField</string>
+ </object>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/BossViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSArchiveExampleAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>tabBar</string>
<string>window</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>UITabBarController</string>
<string>UIWindow</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Classes/NSArchiveExampleAppDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSArchiveExampleAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
</object>
</object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="853905935">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIApplication</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIApplication.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIBarItem</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIBarItem.h</string>
</object>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIControl</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
+ </object>
+ </object>
<object class="IBPartialClassDescription">
<string key="className">UIResponder</string>
<string key="superclassName">NSObject</string>
<reference key="sourceIdentifier" ref="853905935"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchBar</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UISearchDisplayController</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
</object>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISwitch</string>
+ <string key="superclassName">UIControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISwitch.h</string>
+ </object>
+ </object>
<object class="IBPartialClassDescription">
<string key="className">UITabBar</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITabBarController</string>
<string key="superclassName">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="79470768">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UITabBarItem</string>
<string key="superclassName">UIBarItem</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITabBarItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
- <string key="className">UIView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="className">UITextField</string>
+ <string key="superclassName">UIControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="648731867">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
</object>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <reference key="sourceIdentifier" ref="648731867"/>
+ </object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<reference key="sourceIdentifier" ref="79470768"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIViewController</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIWindow</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIWindow.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">NSArchiveExample.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">3.1</string>
+ <string key="IBCocoaTouchPluginVersion">87</string>
</data>
</archive>
diff --git a/NSArchiveExample.xcodeproj/Ben.pbxuser b/NSArchiveExample.xcodeproj/Ben.pbxuser
index 0422a7b..b2680dc 100644
--- a/NSArchiveExample.xcodeproj/Ben.pbxuser
+++ b/NSArchiveExample.xcodeproj/Ben.pbxuser
@@ -1,126 +1,148 @@
// !$*UTF8*$!
{
1D3623240D0F684500981E51 /* NSArchiveExampleAppDelegate.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 529}";
};
};
1D3623250D0F684500981E51 /* NSArchiveExampleAppDelegate.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{266, 0}";
sepNavVisRange = "{0, 849}";
};
};
1D6058900D05DD3D006BFB54 /* NSArchiveExample */ = {
activeExec = 0;
executables = (
B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
);
};
29B97313FDCFA39411CA2CEA /* Project object */ = {
activeBuildConfigurationName = Debug;
activeExecutable = B5BFA7F6117F9A63008B450B /* NSArchiveExample */;
activeTarget = 1D6058900D05DD3D006BFB54 /* NSArchiveExample */;
addToTargets = (
1D6058900D05DD3D006BFB54 /* NSArchiveExample */,
);
codeSenseManager = B5BFA801117F9A81008B450B /* Code sense */;
executables = (
B5BFA7F6117F9A63008B450B /* NSArchiveExample */,
);
perUserDictionary = {
- PBXPerProjectTemplateStateSaveDate = 293575267;
- PBXWorkspaceStateSaveDate = 293575267;
+ PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
+ PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+ PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
+ PBXFileTableDataSourceColumnWidthsKey = (
+ 20,
+ 286,
+ 20,
+ 48.16259765625,
+ 43,
+ 43,
+ 20,
+ );
+ PBXFileTableDataSourceColumnsKey = (
+ PBXFileDataSource_FiletypeID,
+ PBXFileDataSource_Filename_ColumnID,
+ PBXFileDataSource_Built_ColumnID,
+ PBXFileDataSource_ObjectSize_ColumnID,
+ PBXFileDataSource_Errors_ColumnID,
+ PBXFileDataSource_Warnings_ColumnID,
+ PBXFileDataSource_Target_ColumnID,
+ );
+ };
+ PBXPerProjectTemplateStateSaveDate = 293613031;
+ PBXWorkspaceStateSaveDate = 293613031;
};
sourceControlManager = B5BFA800117F9A81008B450B /* Source Control */;
userBuildSettings = {
};
};
B5BFA7F6117F9A63008B450B /* NSArchiveExample */ = {
isa = PBXExecutable;
activeArgIndices = (
);
argumentStrings = (
);
autoAttachOnCrash = 1;
breakpointsEnabled = 0;
configStateDict = {
};
customDataFormattersEnabled = 1;
dataTipCustomDataFormattersEnabled = 1;
dataTipShowTypeColumn = 1;
dataTipSortType = 0;
debuggerPlugin = GDBDebugging;
disassemblyDisplayState = 0;
enableDebugStr = 1;
environmentEntries = (
);
executableSystemSymbolLevel = 0;
executableUserSymbolLevel = 0;
libgmallocEnabled = 0;
name = NSArchiveExample;
showTypeColumn = 0;
sourceDirectories = (
);
};
B5BFA800117F9A81008B450B /* Source Control */ = {
isa = PBXSourceControlManager;
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
repositoryNamesForRoots = {
"" = "";
};
};
};
B5BFA801117F9A81008B450B /* Code sense */ = {
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
B5BFA802117F9A96008B450B /* Persistance.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {800, 905}}";
sepNavSelRange = "{622, 0}";
sepNavVisRange = "{0, 628}";
};
};
B5BFA803117F9A96008B450B /* Persistance.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1450, 2472}}";
sepNavSelRange = "{2824, 0}";
sepNavVisRange = "{0, 1153}";
};
};
B5BFA81B117F9CAD008B450B /* Person.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
sepNavSelRange = "{511, 0}";
sepNavVisRange = "{0, 517}";
};
};
B5BFA81C117F9CAD008B450B /* Person.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
sepNavSelRange = "{260, 0}";
sepNavVisRange = "{0, 1166}";
};
};
B5BFA83B117FA0E3008B450B /* Model.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
sepNavSelRange = "{161, 0}";
sepNavVisRange = "{0, 181}";
};
};
B5BFA841117FA1AA008B450B /* BossViewController.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {925, 915}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 247}";
sepNavWindowFrame = "{{38, 157}, {1354, 1235}}";
};
};
}
|
bentford/NSArchiveExample
|
6c8e4f532059e50efdb94bfd76f190555b194e76
|
elaborated README
|
diff --git a/README b/README
index e6fbd28..7de7068 100644
--- a/README
+++ b/README
@@ -1,8 +1,23 @@
-This is a example of how you can use NSArchive instead of SqlLite or Core Data.
+Purpose:
+This is an example of how you can use NSArchive instead of SqlLite or Core Data.
+
+This is work in progress.
+
+The first tab saves and restores to the datastore.
+
+
+Coming Soon:
+Arrays and Dictionaries, oh my!
+
+
+---
+
+
+Why NSArchive?
Advantages:
-It is super simple and very nimble, and also scales fairly big.
+-It is super simple and very nimble, and also scales fairly big.
Disadvantages:
-Not a relational datastore and you can't do joins
+-Not a relational datastore and you can't do joins
|
bentford/NSArchiveExample
|
d88f64e1120d02ae7d3e309ebb2a4875422128dd
|
ignore build folder
|
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..378eac2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+build
|
Peeja/rubot
|
fd04d1444a0ddaf5b92f07e85cb3d082ad7e45a1
|
Fixing gemspec.
|
diff --git a/rubot.gemspec b/rubot.gemspec
index 20805e2..745fa9b 100644
--- a/rubot.gemspec
+++ b/rubot.gemspec
@@ -1,21 +1,20 @@
-(in /home/peeja/rubot)
Gem::Specification.new do |s|
s.name = %q{rubot}
s.version = "0.5.0"
s.date = %q{2008-04-30}
s.summary = %q{FIXME (describe your package)}
s.require_paths = ["lib", "ext"]
s.email = %q{peter.a.jaros@gmail.com}
s.homepage = %q{http://rubot.org/}
s.description = %q{FIXME (describe your package)}
s.default_executable = %q{rubot}
s.has_rdoc = true
s.authors = ["Peter Jaros (Peeja)"]
s.files = [".autotest", "Adapters.txt", "History.txt", "Manifest.txt", "README.txt", "Rakefile", "bin/rubot", "examples/navigate.rbt", "ext/rubot_aria/Makefile", "ext/rubot_aria/RAGenericAction.cpp", "ext/rubot_aria/RAGenericAction.h", "ext/rubot_aria/RAGenericAction.o", "ext/rubot_aria/RARobotManager.cpp", "ext/rubot_aria/RARobotManager.h", "ext/rubot_aria/RARobotManager.o", "ext/rubot_aria/extconf.rb", "ext/rubot_aria/rubot_aria.cpp", "ext/rubot_aria/rubot_aria.o", "ext/rubot_aria/rubot_aria.so", "lib/rubot.rb", "lib/rubot/adapters.rb", "lib/rubot/adapters/aria.rb", "lib/rubot/adapters/aria/action_desired.rb", "lib/rubot/adapters/aria/robot.rb", "lib/rubot/adapters/asimov.rb", "lib/rubot/dsl.rb", "lib/rubot/meta.rb", "spec/load_paths.rb", "spec/rubot/adapters/aria/robot_manager_spec.rb", "spec/rubot/adapters/aria/robot_spec.rb", "spec/rubot/adapters/aria_spec.rb", "spec/rubot/adapters/spec_helper.rb", "spec/rubot/dsl_spec.rb", "spec/rubot_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/ann.rake", "tasks/annotations.rake", "tasks/doc.rake", "tasks/gem.rake", "tasks/manifest.rake", "tasks/post_load.rake", "tasks/rubyforge.rake", "tasks/setup.rb", "tasks/spec.rake", "tasks/svn.rake", "tasks/test.rake"]
s.rdoc_options = ["--main", "README.txt"]
s.extra_rdoc_files = ["Adapters.txt", "History.txt", "README.txt", "bin/rubot"]
s.executables = ["rubot"]
s.extensions = ["ext/rubot_aria/extconf.rb"]
s.add_dependency(%q<rice>, [">= 1.0.1"])
s.add_dependency(%q<facets>, [">= 2.3.0"])
end
|
Peeja/rubot
|
657e7451324b13c07090f8ac23eb8f0bd072ac8b
|
Adding gemspec for GitHub.
|
diff --git a/rubot.gemspec b/rubot.gemspec
new file mode 100644
index 0000000..20805e2
--- /dev/null
+++ b/rubot.gemspec
@@ -0,0 +1,21 @@
+(in /home/peeja/rubot)
+Gem::Specification.new do |s|
+ s.name = %q{rubot}
+ s.version = "0.5.0"
+ s.date = %q{2008-04-30}
+ s.summary = %q{FIXME (describe your package)}
+ s.require_paths = ["lib", "ext"]
+ s.email = %q{peter.a.jaros@gmail.com}
+ s.homepage = %q{http://rubot.org/}
+ s.description = %q{FIXME (describe your package)}
+ s.default_executable = %q{rubot}
+ s.has_rdoc = true
+ s.authors = ["Peter Jaros (Peeja)"]
+ s.files = [".autotest", "Adapters.txt", "History.txt", "Manifest.txt", "README.txt", "Rakefile", "bin/rubot", "examples/navigate.rbt", "ext/rubot_aria/Makefile", "ext/rubot_aria/RAGenericAction.cpp", "ext/rubot_aria/RAGenericAction.h", "ext/rubot_aria/RAGenericAction.o", "ext/rubot_aria/RARobotManager.cpp", "ext/rubot_aria/RARobotManager.h", "ext/rubot_aria/RARobotManager.o", "ext/rubot_aria/extconf.rb", "ext/rubot_aria/rubot_aria.cpp", "ext/rubot_aria/rubot_aria.o", "ext/rubot_aria/rubot_aria.so", "lib/rubot.rb", "lib/rubot/adapters.rb", "lib/rubot/adapters/aria.rb", "lib/rubot/adapters/aria/action_desired.rb", "lib/rubot/adapters/aria/robot.rb", "lib/rubot/adapters/asimov.rb", "lib/rubot/dsl.rb", "lib/rubot/meta.rb", "spec/load_paths.rb", "spec/rubot/adapters/aria/robot_manager_spec.rb", "spec/rubot/adapters/aria/robot_spec.rb", "spec/rubot/adapters/aria_spec.rb", "spec/rubot/adapters/spec_helper.rb", "spec/rubot/dsl_spec.rb", "spec/rubot_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/ann.rake", "tasks/annotations.rake", "tasks/doc.rake", "tasks/gem.rake", "tasks/manifest.rake", "tasks/post_load.rake", "tasks/rubyforge.rake", "tasks/setup.rb", "tasks/spec.rake", "tasks/svn.rake", "tasks/test.rake"]
+ s.rdoc_options = ["--main", "README.txt"]
+ s.extra_rdoc_files = ["Adapters.txt", "History.txt", "README.txt", "bin/rubot"]
+ s.executables = ["rubot"]
+ s.extensions = ["ext/rubot_aria/extconf.rb"]
+ s.add_dependency(%q<rice>, [">= 1.0.1"])
+ s.add_dependency(%q<facets>, [">= 2.3.0"])
+end
|
Peeja/rubot
|
a4c22695309aaa39e2c47a363853c483399a3193
|
Using ARG to fix segfault. Aria behaviors now never die; using a mark function instead would fix this.
|
diff --git a/ext/rubot_aria/RAGenericAction.cpp b/ext/rubot_aria/RAGenericAction.cpp
index ad1f4f3..da1a719 100644
--- a/ext/rubot_aria/RAGenericAction.cpp
+++ b/ext/rubot_aria/RAGenericAction.cpp
@@ -1,81 +1,87 @@
#include "rice/Object.hpp"
#include "rice/Data_Type.hpp"
#include "rice/Symbol.hpp"
#include "rice/Exception.hpp"
#include "Aria.h"
#include "RAGenericAction.h"
using namespace Rice;
RAGenericAction::RAGenericAction(const char *name)
: ArAction(name)
{
ArLog::log(ArLog::Normal, "Created generic action \"%s\".", name);
myFireProc = NULL;
+ myFireProc_guard = NULL;
// Sensors
mySonar = NULL;
}
RAGenericAction::~RAGenericAction()
{
- if (myFireProc != NULL)
+ if (myFireProc != NULL) {
delete myFireProc;
+ delete myFireProc_guard;
+ }
ArLog::log(ArLog::Normal, "Destroyed generic action \"%s\".", getName());
}
ArActionDesired *RAGenericAction::fire(ArActionDesired currentDesired)
{
myDesired.reset();
// FIXME: myFireProc eventually has type 0 (T_NONE), and calling #call segfaults.
// Only happens when multiple behaviors are used at once.
// if (myFireProc != NULL && myFireProc->rb_type() == 0)
// ArLog::log(ArLog::Normal, "Proc has type: %d.", myFireProc->rb_type());
if (myFireProc != NULL)
myFireProc->call("call");
return &myDesired;
}
void RAGenericAction::setFireProc(Object proc)
{
if (!proc.is_a(rb_cProc))
throw Exception(rb_eArgError, "proc needs to be a Proc.");
- if (myFireProc != NULL)
+ if (myFireProc != NULL) {
delete myFireProc;
+ delete myFireProc_guard;
+ }
myFireProc = new Object(proc);
+ myFireProc_guard = new Address_Registration_Guard(myFireProc);
}
void RAGenericAction::setSensors(Object sensors)
{
// TODO: Make sure rubot_aria supports the given sensors.
// ArLog::log(ArLog::Normal, "Action \"%s\"'s sensors started with \"%s\".", getName(), Symbol(mySensors.call("first")).c_str());
mySensors.call("replace", Array(sensors));
// ArLog::log(ArLog::Normal, "Action \"%s\"'s sensors now start with \"%s\".", getName(), Symbol(mySensors.call("first")).c_str());
}
void RAGenericAction::setRobot(ArRobot *robot)
{
ArAction::setRobot(robot);
ArLog::log(ArLog::Normal, "Setting robot for action \"%s\".", getName());
// Acquire sensors.
// TODO: Handle robot not supporting sensors better.
for (Array::iterator it = mySensors.begin(); it != mySensors.end(); ++it) {
if (*it == Symbol("sonar")) {
ArLog::log(ArLog::Normal, "Adding sonar.");
mySonar = robot->findRangeDevice("sonar");
}
}
}
Object RAGenericAction::getSensor(Symbol sensor)
{
if (sensor == Symbol("sonar") && mySonar)
return to_ruby(mySonar);
else
return Object(Qnil);
}
diff --git a/ext/rubot_aria/RAGenericAction.h b/ext/rubot_aria/RAGenericAction.h
index ed783cf..ecb8cc2 100644
--- a/ext/rubot_aria/RAGenericAction.h
+++ b/ext/rubot_aria/RAGenericAction.h
@@ -1,94 +1,96 @@
#pragma once
#include "rice/Array.hpp"
#include "rice/Object.hpp"
#include "rice/Data_Object.hpp"
+#include "rice/Address_Registration_Guard.hpp"
#include "Aria.h"
/*
* RAGenericAction
* Generic ArAction that runs a Ruby proc when it fires.
*
*/
class RAGenericAction : public ArAction
{
public:
RAGenericAction(const char *name);
virtual ~RAGenericAction(void);
virtual ArActionDesired *fire(ArActionDesired currentDesired);
void setFireProc(Rice::Object proc);
void setSensors(Rice::Object sensors);
Rice::Object getSensor(Rice::Symbol sensor);
virtual void setRobot(ArRobot *robot);
ArActionDesired *getActionDesired() { return &myDesired; }
protected:
ArActionDesired myDesired;
Rice::Object *myFireProc;
+ Rice::Address_Registration_Guard *myFireProc_guard;
Rice::Array mySensors;
// Sensors
ArRangeDevice *mySonar;
};
// We need a disposable wrapper for ArActionDesired which Ruby can GC at its
// pleasure. This class delegates all calls to its wrapped ArActionDesired.
// We have to duplicate the entirety of the interface we want Ruby to be able
// to use. It would be nice to automate this somehow with macros.
class ArActionDesiredWrap
{
public:
ArActionDesiredWrap(ArActionDesired *obj) { myObj = obj; }
virtual ~ArActionDesiredWrap() {}
double getVel() const { return myObj->getVel(); }
double getVelStrength() const { return myObj->getVelStrength(); }
void setVel(double vel, double strength) const { myObj->setVel(vel, strength); }
double getDeltaHeading() const { return myObj->getDeltaHeading(); }
double getDeltaHeadingStrength() const { return myObj->getDeltaHeadingStrength(); }
void setDeltaHeading(double deltaHeading, double strength) const { myObj->setDeltaHeading(deltaHeading, strength); }
double getHeading() const { return myObj->getHeading(); }
double getHeadingStrength() const { return myObj->getHeadingStrength(); }
void setHeading(double heading, double strength) const { myObj->setHeading(heading, strength); }
private:
ArActionDesired *myObj;
};
template<>
inline
Rice::Object to_ruby<ArActionDesired *>(ArActionDesired * const & x)
{
return Rice::Data_Object<ArActionDesiredWrap>(new ArActionDesiredWrap(x));
}
// We also need a wrapper for ArRangeDevice.
class ArRangeDeviceWrap
{
public:
ArRangeDeviceWrap(ArRangeDevice *obj) { myObj = obj; }
virtual ~ArRangeDeviceWrap() { }
double currentReadingPolar(double startAngle, double endAngle)
{
return myObj->currentReadingPolar(startAngle, endAngle, NULL);
}
private:
ArRangeDevice *myObj;
};
template<>
inline
Rice::Object to_ruby<ArRangeDevice *>(ArRangeDevice * const & x)
{
return Rice::Data_Object<ArRangeDeviceWrap>(new ArRangeDeviceWrap(x));
}
|
Peeja/rubot
|
eb1ca8a21fca76b1c2e5a8a7b0995395eb1c0416
|
Final sweep before freezing for Senior Project.
|
diff --git a/.autotest b/.autotest
index e91a6d2..610e83e 100644
--- a/.autotest
+++ b/.autotest
@@ -1,20 +1,4 @@
Autotest.add_hook :initialize do |at|
# Ignore the ._* files TextMate likes to leave about.
at.add_exception(/\/\._[^\/]*$/)
-
- # Set up mapping for extensions.
- # When foo.so is changed, rerun all specs under spec/ext/foo/.
- at.add_mapping(/\/([^\/]*).so$/) do |f, m|
- ext = m[1]
- r = Regexp.new("ext/#{ext}/.*_spec\.rb$")
- at.files_matching r
- end
-
- # Set up mapping for spec helpers.
- # When foo/spec_helper.rb is changed, rerun all specs under foo/.
- # Doesn't do anything; not sure why.
- # at.add_mapping(/^(.*)\/spec_helper.rb$/) do |f, m|
- # dir = m[1]
- # Dir["#{dir}/**/*.rb"]
- # end
end
diff --git a/.gitignore b/.gitignore
index 8c2e3bc..dc3650f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,5 @@
._*
.DS_Store
doc
coverage
pkg
-
-# Used locally for testing Rubot. Convenient to keep it in the tree.
-test.rb
\ No newline at end of file
diff --git a/Adapters.txt b/Adapters.txt
index 7f8b9a1..7cda4ce 100644
--- a/Adapters.txt
+++ b/Adapters.txt
@@ -1,3 +1,3 @@
== Writing a Rubot Adapter
-FIXME (stub)
\ No newline at end of file
+FIXME (stub)
diff --git a/History.txt b/History.txt
index 41ac151..5da0d34 100644
--- a/History.txt
+++ b/History.txt
@@ -1,4 +1,4 @@
-== 1.0.0 / 2008-02-22
+== 0.5.0 / 2008-04-22
-* 1 major enhancement
- * Birthday!
+* First Release
+ * Major Bug: Segfaults when multiple behaviors run at once.
\ No newline at end of file
diff --git a/Manifest.txt b/Manifest.txt
index 3c903b9..c345a2d 100644
--- a/Manifest.txt
+++ b/Manifest.txt
@@ -1,52 +1,47 @@
.autotest
Adapters.txt
History.txt
Manifest.txt
-Notes.txt
README.txt
Rakefile
bin/rubot
-examples/test1.rb
+examples/navigate.rbt
ext/rubot_aria/Makefile
ext/rubot_aria/RAGenericAction.cpp
ext/rubot_aria/RAGenericAction.h
ext/rubot_aria/RAGenericAction.o
-ext/rubot_aria/RARangeDevice.cpp
-ext/rubot_aria/RARangeDevice.h
-ext/rubot_aria/RARangeDevice.o
ext/rubot_aria/RARobotManager.cpp
ext/rubot_aria/RARobotManager.h
ext/rubot_aria/RARobotManager.o
ext/rubot_aria/extconf.rb
ext/rubot_aria/rubot_aria.cpp
ext/rubot_aria/rubot_aria.o
ext/rubot_aria/rubot_aria.so
-ext/rubot_asimov/extconf.rb
-ext/rubot_asimov/rubot_asimov.c
lib/rubot.rb
lib/rubot/adapters.rb
lib/rubot/adapters/aria.rb
+lib/rubot/adapters/aria/action_desired.rb
lib/rubot/adapters/aria/robot.rb
lib/rubot/adapters/asimov.rb
lib/rubot/dsl.rb
lib/rubot/meta.rb
spec/load_paths.rb
spec/rubot/adapters/aria/robot_manager_spec.rb
spec/rubot/adapters/aria/robot_spec.rb
spec/rubot/adapters/aria_spec.rb
spec/rubot/adapters/spec_helper.rb
spec/rubot/dsl_spec.rb
spec/rubot_spec.rb
spec/spec.opts
spec/spec_helper.rb
tasks/ann.rake
tasks/annotations.rake
tasks/doc.rake
tasks/gem.rake
tasks/manifest.rake
tasks/post_load.rake
tasks/rubyforge.rake
tasks/setup.rb
tasks/spec.rake
tasks/svn.rake
tasks/test.rake
diff --git a/Notes.txt b/Notes.txt
deleted file mode 100644
index 284e162..0000000
--- a/Notes.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-----
-Notes
- This file should not be included in distributions.
-----
-
-This code:
-
- robot :fred do
- adapter :aria
- end
-
-creates a new robot named 'fred' using the Aria adapter. This means that fred will be a Rubot::Adapters::Aria::Robot, a subclass of Rubot::Robot.
-
-
-Rubot API:
-
- Rubot.add_robot(name, adapter, options={})
- Creates a new robot with given name using given adapter.
-
- Rubot.robots
- Returns the robots currently in service.
-
-
diff --git a/README.txt b/README.txt
index 0550db1..56700c6 100644
--- a/README.txt
+++ b/README.txt
@@ -1,53 +1,53 @@
IMPORTANT:
This version of Rubot is incomplete and presented publicly for the sole purpose (currently) of discussion and testing. Many things are broken, many files are incomplete. Even this README needs a good deal of work.
=====
rubot
- by FIXME (your name)
- FIXME (url)
+ by Peter Jaros (Peeja) <peter.a.jaros@gmail.com>
+ http://rubot.org/ (pending)
== DESCRIPTION:
FIXME (describe your package)
== FEATURES/PROBLEMS:
* FIXME (list of features or problems)
== SYNOPSIS:
- FIXME (code sample of usage)
+ rubot mycode.rbt
== REQUIREMENTS:
* FIXME (list of requirements)
== INSTALL:
* FIXME (sudo gem install, anything else)
== LICENSE:
(The MIT License)
Copyright (c) 2008
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Rakefile b/Rakefile
index f7fe790..9e31138 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,27 +1,31 @@
# Look in the tasks/setup.rb file for the various options that can be
# configured in this Rakefile. The .rake files in the tasks directory
# are where the options are used.
load 'tasks/setup.rb'
ensure_in_path 'lib'
require 'rubot'
task :default => 'spec:run'
PROJ.name = 'rubot'
PROJ.authors = 'Peter Jaros (Peeja)'
PROJ.email = 'peter.a.jaros@gmail.com'
-PROJ.url = 'FIXME (project homepage)'
-PROJ.rubyforge_name = 'rubot'
+PROJ.url = 'http://rubot.org/'
+# PROJ.rubyforge_name = 'rubot'
+PROJ.version = Rubot.version
+
+PROJ.executables = ['rubot']
+PROJ.dependencies << ['rice', '>= 1.0.1'] << ['facets', '>= 2.3.0']
PROJ.spec_opts += File.read('spec/spec.opts').split
PROJ.spec_opts << '-fs'
# Don't expect test coverage of any file with an absolute path.
PROJ.rcov_opts << '--exclude' << '^/' << '--exclude' << 'meta.rb$'
PROJ.rcov_threshold_exact = true
PROJ.exclude << '^\.git/' << '\.gitignore$' << '/\.DS_Store$' << '^\.DS_Store$' << '/\._' << '^\._' << 'mkmf.log'
# EOF
diff --git a/bin/rubot b/bin/rubot
index 1a4b2b6..ad48156 100755
--- a/bin/rubot
+++ b/bin/rubot
@@ -1,20 +1,20 @@
#!/usr/bin/env ruby
require 'rubygems'
-require 'main'
+# require 'main'
require 'rubot'
# Main do
# argument 'file' do
# required
# description 'Rubot file to run'
# end
#
# def run
# include Rubot::DSL
# load params['file']
# end
# end
include Rubot::DSL
load ARGV[0]
diff --git a/examples/navigate.rbt b/examples/navigate.rbt
new file mode 100644
index 0000000..28faabc
--- /dev/null
+++ b/examples/navigate.rbt
@@ -0,0 +1,60 @@
+# navigate.rbt
+
+# Make a behavior to go forward, slowing when we approach an obstacle.
+
+behavior :go => [:max_speed, :stop_distance] do
+ sensors :sonar
+
+ fire do
+ range = sonar.range(-70,70) - robot.radius
+ if range > stop_distance
+ speed = range * 0.3
+ speed = max_speed if (speed > max_speed)
+ desired.velocity = speed
+ else
+ desired.velocity = 0
+ end
+ end
+end
+
+
+# Make another behavior to turn us around objects we can avoid.
+
+behavior :turn => [:turn_threshold, :turn_amount] do
+ sensors :sonar
+
+ fire do
+ # Get the left readings and right readings off of the sonar
+ left_range = sonar.range(0,100) - robot.radius
+ right_range = sonar.range(-100,0) - robot.radius
+ if left_range > turn_threshold && right_range > turn_threshold
+ # if neither left nor right range is within the turn threshold,
+ # reset the turning variable and don't turn
+ turn_direction = nil
+ desired.delta_heading = 0;
+ else
+ turn_direction ||= (left_range < right_range ? :left : :right)
+ desired.delta_heading = turn_amount * ( turn_direction == :left ? -1 : 1 )
+ end
+ end
+end
+
+
+# Set up a robot.
+
+robot :fred do
+ adapter :aria
+ host 'localhost'
+
+ sensors :sonar
+
+ behaviors do
+ go :priority => 50, :max_speed => 240, :stop_distance => 300
+ turn :priority => 49, :turn_threshold => 400, :turn_amount => 10
+ end
+end
+
+
+# Run it.
+
+run :fred
diff --git a/examples/test1.rb b/examples/test1.rb
deleted file mode 100644
index 2edf8a5..0000000
--- a/examples/test1.rb
+++ /dev/null
@@ -1 +0,0 @@
-require 'rubot'
\ No newline at end of file
diff --git a/ext/rubot_asimov/extconf.rb b/ext/rubot_asimov/extconf.rb
deleted file mode 100644
index 5ec9407..0000000
--- a/ext/rubot_asimov/extconf.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'mkmf'
-
-# puts "$configure_args:"
-# p $configure_args
-# puts "ARGV:"
-# p ARGV
-# puts "PWD: #{ENV['PWD']}"
-#
-# exit 1
-
-create_makefile('rubot_asimov')
\ No newline at end of file
diff --git a/ext/rubot_asimov/rubot_asimov.c b/ext/rubot_asimov/rubot_asimov.c
deleted file mode 100644
index e3c0b25..0000000
--- a/ext/rubot_asimov/rubot_asimov.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "ruby.h"
-
-void Init_rubot_asimov()
-{
- // Define Rubot::Adapters::Asimov
- VALUE rb_MRubot = rb_const_get(rb_cObject, rb_intern("Rubot"));
- VALUE rb_MAdapters = rb_const_get(rb_MRubot,rb_intern("Adapters"));
- VALUE rb_MAsimov = rb_define_module_under(rb_MAdapters, "Asimov");
-
- // Define Rubot::Adapters::Asimov::Robot
- VALUE rb_cRobot = rb_const_get(rb_MRubot, rb_intern("Robot"));
- VALUE rb_cAsimovRobot = rb_define_class_under(rb_MAsimov, "Robot", rb_cRobot);
-}
diff --git a/lib/rubot/meta.rb b/lib/rubot/meta.rb
index be6125b..6ad68e1 100644
--- a/lib/rubot/meta.rb
+++ b/lib/rubot/meta.rb
@@ -1,13 +1,13 @@
module Rubot
# :stopdoc:
- VERSION = '1.0.0'
+ VERSION = '0.5.0'
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
# :startdoc:
# Returns the version string for the library.
#
def self.version
VERSION
end
end
|
Peeja/rubot
|
7e78e094557903b3bf470d23822861ca58edf469
|
Wrapped ArRangeDevice the right way and removed RARangeDevice. Segfaults after a while when more than one behavior is used at once.
|
diff --git a/ext/rubot_aria/RAGenericAction.cpp b/ext/rubot_aria/RAGenericAction.cpp
index 8b76a57..ad1f4f3 100644
--- a/ext/rubot_aria/RAGenericAction.cpp
+++ b/ext/rubot_aria/RAGenericAction.cpp
@@ -1,97 +1,81 @@
+#include "rice/Object.hpp"
#include "rice/Data_Type.hpp"
#include "rice/Symbol.hpp"
#include "rice/Exception.hpp"
#include "Aria.h"
#include "RAGenericAction.h"
-#include "RARangeDevice.h"
using namespace Rice;
RAGenericAction::RAGenericAction(const char *name)
: ArAction(name)
{
ArLog::log(ArLog::Normal, "Created generic action \"%s\".", name);
myFireProc = NULL;
// Sensors
mySonar = NULL;
}
RAGenericAction::~RAGenericAction()
{
if (myFireProc != NULL)
delete myFireProc;
- if (mySonar != NULL)
- delete mySonar;
ArLog::log(ArLog::Normal, "Destroyed generic action \"%s\".", getName());
}
ArActionDesired *RAGenericAction::fire(ArActionDesired currentDesired)
{
myDesired.reset();
-
+
+ // FIXME: myFireProc eventually has type 0 (T_NONE), and calling #call segfaults.
+ // Only happens when multiple behaviors are used at once.
+ // if (myFireProc != NULL && myFireProc->rb_type() == 0)
+ // ArLog::log(ArLog::Normal, "Proc has type: %d.", myFireProc->rb_type());
+
if (myFireProc != NULL)
myFireProc->call("call");
return &myDesired;
}
void RAGenericAction::setFireProc(Object proc)
{
if (!proc.is_a(rb_cProc))
throw Exception(rb_eArgError, "proc needs to be a Proc.");
if (myFireProc != NULL)
delete myFireProc;
myFireProc = new Object(proc);
}
void RAGenericAction::setSensors(Object sensors)
{
// TODO: Make sure rubot_aria supports the given sensors.
// ArLog::log(ArLog::Normal, "Action \"%s\"'s sensors started with \"%s\".", getName(), Symbol(mySensors.call("first")).c_str());
mySensors.call("replace", Array(sensors));
// ArLog::log(ArLog::Normal, "Action \"%s\"'s sensors now start with \"%s\".", getName(), Symbol(mySensors.call("first")).c_str());
}
void RAGenericAction::setRobot(ArRobot *robot)
{
ArAction::setRobot(robot);
ArLog::log(ArLog::Normal, "Setting robot for action \"%s\".", getName());
// Acquire sensors.
// TODO: Handle robot not supporting sensors better.
for (Array::iterator it = mySensors.begin(); it != mySensors.end(); ++it) {
if (*it == Symbol("sonar")) {
ArLog::log(ArLog::Normal, "Adding sonar.");
- if (mySonar != NULL)
- delete mySonar;
- ArRangeDevice *ariaSonar = robot->findRangeDevice("sonar");
- mySonar = (ariaSonar ? new RARangeDevice(ariaSonar) : NULL);
+ mySonar = robot->findRangeDevice("sonar");
}
}
}
Object RAGenericAction::getSensor(Symbol sensor)
{
if (sensor == Symbol("sonar") && mySonar)
- // FIXME: Is this bad memory management?
- return Data_Object<RARangeDevice>(mySonar);
+ return to_ruby(mySonar);
else
return Object(Qnil);
}
-
-// RARangeDevice *RAGenericAction::getSensor(Symbol sensor)
-// {
-// if (sensor == Symbol("sonar") && mySonar)
-// return mySonar;
-// else
-// return NULL;
-// }
-
-// Object RAGenericAction::getActionDesired()
-// {
-// return Data_Object<ArActionDesired>(&myDesired);
-// // return to_ruby<ArActionDesired *>(&myDesired);
-// // return Object(Qnil);
-// }
diff --git a/ext/rubot_aria/RAGenericAction.h b/ext/rubot_aria/RAGenericAction.h
index 2c02aae..ed783cf 100644
--- a/ext/rubot_aria/RAGenericAction.h
+++ b/ext/rubot_aria/RAGenericAction.h
@@ -1,72 +1,94 @@
#pragma once
#include "rice/Array.hpp"
#include "rice/Object.hpp"
#include "rice/Data_Object.hpp"
#include "Aria.h"
-#include "RARangeDevice.h"
-
/*
* RAGenericAction
* Generic ArAction that runs a Ruby proc when it fires.
*
*/
class RAGenericAction : public ArAction
{
public:
RAGenericAction(const char *name);
virtual ~RAGenericAction(void);
virtual ArActionDesired *fire(ArActionDesired currentDesired);
void setFireProc(Rice::Object proc);
void setSensors(Rice::Object sensors);
Rice::Object getSensor(Rice::Symbol sensor);
- // RARangeDevice *getSensor(Rice::Symbol sensor);
virtual void setRobot(ArRobot *robot);
ArActionDesired *getActionDesired() { return &myDesired; }
protected:
ArActionDesired myDesired;
Rice::Object *myFireProc;
Rice::Array mySensors;
// Sensors
- RARangeDevice *mySonar;
+ ArRangeDevice *mySonar;
};
// We need a disposable wrapper for ArActionDesired which Ruby can GC at its
// pleasure. This class delegates all calls to its wrapped ArActionDesired.
// We have to duplicate the entirety of the interface we want Ruby to be able
// to use. It would be nice to automate this somehow with macros.
class ArActionDesiredWrap
{
public:
ArActionDesiredWrap(ArActionDesired *obj) { myObj = obj; }
virtual ~ArActionDesiredWrap() {}
double getVel() const { return myObj->getVel(); }
double getVelStrength() const { return myObj->getVelStrength(); }
void setVel(double vel, double strength) const { myObj->setVel(vel, strength); }
double getDeltaHeading() const { return myObj->getDeltaHeading(); }
double getDeltaHeadingStrength() const { return myObj->getDeltaHeadingStrength(); }
void setDeltaHeading(double deltaHeading, double strength) const { myObj->setDeltaHeading(deltaHeading, strength); }
double getHeading() const { return myObj->getHeading(); }
double getHeadingStrength() const { return myObj->getHeadingStrength(); }
void setHeading(double heading, double strength) const { myObj->setHeading(heading, strength); }
private:
ArActionDesired *myObj;
};
-
template<>
inline
Rice::Object to_ruby<ArActionDesired *>(ArActionDesired * const & x)
{
return Rice::Data_Object<ArActionDesiredWrap>(new ArActionDesiredWrap(x));
}
+
+
+// We also need a wrapper for ArRangeDevice.
+
+class ArRangeDeviceWrap
+{
+public:
+ ArRangeDeviceWrap(ArRangeDevice *obj) { myObj = obj; }
+ virtual ~ArRangeDeviceWrap() { }
+
+ double currentReadingPolar(double startAngle, double endAngle)
+ {
+ return myObj->currentReadingPolar(startAngle, endAngle, NULL);
+ }
+
+private:
+ ArRangeDevice *myObj;
+};
+
+
+template<>
+inline
+Rice::Object to_ruby<ArRangeDevice *>(ArRangeDevice * const & x)
+{
+ return Rice::Data_Object<ArRangeDeviceWrap>(new ArRangeDeviceWrap(x));
+}
diff --git a/ext/rubot_aria/RARangeDevice.cpp b/ext/rubot_aria/RARangeDevice.cpp
deleted file mode 100644
index 5548b45..0000000
--- a/ext/rubot_aria/RARangeDevice.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "Aria.h"
-
-#include "RARangeDevice.h"
-
-RARangeDevice::RARangeDevice(ArRangeDevice *rangeDevice)
-{
- myRangeDevice = rangeDevice;
-}
-
-double RARangeDevice::range(double startAngle, double endAngle)
-{
- return myRangeDevice->currentReadingPolar(startAngle, endAngle, NULL);
-}
diff --git a/ext/rubot_aria/RARangeDevice.h b/ext/rubot_aria/RARangeDevice.h
deleted file mode 100644
index 18d22bc..0000000
--- a/ext/rubot_aria/RARangeDevice.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#pragma once
-
-#include "Aria.h"
-
-/*
- * RARangeDevice
- * Wraps an ArRangeDevice to provide a nicer interface.
- *
- */
-
-class RARangeDevice
-{
-public:
- RARangeDevice(ArRangeDevice *rangeDevice);
- virtual ~RARangeDevice() {};
- double range(double startAngle, double endAngle);
-
-private:
- ArRangeDevice *myRangeDevice;
-};
diff --git a/ext/rubot_aria/rubot_aria.cpp b/ext/rubot_aria/rubot_aria.cpp
index 67a0bc4..52a17f4 100644
--- a/ext/rubot_aria/rubot_aria.cpp
+++ b/ext/rubot_aria/rubot_aria.cpp
@@ -1,64 +1,63 @@
#include "rice/Module.hpp"
#include "rice/Data_Type.hpp"
#include "rice/Constructor.hpp"
#include "rice/Exception.hpp"
#include "rice/Array.hpp"
#include "Aria.h"
#include "RAGenericAction.h"
#include "RARobotManager.h"
-#include "RARangeDevice.h"
using namespace std;
using namespace Rice;
extern "C"
void Init_rubot_aria()
{
static char inited = 0;
if (!inited) Aria::init(Aria::SIGHANDLE_NONE);
inited = 1;
Object rb_MRubot = Class(rb_cObject).const_get("Rubot");
Object rb_MAdapters = Module(rb_MRubot).const_get("Adapters");
Object rb_MAria = Module(rb_MAdapters)
.define_module("Aria")
;
Data_Type<RARobotManager> rb_cRobotManager = Module(rb_MAria)
.define_class<RARobotManager>("RobotManager")
.define_constructor(Constructor<RARobotManager>())
.define_method("go", &RARobotManager::go)
.define_method("add_behavior", &RARobotManager::addAction)
.define_method("add_sensor", &RARobotManager::addSensor)
.define_method("robot_radius", &RARobotManager::getRobotRadius)
;
Data_Type<RAGenericAction> rb_cBehavior = Module(rb_MAria)
.define_class<RAGenericAction>("Behavior")
.define_constructor(Constructor<RAGenericAction, const char *>())
.define_method("set_fire_proc", &RAGenericAction::setFireProc)
.define_method("set_sensors", &RAGenericAction::setSensors)
.define_method("get_sensor", &RAGenericAction::getSensor)
.define_method("get_desired", &RAGenericAction::getActionDesired)
;
Data_Type<ArActionDesiredWrap> rb_cActionDesired = Module(rb_MAria)
.define_class<ArActionDesiredWrap>("ActionDesired")
.define_method("velocity", &ArActionDesiredWrap::getVel)
.define_method("velocity_strength", &ArActionDesiredWrap::getVelStrength)
.define_method("set_velocity", &ArActionDesiredWrap::setVel)
.define_method("delta_heading", &ArActionDesiredWrap::getDeltaHeading)
.define_method("delta_heading_strength", &ArActionDesiredWrap::getDeltaHeadingStrength)
.define_method("set_delta_heading", &ArActionDesiredWrap::setDeltaHeading)
.define_method("heading", &ArActionDesiredWrap::getHeading)
.define_method("heading_strength", &ArActionDesiredWrap::getHeadingStrength)
.define_method("set_heading", &ArActionDesiredWrap::setHeading)
;
- Data_Type<RARangeDevice> rb_cRangeDevice = Module(rb_MAria)
- .define_class<RARangeDevice>("RangeDevice")
- .define_method("range", &RARangeDevice::range)
- ;
+ Data_Type<ArRangeDeviceWrap> rb_cRangeDevice = Module(rb_MAria)
+ .define_class<ArRangeDeviceWrap>("RangeDevice")
+ .define_method("range", &ArRangeDeviceWrap::currentReadingPolar)
+ ;
}
|
Peeja/rubot
|
74a4e46d5cbb47d359297a9d872a97666197722f
|
ArActionDesired wrapped.
|
diff --git a/ext/rubot_aria/RAGenericAction.cpp b/ext/rubot_aria/RAGenericAction.cpp
index 273646e..8b76a57 100644
--- a/ext/rubot_aria/RAGenericAction.cpp
+++ b/ext/rubot_aria/RAGenericAction.cpp
@@ -1,89 +1,97 @@
#include "rice/Data_Type.hpp"
#include "rice/Symbol.hpp"
#include "rice/Exception.hpp"
#include "Aria.h"
#include "RAGenericAction.h"
#include "RARangeDevice.h"
using namespace Rice;
RAGenericAction::RAGenericAction(const char *name)
: ArAction(name)
{
ArLog::log(ArLog::Normal, "Created generic action \"%s\".", name);
myFireProc = NULL;
// Sensors
mySonar = NULL;
}
RAGenericAction::~RAGenericAction()
{
if (myFireProc != NULL)
delete myFireProc;
if (mySonar != NULL)
delete mySonar;
ArLog::log(ArLog::Normal, "Destroyed generic action \"%s\".", getName());
}
ArActionDesired *RAGenericAction::fire(ArActionDesired currentDesired)
{
myDesired.reset();
if (myFireProc != NULL)
myFireProc->call("call");
return &myDesired;
}
void RAGenericAction::setFireProc(Object proc)
{
if (!proc.is_a(rb_cProc))
throw Exception(rb_eArgError, "proc needs to be a Proc.");
if (myFireProc != NULL)
delete myFireProc;
myFireProc = new Object(proc);
}
void RAGenericAction::setSensors(Object sensors)
{
// TODO: Make sure rubot_aria supports the given sensors.
// ArLog::log(ArLog::Normal, "Action \"%s\"'s sensors started with \"%s\".", getName(), Symbol(mySensors.call("first")).c_str());
mySensors.call("replace", Array(sensors));
// ArLog::log(ArLog::Normal, "Action \"%s\"'s sensors now start with \"%s\".", getName(), Symbol(mySensors.call("first")).c_str());
}
void RAGenericAction::setRobot(ArRobot *robot)
{
ArAction::setRobot(robot);
ArLog::log(ArLog::Normal, "Setting robot for action \"%s\".", getName());
// Acquire sensors.
// TODO: Handle robot not supporting sensors better.
for (Array::iterator it = mySensors.begin(); it != mySensors.end(); ++it) {
if (*it == Symbol("sonar")) {
ArLog::log(ArLog::Normal, "Adding sonar.");
if (mySonar != NULL)
delete mySonar;
ArRangeDevice *ariaSonar = robot->findRangeDevice("sonar");
mySonar = (ariaSonar ? new RARangeDevice(ariaSonar) : NULL);
}
}
}
Object RAGenericAction::getSensor(Symbol sensor)
{
if (sensor == Symbol("sonar") && mySonar)
// FIXME: Is this bad memory management?
return Data_Object<RARangeDevice>(mySonar);
else
return Object(Qnil);
}
-Object RAGenericAction::getActionDesired()
-{
- return Data_Object<ArActionDesired>(&myDesired);
- // return to_ruby<ArActionDesired *>(&myDesired);
- // return Object(Qnil);
-}
+// RARangeDevice *RAGenericAction::getSensor(Symbol sensor)
+// {
+// if (sensor == Symbol("sonar") && mySonar)
+// return mySonar;
+// else
+// return NULL;
+// }
+
+// Object RAGenericAction::getActionDesired()
+// {
+// return Data_Object<ArActionDesired>(&myDesired);
+// // return to_ruby<ArActionDesired *>(&myDesired);
+// // return Object(Qnil);
+// }
diff --git a/ext/rubot_aria/RAGenericAction.h b/ext/rubot_aria/RAGenericAction.h
index 4ccd1b2..2c02aae 100644
--- a/ext/rubot_aria/RAGenericAction.h
+++ b/ext/rubot_aria/RAGenericAction.h
@@ -1,37 +1,72 @@
#pragma once
#include "rice/Array.hpp"
#include "rice/Object.hpp"
#include "rice/Data_Object.hpp"
#include "Aria.h"
#include "RARangeDevice.h"
/*
* RAGenericAction
* Generic ArAction that runs a Ruby proc when it fires.
*
*/
class RAGenericAction : public ArAction
{
public:
RAGenericAction(const char *name);
virtual ~RAGenericAction(void);
virtual ArActionDesired *fire(ArActionDesired currentDesired);
void setFireProc(Rice::Object proc);
void setSensors(Rice::Object sensors);
Rice::Object getSensor(Rice::Symbol sensor);
// RARangeDevice *getSensor(Rice::Symbol sensor);
virtual void setRobot(ArRobot *robot);
- // ArActionDesired *getActionDesired() { return &myDesired; }
- Rice::Object getActionDesired();
+ ArActionDesired *getActionDesired() { return &myDesired; }
protected:
ArActionDesired myDesired;
Rice::Object *myFireProc;
Rice::Array mySensors;
// Sensors
RARangeDevice *mySonar;
};
+
+
+// We need a disposable wrapper for ArActionDesired which Ruby can GC at its
+// pleasure. This class delegates all calls to its wrapped ArActionDesired.
+// We have to duplicate the entirety of the interface we want Ruby to be able
+// to use. It would be nice to automate this somehow with macros.
+
+class ArActionDesiredWrap
+{
+public:
+ ArActionDesiredWrap(ArActionDesired *obj) { myObj = obj; }
+ virtual ~ArActionDesiredWrap() {}
+
+ double getVel() const { return myObj->getVel(); }
+ double getVelStrength() const { return myObj->getVelStrength(); }
+ void setVel(double vel, double strength) const { myObj->setVel(vel, strength); }
+
+ double getDeltaHeading() const { return myObj->getDeltaHeading(); }
+ double getDeltaHeadingStrength() const { return myObj->getDeltaHeadingStrength(); }
+ void setDeltaHeading(double deltaHeading, double strength) const { myObj->setDeltaHeading(deltaHeading, strength); }
+
+ double getHeading() const { return myObj->getHeading(); }
+ double getHeadingStrength() const { return myObj->getHeadingStrength(); }
+ void setHeading(double heading, double strength) const { myObj->setHeading(heading, strength); }
+
+private:
+ ArActionDesired *myObj;
+};
+
+
+template<>
+inline
+Rice::Object to_ruby<ArActionDesired *>(ArActionDesired * const & x)
+{
+ return Rice::Data_Object<ArActionDesiredWrap>(new ArActionDesiredWrap(x));
+}
diff --git a/ext/rubot_aria/rubot_aria.cpp b/ext/rubot_aria/rubot_aria.cpp
index 0662f26..67a0bc4 100644
--- a/ext/rubot_aria/rubot_aria.cpp
+++ b/ext/rubot_aria/rubot_aria.cpp
@@ -1,76 +1,64 @@
#include "rice/Module.hpp"
#include "rice/Data_Type.hpp"
#include "rice/Constructor.hpp"
#include "rice/Exception.hpp"
#include "rice/Array.hpp"
#include "Aria.h"
#include "RAGenericAction.h"
#include "RARobotManager.h"
#include "RARangeDevice.h"
using namespace std;
using namespace Rice;
extern "C"
void Init_rubot_aria()
{
static char inited = 0;
if (!inited) Aria::init(Aria::SIGHANDLE_NONE);
inited = 1;
- // Define Rubot::Adapters::Aria.
Object rb_MRubot = Class(rb_cObject).const_get("Rubot");
Object rb_MAdapters = Module(rb_MRubot).const_get("Adapters");
Object rb_MAria = Module(rb_MAdapters)
.define_module("Aria")
;
- // Define Rubot::Adapters::Aria::RobotManager.
- // Rubot::Adapters::Aria::Robot is defined in Ruby and uses this class.
Data_Type<RARobotManager> rb_cRobotManager = Module(rb_MAria)
.define_class<RARobotManager>("RobotManager")
.define_constructor(Constructor<RARobotManager>())
.define_method("go", &RARobotManager::go)
.define_method("add_behavior", &RARobotManager::addAction)
.define_method("add_sensor", &RARobotManager::addSensor)
.define_method("robot_radius", &RARobotManager::getRobotRadius)
;
Data_Type<RAGenericAction> rb_cBehavior = Module(rb_MAria)
.define_class<RAGenericAction>("Behavior")
.define_constructor(Constructor<RAGenericAction, const char *>())
.define_method("set_fire_proc", &RAGenericAction::setFireProc)
.define_method("set_sensors", &RAGenericAction::setSensors)
.define_method("get_sensor", &RAGenericAction::getSensor)
.define_method("get_desired", &RAGenericAction::getActionDesired)
;
- Data_Type<ArActionDesired> rb_cActionDesired = Module(rb_MAria)
- .define_class<ArActionDesired>("ActionDesired")
- .define_method("velocity", &ArActionDesired::getVel)
- .define_method("velocity_strength", &ArActionDesired::getVelStrength)
- .define_method("set_velocity", &ArActionDesired::setVel)
- .define_method("delta_heading", &ArActionDesired::getDeltaHeading)
- .define_method("delta_heading_strength", &ArActionDesired::getDeltaHeadingStrength)
- .define_method("set_delta_heading", &ArActionDesired::setDeltaHeading)
- .define_method("heading", &ArActionDesired::getHeading)
- .define_method("heading_strength", &ArActionDesired::getHeadingStrength)
- .define_method("set_heading", &ArActionDesired::setHeading)
- // .define_method("max_velocity", &ArActionDesired::getMaxVel)
- // .define_method("max_velocity_strength", &ArActionDesired::getMaxVelStrength)
- // .define_method("set_max_velocity", &ArActionDesired::setMaxVel)
- // .define_method("max_reverse_velocity", &ArActionDesired::getMaxNegVel)
- // .define_method("max_reverse_velocity_strength", &ArActionDesired::getMaxNegVelStrength)
- // .define_method("set_max_reverse_velocity", &ArActionDesired::setMaxNegVel)
- // .define_method("max_rotational_velocity", &ArActionDesired::getMaxRotVel)
- // .define_method("max_rotational_velocity_strength", &ArActionDesired::getMaxRotVelStrength)
- // .define_method("set_max_rotational_velocity", &ArActionDesired::setMaxRotVel)
- ;
+ Data_Type<ArActionDesiredWrap> rb_cActionDesired = Module(rb_MAria)
+ .define_class<ArActionDesiredWrap>("ActionDesired")
+ .define_method("velocity", &ArActionDesiredWrap::getVel)
+ .define_method("velocity_strength", &ArActionDesiredWrap::getVelStrength)
+ .define_method("set_velocity", &ArActionDesiredWrap::setVel)
+ .define_method("delta_heading", &ArActionDesiredWrap::getDeltaHeading)
+ .define_method("delta_heading_strength", &ArActionDesiredWrap::getDeltaHeadingStrength)
+ .define_method("set_delta_heading", &ArActionDesiredWrap::setDeltaHeading)
+ .define_method("heading", &ArActionDesiredWrap::getHeading)
+ .define_method("heading_strength", &ArActionDesiredWrap::getHeadingStrength)
+ .define_method("set_heading", &ArActionDesiredWrap::setHeading)
+ ;
Data_Type<RARangeDevice> rb_cRangeDevice = Module(rb_MAria)
.define_class<RARangeDevice>("RangeDevice")
.define_method("range", &RARangeDevice::range)
;
}
|
Peeja/rubot
|
662194eec76213a7a6862cea461b3a63853bd720
|
Added temporary warning to README before publicizing the code.
|
diff --git a/README.txt b/README.txt
index feb86d4..0550db1 100644
--- a/README.txt
+++ b/README.txt
@@ -1,48 +1,53 @@
+IMPORTANT:
+This version of Rubot is incomplete and presented publicly for the sole purpose (currently) of discussion and testing. Many things are broken, many files are incomplete. Even this README needs a good deal of work.
+
+=====
+
rubot
by FIXME (your name)
FIXME (url)
== DESCRIPTION:
FIXME (describe your package)
== FEATURES/PROBLEMS:
* FIXME (list of features or problems)
== SYNOPSIS:
FIXME (code sample of usage)
== REQUIREMENTS:
* FIXME (list of requirements)
== INSTALL:
* FIXME (sudo gem install, anything else)
== LICENSE:
(The MIT License)
-Copyright (c) 2008 FIXME (different license?)
+Copyright (c) 2008
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Peeja/rubot
|
815ac05ef7ebd1d553e11f0a71c40824b4c6948e
|
Passes test input! But segfaults after a while, probably due to Rice memory management gaffes.
|
diff --git a/ext/rubot_aria/RARobotManager.h b/ext/rubot_aria/RARobotManager.h
index 681c685..6319994 100644
--- a/ext/rubot_aria/RARobotManager.h
+++ b/ext/rubot_aria/RARobotManager.h
@@ -1,29 +1,30 @@
#pragma once
#include "Aria.h"
#include "RAGenericAction.h"
/*
* RARobotManager
* Encapsulates an ArRobot and its connection.
*
*/
class RARobotManager
{
public:
RARobotManager();
virtual ~RARobotManager();
void go(const char *argString);
void stop();
void addAction(RAGenericAction *action, int priority);
void addSensor(Rice::Symbol sensor);
+ double getRobotRadius() { return myRobot.getRobotRadius(); }
private:
ArRobot myRobot;
ArFunctorC<RARobotManager> myStopCB;
ArKeyHandler *myRobotKeyHandler;
// Sensors
ArSonarDevice *mySonar;
};
diff --git a/ext/rubot_aria/rubot_aria.cpp b/ext/rubot_aria/rubot_aria.cpp
index 80a7966..0662f26 100644
--- a/ext/rubot_aria/rubot_aria.cpp
+++ b/ext/rubot_aria/rubot_aria.cpp
@@ -1,75 +1,76 @@
#include "rice/Module.hpp"
#include "rice/Data_Type.hpp"
#include "rice/Constructor.hpp"
#include "rice/Exception.hpp"
#include "rice/Array.hpp"
#include "Aria.h"
#include "RAGenericAction.h"
#include "RARobotManager.h"
#include "RARangeDevice.h"
using namespace std;
using namespace Rice;
extern "C"
void Init_rubot_aria()
{
static char inited = 0;
if (!inited) Aria::init(Aria::SIGHANDLE_NONE);
inited = 1;
// Define Rubot::Adapters::Aria.
Object rb_MRubot = Class(rb_cObject).const_get("Rubot");
Object rb_MAdapters = Module(rb_MRubot).const_get("Adapters");
Object rb_MAria = Module(rb_MAdapters)
.define_module("Aria")
;
// Define Rubot::Adapters::Aria::RobotManager.
// Rubot::Adapters::Aria::Robot is defined in Ruby and uses this class.
Data_Type<RARobotManager> rb_cRobotManager = Module(rb_MAria)
.define_class<RARobotManager>("RobotManager")
.define_constructor(Constructor<RARobotManager>())
.define_method("go", &RARobotManager::go)
.define_method("add_behavior", &RARobotManager::addAction)
.define_method("add_sensor", &RARobotManager::addSensor)
+ .define_method("robot_radius", &RARobotManager::getRobotRadius)
;
Data_Type<RAGenericAction> rb_cBehavior = Module(rb_MAria)
.define_class<RAGenericAction>("Behavior")
.define_constructor(Constructor<RAGenericAction, const char *>())
.define_method("set_fire_proc", &RAGenericAction::setFireProc)
.define_method("set_sensors", &RAGenericAction::setSensors)
.define_method("get_sensor", &RAGenericAction::getSensor)
.define_method("get_desired", &RAGenericAction::getActionDesired)
;
Data_Type<ArActionDesired> rb_cActionDesired = Module(rb_MAria)
.define_class<ArActionDesired>("ActionDesired")
.define_method("velocity", &ArActionDesired::getVel)
.define_method("velocity_strength", &ArActionDesired::getVelStrength)
.define_method("set_velocity", &ArActionDesired::setVel)
.define_method("delta_heading", &ArActionDesired::getDeltaHeading)
.define_method("delta_heading_strength", &ArActionDesired::getDeltaHeadingStrength)
.define_method("set_delta_heading", &ArActionDesired::setDeltaHeading)
.define_method("heading", &ArActionDesired::getHeading)
.define_method("heading_strength", &ArActionDesired::getHeadingStrength)
.define_method("set_heading", &ArActionDesired::setHeading)
// .define_method("max_velocity", &ArActionDesired::getMaxVel)
// .define_method("max_velocity_strength", &ArActionDesired::getMaxVelStrength)
// .define_method("set_max_velocity", &ArActionDesired::setMaxVel)
// .define_method("max_reverse_velocity", &ArActionDesired::getMaxNegVel)
// .define_method("max_reverse_velocity_strength", &ArActionDesired::getMaxNegVelStrength)
// .define_method("set_max_reverse_velocity", &ArActionDesired::setMaxNegVel)
// .define_method("max_rotational_velocity", &ArActionDesired::getMaxRotVel)
// .define_method("max_rotational_velocity_strength", &ArActionDesired::getMaxRotVelStrength)
// .define_method("set_max_rotational_velocity", &ArActionDesired::setMaxRotVel)
;
Data_Type<RARangeDevice> rb_cRangeDevice = Module(rb_MAria)
.define_class<RARangeDevice>("RangeDevice")
.define_method("range", &RARangeDevice::range)
;
}
diff --git a/lib/rubot/adapters/aria/robot.rb b/lib/rubot/adapters/aria/robot.rb
index 4cca71c..d0dfefd 100644
--- a/lib/rubot/adapters/aria/robot.rb
+++ b/lib/rubot/adapters/aria/robot.rb
@@ -1,26 +1,30 @@
module Rubot::Adapters::Aria
class Robot
attr_reader :options
def initialize
@options = {}
@manager = RobotManager.new
end
def run
args = ''
args << "-remoteHost #{@options[:host]} " if @options[:host]
args << "-remoteRobotTcpPort #{@options[:port]} " if @options[:port]
@manager.go args
end
def add_behavior(behavior, priority)
raise ArgumentError, "Behavior must be an Aria::Behavior" unless behavior.instance_of? Behavior
@manager.add_behavior(behavior, priority)
end
def add_sensor(sensor)
@manager.add_sensor(sensor)
end
+
+ def radius
+ @manager.robot_radius
+ end
end
end
diff --git a/lib/rubot/dsl.rb b/lib/rubot/dsl.rb
index 802b46a..2777181 100644
--- a/lib/rubot/dsl.rb
+++ b/lib/rubot/dsl.rb
@@ -1,162 +1,161 @@
require 'facets/string/camelcase'
require 'facets/symbol/to_proc'
module Rubot::DSL
BehaviorFactories = {}
Robots = {}
class BehaviorFactoryBuilder
def initialize(name, args, &block)
@name = name.to_sym
@args = args
@sensors = []
self.instance_eval(&block)
end
# Defines the block of code to run when this behavior fires.
#
# behavior :do_stuff do
# fire do
# # Do stuff
# end
# end
def fire(&block)
@fire = block
end
# Specifies sensors to make available to the fire block.
#
# behavior :log_sonar do
# sensors :sonar
# fire do
# puts "Sonar is reading #{sonar.range(-70,70)}"
# end
# end
def sensors(*sensors)
@sensors += sensors.map(&:to_sym)
end
def build
BehaviorFactory.new(@name, @args, @fire, @sensors.uniq)
end
end
class BehaviorFactory
def initialize(name, accepted_args, fire, sensors)
@name = name
@accepted_args = accepted_args
@fire = fire
@sensors = sensors
end
- def create_for_robot(robot, given_args={})
- BehaviorContext.new(@name, @accepted_args, @fire, @sensors, robot, given_args).behavior
+ def create_for_robot(robot, adapter, given_args={})
+ BehaviorContext.new(@name, @accepted_args, @fire, @sensors, robot, adapter, given_args).behavior
end
end
class BehaviorContext
attr_reader :behavior, :robot
- def initialize(name, accepted_args, fire, sensors, robot, given_args={})
+ def initialize(name, accepted_args, fire, sensors, robot, adapter, given_args={})
@name = name
@accepted_args = accepted_args
@fire = fire
@sensors = sensors
@robot = robot
@given_args = given_args
- @behavior = Rubot::Adapters.const_get(robot.adapter)::Behavior.new name.to_s
+ @behavior = Rubot::Adapters.const_get(adapter)::Behavior.new name.to_s
# Have the behavior execute the fire proc in context of this object.
@behavior.set_fire_proc Proc.new { self.instance_eval(&@fire) }
@behavior.set_sensors @sensors
end
- # Return the named sensor, if one is given.
+ # Return the named sensor or argument.
def method_missing(sym, *args)
if @sensors.include? sym
@behavior.get_sensor(sym)
elsif @accepted_args.include? sym
@given_args[sym]
else
super
end
end
def desired
@behavior.get_desired
end
end
class RobotBuilder
attr_reader :adapter
def initialize(name, &block)
@name = name.to_sym
@options = {}
@sensors = []
@behaviors = []
self.instance_eval(&block)
end
- # Set the adapter for the robot, if name is given. Otherwise, return the adapter
- def adapter(name=nil)
+ # Set the adapter for the robot, if name is given.
+ def adapter(name)
# TODO: Stop user from changing the adapter once set.
- @adapter = name.to_s.camelcase(true).to_sym if name
- @adapter
+ @adapter = name.to_s.camelcase(true).to_sym
end
def sensors(*sensors)
@sensors += sensors.map(&:to_sym)
end
def behaviors(&block)
@behaviors += RobotBehaviorsBuilder.new(&block).behaviors
end
def method_missing(opt, *args)
@options[opt] = ( args.size == 1 ? args.first : args )
nil
end
def build
raise "Robot #{@name} declared without an adapter." unless @adapter
robot = Rubot::Adapters.const_get(@adapter)::Robot.new
robot.options.merge! @options
@sensors.each { |s| robot.add_sensor s }
- @behaviors.each do |name, priority, opts|
- b = BehaviorFactories[name].create_for_robot(self, opts)
+ @behaviors.each do |name, priority, args|
+ b = BehaviorFactories[name].create_for_robot(robot, @adapter, args)
robot.add_behavior b, priority
end
robot
end
end
# Builds up a list of behaviors for the robot.
class RobotBehaviorsBuilder
attr_reader :behaviors
def initialize(&block)
@behaviors = []
self.instance_eval(&block)
end
- def method_missing(name, opts={})
- priority = opts.delete(:priority) do |_|
+ def method_missing(name, args={})
+ priority = args.delete(:priority) do |_|
# TODO: raise hell if priority is not given.
end
- @behaviors << [name.to_sym, priority, opts]
+ @behaviors << [name.to_sym, priority, args]
end
end
def behavior(name, &block)
name, args = name.to_a.first if name.instance_of? Hash
args ||= []
bb = BehaviorFactoryBuilder.new(name, args, &block)
BehaviorFactories[name.to_sym] = bb.build
end
def robot(name, &block)
rb = RobotBuilder.new(name, &block)
Robots[name.to_sym] = rb.build
end
def run(name)
Robots[name].run
end
end
|
Peeja/rubot
|
2007928a1bcd96e5ef82ca65f883b9a65f64e868
|
Behaviors now take arguments.
|
diff --git a/lib/rubot/dsl.rb b/lib/rubot/dsl.rb
index 287d020..802b46a 100644
--- a/lib/rubot/dsl.rb
+++ b/lib/rubot/dsl.rb
@@ -1,138 +1,162 @@
require 'facets/string/camelcase'
require 'facets/symbol/to_proc'
module Rubot::DSL
BehaviorFactories = {}
Robots = {}
class BehaviorFactoryBuilder
- def initialize(name, &block)
+ def initialize(name, args, &block)
@name = name.to_sym
+ @args = args
@sensors = []
self.instance_eval(&block)
end
# Defines the block of code to run when this behavior fires.
#
# behavior :do_stuff do
# fire do
# # Do stuff
# end
# end
def fire(&block)
@fire = block
end
# Specifies sensors to make available to the fire block.
#
# behavior :log_sonar do
# sensors :sonar
# fire do
# puts "Sonar is reading #{sonar.range(-70,70)}"
# end
# end
def sensors(*sensors)
@sensors += sensors.map(&:to_sym)
end
def build
- BehaviorFactory.new(@name, @fire, @sensors.uniq)
+ BehaviorFactory.new(@name, @args, @fire, @sensors.uniq)
end
end
class BehaviorFactory
- def initialize(name, fire, sensors)
+ def initialize(name, accepted_args, fire, sensors)
@name = name
+ @accepted_args = accepted_args
@fire = fire
@sensors = sensors
end
- def create_for_robot(robot)
- BehaviorContext.new(@name, @fire, @sensors, robot).behavior
+ def create_for_robot(robot, given_args={})
+ BehaviorContext.new(@name, @accepted_args, @fire, @sensors, robot, given_args).behavior
end
end
class BehaviorContext
attr_reader :behavior, :robot
- def initialize(name, fire, sensors, robot)
+ def initialize(name, accepted_args, fire, sensors, robot, given_args={})
@name = name
+ @accepted_args = accepted_args
@fire = fire
@sensors = sensors
@robot = robot
+ @given_args = given_args
@behavior = Rubot::Adapters.const_get(robot.adapter)::Behavior.new name.to_s
# Have the behavior execute the fire proc in context of this object.
@behavior.set_fire_proc Proc.new { self.instance_eval(&@fire) }
@behavior.set_sensors @sensors
end
# Return the named sensor, if one is given.
def method_missing(sym, *args)
if @sensors.include? sym
@behavior.get_sensor(sym)
+ elsif @accepted_args.include? sym
+ @given_args[sym]
else
super
end
end
def desired
@behavior.get_desired
end
end
class RobotBuilder
attr_reader :adapter
def initialize(name, &block)
@name = name.to_sym
@options = {}
@sensors = []
@behaviors = []
self.instance_eval(&block)
end
# Set the adapter for the robot, if name is given. Otherwise, return the adapter
def adapter(name=nil)
# TODO: Stop user from changing the adapter once set.
@adapter = name.to_s.camelcase(true).to_sym if name
@adapter
end
def sensors(*sensors)
@sensors += sensors.map(&:to_sym)
end
-
- def behavior(name, priority)
- @behaviors << [name.to_sym, priority]
+
+ def behaviors(&block)
+ @behaviors += RobotBehaviorsBuilder.new(&block).behaviors
end
def method_missing(opt, *args)
@options[opt] = ( args.size == 1 ? args.first : args )
nil
end
def build
raise "Robot #{@name} declared without an adapter." unless @adapter
robot = Rubot::Adapters.const_get(@adapter)::Robot.new
robot.options.merge! @options
@sensors.each { |s| robot.add_sensor s }
- @behaviors.each do |name, priority|
- b = BehaviorFactories[name].create_for_robot(self)
+ @behaviors.each do |name, priority, opts|
+ b = BehaviorFactories[name].create_for_robot(self, opts)
robot.add_behavior b, priority
end
robot
end
end
+ # Builds up a list of behaviors for the robot.
+ class RobotBehaviorsBuilder
+ attr_reader :behaviors
+ def initialize(&block)
+ @behaviors = []
+ self.instance_eval(&block)
+ end
+
+ def method_missing(name, opts={})
+ priority = opts.delete(:priority) do |_|
+ # TODO: raise hell if priority is not given.
+ end
+ @behaviors << [name.to_sym, priority, opts]
+ end
+ end
+
def behavior(name, &block)
- bb = BehaviorFactoryBuilder.new(name, &block)
+ name, args = name.to_a.first if name.instance_of? Hash
+ args ||= []
+ bb = BehaviorFactoryBuilder.new(name, args, &block)
BehaviorFactories[name.to_sym] = bb.build
end
def robot(name, &block)
rb = RobotBuilder.new(name, &block)
Robots[name.to_sym] = rb.build
end
def run(name)
Robots[name].run
end
end
|
Peeja/rubot
|
3a8f15fae576e86a9d5590d674e4ff07d0bfdf04
|
No longer merge myDesired with currentDesired on every fire. Don't know how I got that idea, but it's wrong.
|
diff --git a/ext/rubot_aria/RAGenericAction.cpp b/ext/rubot_aria/RAGenericAction.cpp
index f3d7932..273646e 100644
--- a/ext/rubot_aria/RAGenericAction.cpp
+++ b/ext/rubot_aria/RAGenericAction.cpp
@@ -1,90 +1,89 @@
#include "rice/Data_Type.hpp"
#include "rice/Symbol.hpp"
#include "rice/Exception.hpp"
#include "Aria.h"
#include "RAGenericAction.h"
#include "RARangeDevice.h"
using namespace Rice;
RAGenericAction::RAGenericAction(const char *name)
: ArAction(name)
{
ArLog::log(ArLog::Normal, "Created generic action \"%s\".", name);
myFireProc = NULL;
// Sensors
mySonar = NULL;
}
RAGenericAction::~RAGenericAction()
{
if (myFireProc != NULL)
delete myFireProc;
if (mySonar != NULL)
delete mySonar;
ArLog::log(ArLog::Normal, "Destroyed generic action \"%s\".", getName());
}
ArActionDesired *RAGenericAction::fire(ArActionDesired currentDesired)
{
myDesired.reset();
- myDesired.merge(¤tDesired);
if (myFireProc != NULL)
myFireProc->call("call");
return &myDesired;
}
void RAGenericAction::setFireProc(Object proc)
{
if (!proc.is_a(rb_cProc))
throw Exception(rb_eArgError, "proc needs to be a Proc.");
if (myFireProc != NULL)
delete myFireProc;
myFireProc = new Object(proc);
}
void RAGenericAction::setSensors(Object sensors)
{
// TODO: Make sure rubot_aria supports the given sensors.
// ArLog::log(ArLog::Normal, "Action \"%s\"'s sensors started with \"%s\".", getName(), Symbol(mySensors.call("first")).c_str());
mySensors.call("replace", Array(sensors));
// ArLog::log(ArLog::Normal, "Action \"%s\"'s sensors now start with \"%s\".", getName(), Symbol(mySensors.call("first")).c_str());
}
void RAGenericAction::setRobot(ArRobot *robot)
{
ArAction::setRobot(robot);
ArLog::log(ArLog::Normal, "Setting robot for action \"%s\".", getName());
// Acquire sensors.
// TODO: Handle robot not supporting sensors better.
for (Array::iterator it = mySensors.begin(); it != mySensors.end(); ++it) {
if (*it == Symbol("sonar")) {
ArLog::log(ArLog::Normal, "Adding sonar.");
if (mySonar != NULL)
delete mySonar;
ArRangeDevice *ariaSonar = robot->findRangeDevice("sonar");
mySonar = (ariaSonar ? new RARangeDevice(ariaSonar) : NULL);
}
}
}
Object RAGenericAction::getSensor(Symbol sensor)
{
if (sensor == Symbol("sonar") && mySonar)
// FIXME: Is this bad memory management?
return Data_Object<RARangeDevice>(mySonar);
else
return Object(Qnil);
}
Object RAGenericAction::getActionDesired()
{
return Data_Object<ArActionDesired>(&myDesired);
// return to_ruby<ArActionDesired *>(&myDesired);
// return Object(Qnil);
}
|
Peeja/rubot
|
0f897c2f2b4ae2f576fcf01ba978f8cc74da08e9
|
Desired action is now exposed to fire procs.
|
diff --git a/ext/rubot_aria/RAGenericAction.cpp b/ext/rubot_aria/RAGenericAction.cpp
index 272e61d..f3d7932 100644
--- a/ext/rubot_aria/RAGenericAction.cpp
+++ b/ext/rubot_aria/RAGenericAction.cpp
@@ -1,82 +1,90 @@
#include "rice/Data_Type.hpp"
#include "rice/Symbol.hpp"
#include "rice/Exception.hpp"
#include "Aria.h"
#include "RAGenericAction.h"
#include "RARangeDevice.h"
using namespace Rice;
RAGenericAction::RAGenericAction(const char *name)
: ArAction(name)
{
ArLog::log(ArLog::Normal, "Created generic action \"%s\".", name);
myFireProc = NULL;
// Sensors
mySonar = NULL;
}
RAGenericAction::~RAGenericAction()
{
if (myFireProc != NULL)
delete myFireProc;
if (mySonar != NULL)
delete mySonar;
ArLog::log(ArLog::Normal, "Destroyed generic action \"%s\".", getName());
}
ArActionDesired *RAGenericAction::fire(ArActionDesired currentDesired)
{
myDesired.reset();
myDesired.merge(¤tDesired);
if (myFireProc != NULL)
myFireProc->call("call");
return &myDesired;
}
void RAGenericAction::setFireProc(Object proc)
{
if (!proc.is_a(rb_cProc))
throw Exception(rb_eArgError, "proc needs to be a Proc.");
if (myFireProc != NULL)
delete myFireProc;
myFireProc = new Object(proc);
}
void RAGenericAction::setSensors(Object sensors)
{
// TODO: Make sure rubot_aria supports the given sensors.
// ArLog::log(ArLog::Normal, "Action \"%s\"'s sensors started with \"%s\".", getName(), Symbol(mySensors.call("first")).c_str());
mySensors.call("replace", Array(sensors));
// ArLog::log(ArLog::Normal, "Action \"%s\"'s sensors now start with \"%s\".", getName(), Symbol(mySensors.call("first")).c_str());
}
void RAGenericAction::setRobot(ArRobot *robot)
{
ArAction::setRobot(robot);
ArLog::log(ArLog::Normal, "Setting robot for action \"%s\".", getName());
// Acquire sensors.
// TODO: Handle robot not supporting sensors better.
for (Array::iterator it = mySensors.begin(); it != mySensors.end(); ++it) {
if (*it == Symbol("sonar")) {
ArLog::log(ArLog::Normal, "Adding sonar.");
if (mySonar != NULL)
delete mySonar;
ArRangeDevice *ariaSonar = robot->findRangeDevice("sonar");
mySonar = (ariaSonar ? new RARangeDevice(ariaSonar) : NULL);
}
}
}
Object RAGenericAction::getSensor(Symbol sensor)
{
if (sensor == Symbol("sonar") && mySonar)
+ // FIXME: Is this bad memory management?
return Data_Object<RARangeDevice>(mySonar);
else
return Object(Qnil);
}
+
+Object RAGenericAction::getActionDesired()
+{
+ return Data_Object<ArActionDesired>(&myDesired);
+ // return to_ruby<ArActionDesired *>(&myDesired);
+ // return Object(Qnil);
+}
diff --git a/ext/rubot_aria/RAGenericAction.h b/ext/rubot_aria/RAGenericAction.h
index 1c34337..4ccd1b2 100644
--- a/ext/rubot_aria/RAGenericAction.h
+++ b/ext/rubot_aria/RAGenericAction.h
@@ -1,33 +1,37 @@
#pragma once
#include "rice/Array.hpp"
#include "rice/Object.hpp"
+#include "rice/Data_Object.hpp"
#include "Aria.h"
#include "RARangeDevice.h"
/*
* RAGenericAction
* Generic ArAction that runs a Ruby proc when it fires.
*
*/
class RAGenericAction : public ArAction
{
public:
RAGenericAction(const char *name);
virtual ~RAGenericAction(void);
virtual ArActionDesired *fire(ArActionDesired currentDesired);
void setFireProc(Rice::Object proc);
void setSensors(Rice::Object sensors);
Rice::Object getSensor(Rice::Symbol sensor);
+ // RARangeDevice *getSensor(Rice::Symbol sensor);
virtual void setRobot(ArRobot *robot);
+ // ArActionDesired *getActionDesired() { return &myDesired; }
+ Rice::Object getActionDesired();
protected:
ArActionDesired myDesired;
Rice::Object *myFireProc;
Rice::Array mySensors;
// Sensors
RARangeDevice *mySonar;
};
diff --git a/ext/rubot_aria/rubot_aria.cpp b/ext/rubot_aria/rubot_aria.cpp
index b6ad19d..80a7966 100644
--- a/ext/rubot_aria/rubot_aria.cpp
+++ b/ext/rubot_aria/rubot_aria.cpp
@@ -1,52 +1,75 @@
#include "rice/Module.hpp"
#include "rice/Data_Type.hpp"
#include "rice/Constructor.hpp"
#include "rice/Exception.hpp"
#include "rice/Array.hpp"
#include "Aria.h"
#include "RAGenericAction.h"
#include "RARobotManager.h"
#include "RARangeDevice.h"
using namespace std;
using namespace Rice;
extern "C"
void Init_rubot_aria()
{
static char inited = 0;
if (!inited) Aria::init(Aria::SIGHANDLE_NONE);
inited = 1;
// Define Rubot::Adapters::Aria.
Object rb_MRubot = Class(rb_cObject).const_get("Rubot");
Object rb_MAdapters = Module(rb_MRubot).const_get("Adapters");
Object rb_MAria = Module(rb_MAdapters)
.define_module("Aria")
;
// Define Rubot::Adapters::Aria::RobotManager.
// Rubot::Adapters::Aria::Robot is defined in Ruby and uses this class.
Data_Type<RARobotManager> rb_cRobotManager = Module(rb_MAria)
.define_class<RARobotManager>("RobotManager")
.define_constructor(Constructor<RARobotManager>())
.define_method("go", &RARobotManager::go)
.define_method("add_behavior", &RARobotManager::addAction)
.define_method("add_sensor", &RARobotManager::addSensor)
;
Data_Type<RAGenericAction> rb_cBehavior = Module(rb_MAria)
.define_class<RAGenericAction>("Behavior")
.define_constructor(Constructor<RAGenericAction, const char *>())
.define_method("set_fire_proc", &RAGenericAction::setFireProc)
.define_method("set_sensors", &RAGenericAction::setSensors)
.define_method("get_sensor", &RAGenericAction::getSensor)
+ .define_method("get_desired", &RAGenericAction::getActionDesired)
;
+ Data_Type<ArActionDesired> rb_cActionDesired = Module(rb_MAria)
+ .define_class<ArActionDesired>("ActionDesired")
+ .define_method("velocity", &ArActionDesired::getVel)
+ .define_method("velocity_strength", &ArActionDesired::getVelStrength)
+ .define_method("set_velocity", &ArActionDesired::setVel)
+ .define_method("delta_heading", &ArActionDesired::getDeltaHeading)
+ .define_method("delta_heading_strength", &ArActionDesired::getDeltaHeadingStrength)
+ .define_method("set_delta_heading", &ArActionDesired::setDeltaHeading)
+ .define_method("heading", &ArActionDesired::getHeading)
+ .define_method("heading_strength", &ArActionDesired::getHeadingStrength)
+ .define_method("set_heading", &ArActionDesired::setHeading)
+ // .define_method("max_velocity", &ArActionDesired::getMaxVel)
+ // .define_method("max_velocity_strength", &ArActionDesired::getMaxVelStrength)
+ // .define_method("set_max_velocity", &ArActionDesired::setMaxVel)
+ // .define_method("max_reverse_velocity", &ArActionDesired::getMaxNegVel)
+ // .define_method("max_reverse_velocity_strength", &ArActionDesired::getMaxNegVelStrength)
+ // .define_method("set_max_reverse_velocity", &ArActionDesired::setMaxNegVel)
+ // .define_method("max_rotational_velocity", &ArActionDesired::getMaxRotVel)
+ // .define_method("max_rotational_velocity_strength", &ArActionDesired::getMaxRotVelStrength)
+ // .define_method("set_max_rotational_velocity", &ArActionDesired::setMaxRotVel)
+ ;
+
Data_Type<RARangeDevice> rb_cRangeDevice = Module(rb_MAria)
.define_class<RARangeDevice>("RangeDevice")
.define_method("range", &RARangeDevice::range)
;
}
diff --git a/lib/rubot/adapters.rb b/lib/rubot/adapters.rb
index 50affdf..59614b6 100644
--- a/lib/rubot/adapters.rb
+++ b/lib/rubot/adapters.rb
@@ -1,39 +1,39 @@
require 'facets/string/snakecase'
require 'facets/module/alias'
# This module contains the robotics adapters. For instance, the ACME
# Robotics adapter would be <tt>Rubot::Adapters::AcmeRobotics</tt>. Its robot
# class would be <tt>Rubot::Adapters::AcmeRobotics::Robot</tt>, and one can be
# created with
#
-# Rubot.add_robot(:fred, :acme_robotics)
+# fred = Rubot::Adapters::AcmeRobotics::Robot.new
#
# or, in Rubot syntax,
#
# robot :fred do
# adapter :acme_robotics
# end
module Rubot
# Raised when attempting to create a robot with an unrecognized adapter.
class AdapterMissingError < Exception; end
module Adapters
class << self
def const_missing_with_autoload(name)
# TODO: Handle missing adapter without obscuring all LoadErrors.
# begin
req_name = "rubot/adapters/#{name.to_s.snakecase}"
require req_name
if const_defined? name
return const_get(name)
else
raise AdapterMissingError, "Adapter #{name} not loaded by '#{req_name}'."
end
# rescue LoadError
# raise AdapterMissingError, "Adapter #{name} not found."
# end
end
alias_method_chain :const_missing, :autoload
end
end
end
diff --git a/lib/rubot/adapters/aria.rb b/lib/rubot/adapters/aria.rb
index 234197a..4980d93 100644
--- a/lib/rubot/adapters/aria.rb
+++ b/lib/rubot/adapters/aria.rb
@@ -1,4 +1,5 @@
require 'rubot' if not defined? Rubot
require 'rubot_aria'
require File.dirname(__FILE__) + "/aria/robot"
+require File.dirname(__FILE__) + "/aria/action_desired"
diff --git a/lib/rubot/adapters/aria/action_desired.rb b/lib/rubot/adapters/aria/action_desired.rb
new file mode 100644
index 0000000..24cb319
--- /dev/null
+++ b/lib/rubot/adapters/aria/action_desired.rb
@@ -0,0 +1,18 @@
+module Rubot::Adapters::Aria
+ class ActionDesired
+ %w[ velocity delta_heading heading ].each do |channel|
+ eval <<-CHAN_DEF
+ private :set_#{channel}
+
+ def #{channel}=(val)
+ # Use current channel strength, or maximum (1) if not set.
+ set_#{channel} val, (#{channel}_strength != 0 ? #{channel}_strength : 1)
+ end
+
+ def #{channel}_strength=(strength)
+ set_#{channel} #{channel}, strength
+ end
+ CHAN_DEF
+ end
+ end
+end
diff --git a/lib/rubot/dsl.rb b/lib/rubot/dsl.rb
index aaa81f1..287d020 100644
--- a/lib/rubot/dsl.rb
+++ b/lib/rubot/dsl.rb
@@ -1,136 +1,138 @@
require 'facets/string/camelcase'
require 'facets/symbol/to_proc'
module Rubot::DSL
BehaviorFactories = {}
Robots = {}
class BehaviorFactoryBuilder
def initialize(name, &block)
@name = name.to_sym
@sensors = []
self.instance_eval(&block)
end
# Defines the block of code to run when this behavior fires.
#
# behavior :do_stuff do
# fire do
# # Do stuff
# end
# end
def fire(&block)
@fire = block
end
# Specifies sensors to make available to the fire block.
#
# behavior :log_sonar do
# sensors :sonar
# fire do
# puts "Sonar is reading #{sonar.range(-70,70)}"
# end
# end
def sensors(*sensors)
@sensors += sensors.map(&:to_sym)
end
def build
BehaviorFactory.new(@name, @fire, @sensors.uniq)
end
end
class BehaviorFactory
def initialize(name, fire, sensors)
@name = name
@fire = fire
@sensors = sensors
end
def create_for_robot(robot)
BehaviorContext.new(@name, @fire, @sensors, robot).behavior
end
end
class BehaviorContext
attr_reader :behavior, :robot
def initialize(name, fire, sensors, robot)
@name = name
@fire = fire
@sensors = sensors
@robot = robot
@behavior = Rubot::Adapters.const_get(robot.adapter)::Behavior.new name.to_s
# Have the behavior execute the fire proc in context of this object.
@behavior.set_fire_proc Proc.new { self.instance_eval(&@fire) }
@behavior.set_sensors @sensors
end
# Return the named sensor, if one is given.
def method_missing(sym, *args)
if @sensors.include? sym
@behavior.get_sensor(sym)
else
super
end
end
- # def desired
+ def desired
+ @behavior.get_desired
+ end
end
class RobotBuilder
attr_reader :adapter
def initialize(name, &block)
@name = name.to_sym
@options = {}
@sensors = []
@behaviors = []
self.instance_eval(&block)
end
# Set the adapter for the robot, if name is given. Otherwise, return the adapter
def adapter(name=nil)
# TODO: Stop user from changing the adapter once set.
@adapter = name.to_s.camelcase(true).to_sym if name
@adapter
end
def sensors(*sensors)
@sensors += sensors.map(&:to_sym)
end
def behavior(name, priority)
@behaviors << [name.to_sym, priority]
end
def method_missing(opt, *args)
@options[opt] = ( args.size == 1 ? args.first : args )
nil
end
def build
raise "Robot #{@name} declared without an adapter." unless @adapter
robot = Rubot::Adapters.const_get(@adapter)::Robot.new
robot.options.merge! @options
@sensors.each { |s| robot.add_sensor s }
@behaviors.each do |name, priority|
b = BehaviorFactories[name].create_for_robot(self)
robot.add_behavior b, priority
end
robot
end
end
def behavior(name, &block)
bb = BehaviorFactoryBuilder.new(name, &block)
BehaviorFactories[name.to_sym] = bb.build
end
def robot(name, &block)
rb = RobotBuilder.new(name, &block)
Robots[name.to_sym] = rb.build
end
def run(name)
Robots[name].run
end
end
|
Peeja/rubot
|
6c282c479878df44612c862a7c67f0229911dfe3
|
Fire procs now have access to sensors. Aria extension code broken up into files by class.
|
diff --git a/Manifest.txt b/Manifest.txt
index 64f0af7..3c903b9 100644
--- a/Manifest.txt
+++ b/Manifest.txt
@@ -1,35 +1,52 @@
.autotest
+Adapters.txt
History.txt
Manifest.txt
Notes.txt
README.txt
Rakefile
bin/rubot
examples/test1.rb
+ext/rubot_aria/Makefile
+ext/rubot_aria/RAGenericAction.cpp
+ext/rubot_aria/RAGenericAction.h
+ext/rubot_aria/RAGenericAction.o
+ext/rubot_aria/RARangeDevice.cpp
+ext/rubot_aria/RARangeDevice.h
+ext/rubot_aria/RARangeDevice.o
+ext/rubot_aria/RARobotManager.cpp
+ext/rubot_aria/RARobotManager.h
+ext/rubot_aria/RARobotManager.o
ext/rubot_aria/extconf.rb
ext/rubot_aria/rubot_aria.cpp
+ext/rubot_aria/rubot_aria.o
+ext/rubot_aria/rubot_aria.so
ext/rubot_asimov/extconf.rb
ext/rubot_asimov/rubot_asimov.c
lib/rubot.rb
+lib/rubot/adapters.rb
lib/rubot/adapters/aria.rb
+lib/rubot/adapters/aria/robot.rb
lib/rubot/adapters/asimov.rb
+lib/rubot/dsl.rb
lib/rubot/meta.rb
-lib/rubot/robot.rb
-spec/ext/rubot_aria/aria/robot_spec.rb
-spec/ext/rubot_aria/aria_spec.rb
-spec/ext/rubot_aria/spec_helper.rb
-spec/rubot/robot_spec.rb
+spec/load_paths.rb
+spec/rubot/adapters/aria/robot_manager_spec.rb
+spec/rubot/adapters/aria/robot_spec.rb
+spec/rubot/adapters/aria_spec.rb
+spec/rubot/adapters/spec_helper.rb
+spec/rubot/dsl_spec.rb
spec/rubot_spec.rb
spec/spec.opts
spec/spec_helper.rb
tasks/ann.rake
tasks/annotations.rake
tasks/doc.rake
tasks/gem.rake
tasks/manifest.rake
tasks/post_load.rake
tasks/rubyforge.rake
tasks/setup.rb
tasks/spec.rake
tasks/svn.rake
tasks/test.rake
diff --git a/Rakefile b/Rakefile
index 83862ed..f7fe790 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,27 +1,27 @@
# Look in the tasks/setup.rb file for the various options that can be
# configured in this Rakefile. The .rake files in the tasks directory
# are where the options are used.
load 'tasks/setup.rb'
ensure_in_path 'lib'
require 'rubot'
task :default => 'spec:run'
PROJ.name = 'rubot'
PROJ.authors = 'Peter Jaros (Peeja)'
PROJ.email = 'peter.a.jaros@gmail.com'
PROJ.url = 'FIXME (project homepage)'
PROJ.rubyforge_name = 'rubot'
PROJ.spec_opts += File.read('spec/spec.opts').split
PROJ.spec_opts << '-fs'
# Don't expect test coverage of any file with an absolute path.
PROJ.rcov_opts << '--exclude' << '^/' << '--exclude' << 'meta.rb$'
PROJ.rcov_threshold_exact = true
-PROJ.exclude << '^.git/' << '.gitignore$' << '.DS_Store$'
+PROJ.exclude << '^\.git/' << '\.gitignore$' << '/\.DS_Store$' << '^\.DS_Store$' << '/\._' << '^\._' << 'mkmf.log'
# EOF
diff --git a/ext/rubot_aria/RAGenericAction.cpp b/ext/rubot_aria/RAGenericAction.cpp
new file mode 100644
index 0000000..272e61d
--- /dev/null
+++ b/ext/rubot_aria/RAGenericAction.cpp
@@ -0,0 +1,82 @@
+#include "rice/Data_Type.hpp"
+#include "rice/Symbol.hpp"
+#include "rice/Exception.hpp"
+#include "Aria.h"
+
+#include "RAGenericAction.h"
+#include "RARangeDevice.h"
+
+using namespace Rice;
+
+RAGenericAction::RAGenericAction(const char *name)
+ : ArAction(name)
+{
+ ArLog::log(ArLog::Normal, "Created generic action \"%s\".", name);
+ myFireProc = NULL;
+
+ // Sensors
+ mySonar = NULL;
+}
+
+RAGenericAction::~RAGenericAction()
+{
+ if (myFireProc != NULL)
+ delete myFireProc;
+ if (mySonar != NULL)
+ delete mySonar;
+ ArLog::log(ArLog::Normal, "Destroyed generic action \"%s\".", getName());
+}
+
+ArActionDesired *RAGenericAction::fire(ArActionDesired currentDesired)
+{
+ myDesired.reset();
+ myDesired.merge(¤tDesired);
+
+ if (myFireProc != NULL)
+ myFireProc->call("call");
+
+ return &myDesired;
+}
+
+void RAGenericAction::setFireProc(Object proc)
+{
+ if (!proc.is_a(rb_cProc))
+ throw Exception(rb_eArgError, "proc needs to be a Proc.");
+ if (myFireProc != NULL)
+ delete myFireProc;
+ myFireProc = new Object(proc);
+}
+
+void RAGenericAction::setSensors(Object sensors)
+{
+ // TODO: Make sure rubot_aria supports the given sensors.
+ // ArLog::log(ArLog::Normal, "Action \"%s\"'s sensors started with \"%s\".", getName(), Symbol(mySensors.call("first")).c_str());
+ mySensors.call("replace", Array(sensors));
+ // ArLog::log(ArLog::Normal, "Action \"%s\"'s sensors now start with \"%s\".", getName(), Symbol(mySensors.call("first")).c_str());
+}
+
+void RAGenericAction::setRobot(ArRobot *robot)
+{
+ ArAction::setRobot(robot);
+ ArLog::log(ArLog::Normal, "Setting robot for action \"%s\".", getName());
+
+ // Acquire sensors.
+ // TODO: Handle robot not supporting sensors better.
+ for (Array::iterator it = mySensors.begin(); it != mySensors.end(); ++it) {
+ if (*it == Symbol("sonar")) {
+ ArLog::log(ArLog::Normal, "Adding sonar.");
+ if (mySonar != NULL)
+ delete mySonar;
+ ArRangeDevice *ariaSonar = robot->findRangeDevice("sonar");
+ mySonar = (ariaSonar ? new RARangeDevice(ariaSonar) : NULL);
+ }
+ }
+}
+
+Object RAGenericAction::getSensor(Symbol sensor)
+{
+ if (sensor == Symbol("sonar") && mySonar)
+ return Data_Object<RARangeDevice>(mySonar);
+ else
+ return Object(Qnil);
+}
diff --git a/ext/rubot_aria/RAGenericAction.h b/ext/rubot_aria/RAGenericAction.h
new file mode 100644
index 0000000..1c34337
--- /dev/null
+++ b/ext/rubot_aria/RAGenericAction.h
@@ -0,0 +1,33 @@
+#pragma once
+
+#include "rice/Array.hpp"
+#include "rice/Object.hpp"
+#include "Aria.h"
+
+#include "RARangeDevice.h"
+
+/*
+ * RAGenericAction
+ * Generic ArAction that runs a Ruby proc when it fires.
+ *
+ */
+
+class RAGenericAction : public ArAction
+{
+public:
+ RAGenericAction(const char *name);
+ virtual ~RAGenericAction(void);
+ virtual ArActionDesired *fire(ArActionDesired currentDesired);
+ void setFireProc(Rice::Object proc);
+ void setSensors(Rice::Object sensors);
+ Rice::Object getSensor(Rice::Symbol sensor);
+ virtual void setRobot(ArRobot *robot);
+
+protected:
+ ArActionDesired myDesired;
+ Rice::Object *myFireProc;
+ Rice::Array mySensors;
+
+ // Sensors
+ RARangeDevice *mySonar;
+};
diff --git a/ext/rubot_aria/RARangeDevice.cpp b/ext/rubot_aria/RARangeDevice.cpp
new file mode 100644
index 0000000..5548b45
--- /dev/null
+++ b/ext/rubot_aria/RARangeDevice.cpp
@@ -0,0 +1,13 @@
+#include "Aria.h"
+
+#include "RARangeDevice.h"
+
+RARangeDevice::RARangeDevice(ArRangeDevice *rangeDevice)
+{
+ myRangeDevice = rangeDevice;
+}
+
+double RARangeDevice::range(double startAngle, double endAngle)
+{
+ return myRangeDevice->currentReadingPolar(startAngle, endAngle, NULL);
+}
diff --git a/ext/rubot_aria/RARangeDevice.h b/ext/rubot_aria/RARangeDevice.h
new file mode 100644
index 0000000..18d22bc
--- /dev/null
+++ b/ext/rubot_aria/RARangeDevice.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#include "Aria.h"
+
+/*
+ * RARangeDevice
+ * Wraps an ArRangeDevice to provide a nicer interface.
+ *
+ */
+
+class RARangeDevice
+{
+public:
+ RARangeDevice(ArRangeDevice *rangeDevice);
+ virtual ~RARangeDevice() {};
+ double range(double startAngle, double endAngle);
+
+private:
+ ArRangeDevice *myRangeDevice;
+};
diff --git a/ext/rubot_aria/RARobotManager.cpp b/ext/rubot_aria/RARobotManager.cpp
new file mode 100644
index 0000000..42860f5
--- /dev/null
+++ b/ext/rubot_aria/RARobotManager.cpp
@@ -0,0 +1,73 @@
+#include "Aria.h"
+#include "RARobotManager.h"
+
+using namespace Rice;
+
+
+RARobotManager::RARobotManager()
+ : myRobot(), myStopCB(this, &RARobotManager::stop)
+{
+ ArLog::log(ArLog::Normal, "Created robot manager.");
+ myRobotKeyHandler = NULL;
+
+ // Sensors
+ mySonar = NULL;
+}
+
+RARobotManager::~RARobotManager()
+{
+ if (myRobotKeyHandler != NULL)
+ delete myRobotKeyHandler;
+ if (mySonar != NULL)
+ delete mySonar;
+ ArLog::log(ArLog::Normal, "Destroyed robot manager.");
+}
+
+// Connect to robot and run.
+void RARobotManager::go(const char *argString="")
+{
+ ArArgumentBuilder args;
+ args.add(argString);
+ ArSimpleConnector conn(&args);
+ conn.parseArgs();
+ // TODO: Handle connection error
+ conn.connectRobot(&myRobot);
+ myRobot.enableMotors();
+
+ if (myRobotKeyHandler != NULL)
+ delete myRobotKeyHandler;
+ myRobotKeyHandler = new ArKeyHandler(false, false);
+ myRobotKeyHandler->addKeyHandler(ArKeyHandler::ESCAPE, &myStopCB);
+ myRobot.attachKeyHandler(myRobotKeyHandler, false);
+
+ myRobot.run(true);
+}
+
+
+void RARobotManager::stop()
+{
+ myRobot.stopRunning();
+ if (myRobotKeyHandler != NULL) {
+ delete myRobotKeyHandler;
+ myRobotKeyHandler = NULL;
+ }
+}
+
+
+void RARobotManager::addAction(RAGenericAction *action, int priority)
+{
+ ArLog::log(ArLog::Normal, "Adding action \"%s\" with priority %d.", action->getName(), priority);
+ myRobot.addAction(action, priority);
+}
+
+
+void RARobotManager::addSensor(Symbol sensor)
+{
+ if (sensor == Symbol("sonar") && mySonar == NULL) {
+ mySonar = new ArSonarDevice;
+ myRobot.addRangeDevice(mySonar);
+ }
+ else {
+ // TODO: Tell user if sensor is not supported.
+ }
+}
diff --git a/ext/rubot_aria/RARobotManager.h b/ext/rubot_aria/RARobotManager.h
new file mode 100644
index 0000000..681c685
--- /dev/null
+++ b/ext/rubot_aria/RARobotManager.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include "Aria.h"
+#include "RAGenericAction.h"
+
+/*
+ * RARobotManager
+ * Encapsulates an ArRobot and its connection.
+ *
+ */
+
+class RARobotManager
+{
+public:
+ RARobotManager();
+ virtual ~RARobotManager();
+ void go(const char *argString);
+ void stop();
+ void addAction(RAGenericAction *action, int priority);
+ void addSensor(Rice::Symbol sensor);
+
+private:
+ ArRobot myRobot;
+ ArFunctorC<RARobotManager> myStopCB;
+ ArKeyHandler *myRobotKeyHandler;
+
+ // Sensors
+ ArSonarDevice *mySonar;
+};
diff --git a/ext/rubot_aria/rubot_aria.cpp b/ext/rubot_aria/rubot_aria.cpp
index 0690044..b6ad19d 100644
--- a/ext/rubot_aria/rubot_aria.cpp
+++ b/ext/rubot_aria/rubot_aria.cpp
@@ -1,192 +1,52 @@
-#include <csignal>
-#include <iostream>
#include "rice/Module.hpp"
#include "rice/Data_Type.hpp"
#include "rice/Constructor.hpp"
#include "rice/Exception.hpp"
+#include "rice/Array.hpp"
#include "Aria.h"
+#include "RAGenericAction.h"
+#include "RARobotManager.h"
+#include "RARangeDevice.h"
+
using namespace std;
using namespace Rice;
-// Initializes Aria if it hasn't been done already.
-void ensureAriaInit()
+extern "C"
+void Init_rubot_aria()
{
static char inited = 0;
if (!inited) Aria::init(Aria::SIGHANDLE_NONE);
inited = 1;
-}
-
-
-/*
- * RAGenericAction
- * Generic ArAction that runs a Ruby proc when it fires.
- *
- */
-
-class RAGenericAction : public ArAction
-{
-public:
- RAGenericAction(const char *name);
- virtual ~RAGenericAction(void);
- virtual ArActionDesired *fire(ArActionDesired currentDesired);
- void setFireProc(Object proc);
- virtual void setRobot(ArRobot *robot);
-
-protected:
- ArActionDesired myDesired;
- Object *myProcP;
-};
-
-RAGenericAction::RAGenericAction(const char *name)
- : ArAction(name)
-{
- ArLog::log(ArLog::Normal, "Created generic action \"%s\".", name);
- myProcP = NULL;
-}
-
-RAGenericAction::~RAGenericAction()
-{
- if (myProcP != NULL)
- delete myProcP;
- ArLog::log(ArLog::Normal, "Destroyed generic action \"%s\".", getName());
-}
-ArActionDesired *RAGenericAction::fire(ArActionDesired currentDesired)
-{
- myDesired.reset();
- myDesired.merge(¤tDesired);
-
- if (myProcP != NULL)
- myProcP->call("call");
-
- return &myDesired;
-}
-
-void RAGenericAction::setFireProc(Object proc)
-{
- if (!proc.is_a(rb_cProc))
- throw Exception(rb_eArgError, "proc needs to be a Proc.");
- if (myProcP != NULL)
- delete myProcP;
- myProcP = new Object(proc);
-}
-
-void RAGenericAction::setRobot(ArRobot *robot)
-{
- ArAction::setRobot(robot);
- ArLog::log(ArLog::Normal, "Setting robot for action \"%s\".", getName());
-
-}
-
-
-
-/*
- * RARobotManager
- * Encapsulates an ArRobot and its connection.
- *
- */
-
-class RARobotManager
-{
-public:
- RARobotManager();
- virtual ~RARobotManager();
- void go(const char *argString);
- void stop();
- void addAction(RAGenericAction *action, int priority);
-
-private:
- ArRobot myRobot;
- ArFunctorC<RARobotManager> myStopCB;
- ArKeyHandler *myRobotKeyHandlerP;
-};
-
-// Not working yet
-// void handler(int signum)
-// {
-// cout << "Got signal." << endl;
-// }
-
-RARobotManager::RARobotManager()
- : myRobot(), myStopCB(this, &RARobotManager::stop)
-{
- ArLog::log(ArLog::Normal, "Created robot manager.");
- myRobotKeyHandlerP = NULL;
-}
-
-RARobotManager::~RARobotManager()
-{
- if (myRobotKeyHandlerP != NULL)
- delete myRobotKeyHandlerP;
- ArLog::log(ArLog::Normal, "Destroyed robot manager.");
-}
-
-// Connect to robot and run.
-void RARobotManager::go(const char *argString="")
-{
- ensureAriaInit();
- ArArgumentBuilder args;
- args.add(argString);
- ArSimpleConnector conn(&args);
- conn.parseArgs();
- // TODO: Handle connection error
- conn.connectRobot(&myRobot);
- myRobot.enableMotors();
-
- // Not working yet.
- // signal(SIGINT, handler);
-
- if (myRobotKeyHandlerP != NULL)
- delete myRobotKeyHandlerP;
- myRobotKeyHandlerP = new ArKeyHandler(false, false);
- myRobotKeyHandlerP->addKeyHandler(ArKeyHandler::ESCAPE, &myStopCB);
- myRobot.attachKeyHandler(myRobotKeyHandlerP, false);
-
- myRobot.run(true);
-}
-
-
-void RARobotManager::stop()
-{
- myRobot.stopRunning();
- if (myRobotKeyHandlerP != NULL)
- {
- delete myRobotKeyHandlerP;
- myRobotKeyHandlerP = NULL;
- }
-}
-
-
-void RARobotManager::addAction(RAGenericAction *action, int priority)
-{
- ArLog::log(ArLog::Normal, "Adding action \"%s\" with priority %d.", action->getName(), priority);
- myRobot.addAction(action, priority);
-}
-
-
-extern "C"
-void Init_rubot_aria()
-{
// Define Rubot::Adapters::Aria.
Object rb_MRubot = Class(rb_cObject).const_get("Rubot");
Object rb_MAdapters = Module(rb_MRubot).const_get("Adapters");
Object rb_MAria = Module(rb_MAdapters)
.define_module("Aria")
;
+
// Define Rubot::Adapters::Aria::RobotManager.
// Rubot::Adapters::Aria::Robot is defined in Ruby and uses this class.
Data_Type<RARobotManager> rb_cRobotManager = Module(rb_MAria)
.define_class<RARobotManager>("RobotManager")
.define_constructor(Constructor<RARobotManager>())
- .define_method("go",&RARobotManager::go)
+ .define_method("go", &RARobotManager::go)
.define_method("add_behavior", &RARobotManager::addAction)
+ .define_method("add_sensor", &RARobotManager::addSensor)
;
Data_Type<RAGenericAction> rb_cBehavior = Module(rb_MAria)
.define_class<RAGenericAction>("Behavior")
.define_constructor(Constructor<RAGenericAction, const char *>())
.define_method("set_fire_proc", &RAGenericAction::setFireProc)
+ .define_method("set_sensors", &RAGenericAction::setSensors)
+ .define_method("get_sensor", &RAGenericAction::getSensor)
;
+
+ Data_Type<RARangeDevice> rb_cRangeDevice = Module(rb_MAria)
+ .define_class<RARangeDevice>("RangeDevice")
+ .define_method("range", &RARangeDevice::range)
+ ;
}
diff --git a/lib/rubot/adapters.rb b/lib/rubot/adapters.rb
index 5bac413..50affdf 100644
--- a/lib/rubot/adapters.rb
+++ b/lib/rubot/adapters.rb
@@ -1,38 +1,39 @@
require 'facets/string/snakecase'
require 'facets/module/alias'
# This module contains the robotics adapters. For instance, the ACME
# Robotics adapter would be <tt>Rubot::Adapters::AcmeRobotics</tt>. Its robot
# class would be <tt>Rubot::Adapters::AcmeRobotics::Robot</tt>, and one can be
# created with
#
# Rubot.add_robot(:fred, :acme_robotics)
#
# or, in Rubot syntax,
#
# robot :fred do
# adapter :acme_robotics
# end
module Rubot
# Raised when attempting to create a robot with an unrecognized adapter.
class AdapterMissingError < Exception; end
module Adapters
class << self
def const_missing_with_autoload(name)
- begin
+ # TODO: Handle missing adapter without obscuring all LoadErrors.
+ # begin
req_name = "rubot/adapters/#{name.to_s.snakecase}"
require req_name
if const_defined? name
return const_get(name)
else
raise AdapterMissingError, "Adapter #{name} not loaded by '#{req_name}'."
end
- rescue LoadError
- raise AdapterMissingError, "Adapter #{name} not found."
- end
+ # rescue LoadError
+ # raise AdapterMissingError, "Adapter #{name} not found."
+ # end
end
alias_method_chain :const_missing, :autoload
end
end
end
diff --git a/lib/rubot/adapters/aria/robot.rb b/lib/rubot/adapters/aria/robot.rb
index dc5f5df..4cca71c 100644
--- a/lib/rubot/adapters/aria/robot.rb
+++ b/lib/rubot/adapters/aria/robot.rb
@@ -1,22 +1,26 @@
module Rubot::Adapters::Aria
class Robot
attr_reader :options
def initialize
@options = {}
@manager = RobotManager.new
end
def run
args = ''
args << "-remoteHost #{@options[:host]} " if @options[:host]
args << "-remoteRobotTcpPort #{@options[:port]} " if @options[:port]
@manager.go args
end
def add_behavior(behavior, priority)
raise ArgumentError, "Behavior must be an Aria::Behavior" unless behavior.instance_of? Behavior
@manager.add_behavior(behavior, priority)
end
+
+ def add_sensor(sensor)
+ @manager.add_sensor(sensor)
+ end
end
end
diff --git a/lib/rubot/dsl.rb b/lib/rubot/dsl.rb
index 6c27a91..aaa81f1 100644
--- a/lib/rubot/dsl.rb
+++ b/lib/rubot/dsl.rb
@@ -1,81 +1,136 @@
require 'facets/string/camelcase'
+require 'facets/symbol/to_proc'
module Rubot::DSL
BehaviorFactories = {}
Robots = {}
class BehaviorFactoryBuilder
def initialize(name, &block)
@name = name.to_sym
+ @sensors = []
self.instance_eval(&block)
end
+ # Defines the block of code to run when this behavior fires.
+ #
+ # behavior :do_stuff do
+ # fire do
+ # # Do stuff
+ # end
+ # end
def fire(&block)
@fire = block
end
+ # Specifies sensors to make available to the fire block.
+ #
+ # behavior :log_sonar do
+ # sensors :sonar
+ # fire do
+ # puts "Sonar is reading #{sonar.range(-70,70)}"
+ # end
+ # end
+ def sensors(*sensors)
+ @sensors += sensors.map(&:to_sym)
+ end
+
def build
- BehaviorFactory.new(@name, @fire)
+ BehaviorFactory.new(@name, @fire, @sensors.uniq)
end
end
class BehaviorFactory
- def initialize(name, fire)
+ def initialize(name, fire, sensors)
@name = name
@fire = fire
+ @sensors = sensors
end
- def create_for_adapter(adapter)
- behavior = Rubot::Adapters.const_get(adapter)::Behavior.new @name.to_s
- behavior.set_fire_proc @fire
- behavior
+ def create_for_robot(robot)
+ BehaviorContext.new(@name, @fire, @sensors, robot).behavior
end
end
+ class BehaviorContext
+ attr_reader :behavior, :robot
+ def initialize(name, fire, sensors, robot)
+ @name = name
+ @fire = fire
+ @sensors = sensors
+ @robot = robot
+ @behavior = Rubot::Adapters.const_get(robot.adapter)::Behavior.new name.to_s
+ # Have the behavior execute the fire proc in context of this object.
+ @behavior.set_fire_proc Proc.new { self.instance_eval(&@fire) }
+ @behavior.set_sensors @sensors
+ end
+
+ # Return the named sensor, if one is given.
+ def method_missing(sym, *args)
+ if @sensors.include? sym
+ @behavior.get_sensor(sym)
+ else
+ super
+ end
+ end
+
+ # def desired
+ end
+
class RobotBuilder
+ attr_reader :adapter
def initialize(name, &block)
@name = name.to_sym
@options = {}
+ @sensors = []
@behaviors = []
self.instance_eval(&block)
end
- def adapter(name)
- @adapter = name.to_s.camelcase(true).to_sym
+ # Set the adapter for the robot, if name is given. Otherwise, return the adapter
+ def adapter(name=nil)
+ # TODO: Stop user from changing the adapter once set.
+ @adapter = name.to_s.camelcase(true).to_sym if name
+ @adapter
+ end
+
+ def sensors(*sensors)
+ @sensors += sensors.map(&:to_sym)
end
def behavior(name, priority)
@behaviors << [name.to_sym, priority]
end
def method_missing(opt, *args)
@options[opt] = ( args.size == 1 ? args.first : args )
nil
end
def build
raise "Robot #{@name} declared without an adapter." unless @adapter
robot = Rubot::Adapters.const_get(@adapter)::Robot.new
robot.options.merge! @options
+ @sensors.each { |s| robot.add_sensor s }
@behaviors.each do |name, priority|
- b = BehaviorFactories[name].create_for_adapter(@adapter)
+ b = BehaviorFactories[name].create_for_robot(self)
robot.add_behavior b, priority
end
robot
end
end
def behavior(name, &block)
bb = BehaviorFactoryBuilder.new(name, &block)
BehaviorFactories[name.to_sym] = bb.build
end
def robot(name, &block)
rb = RobotBuilder.new(name, &block)
Robots[name.to_sym] = rb.build
end
def run(name)
Robots[name].run
end
end
|
Peeja/rubot
|
f1ea18731c07c206df19bccd6addfe5b5e128180
|
DSL now creates a new behavior for each robot that needs one.
|
diff --git a/lib/rubot/dsl.rb b/lib/rubot/dsl.rb
index 500a6e7..6c27a91 100644
--- a/lib/rubot/dsl.rb
+++ b/lib/rubot/dsl.rb
@@ -1,72 +1,81 @@
require 'facets/string/camelcase'
module Rubot::DSL
+ BehaviorFactories = {}
Robots = {}
- Behaviors = {}
+
+ class BehaviorFactoryBuilder
+ def initialize(name, &block)
+ @name = name.to_sym
+ self.instance_eval(&block)
+ end
+
+ def fire(&block)
+ @fire = block
+ end
+
+ def build
+ BehaviorFactory.new(@name, @fire)
+ end
+ end
+
+ class BehaviorFactory
+ def initialize(name, fire)
+ @name = name
+ @fire = fire
+ end
+
+ def create_for_adapter(adapter)
+ behavior = Rubot::Adapters.const_get(adapter)::Behavior.new @name.to_s
+ behavior.set_fire_proc @fire
+ behavior
+ end
+ end
class RobotBuilder
def initialize(name, &block)
@name = name.to_sym
@options = {}
@behaviors = []
self.instance_eval(&block)
end
def adapter(name)
@adapter = name.to_s.camelcase(true).to_sym
end
def behavior(name, priority)
@behaviors << [name.to_sym, priority]
end
def method_missing(opt, *args)
@options[opt] = ( args.size == 1 ? args.first : args )
nil
end
def build
raise "Robot #{@name} declared without an adapter." unless @adapter
robot = Rubot::Adapters.const_get(@adapter)::Robot.new
robot.options.merge! @options
- @behaviors.each { |n, p| robot.add_behavior Behaviors[n], p }
+ @behaviors.each do |name, priority|
+ b = BehaviorFactories[name].create_for_adapter(@adapter)
+ robot.add_behavior b, priority
+ end
robot
end
end
- class BehaviorBuilder
- def initialize(name, &block)
- @name = name.to_sym
- self.instance_eval(&block)
- end
-
- def adapter(name)
- @adapter = name.to_s.camelcase(true).to_sym
- end
-
- def fire(&block)
- @fire = block
- end
-
- def build
- raise "Behavior #{@name} declared without an adapter." unless @adapter
- behavior = Rubot::Adapters.const_get(@adapter)::Behavior.new @name.to_s
- behavior.set_fire_proc @fire
- behavior
- end
+ def behavior(name, &block)
+ bb = BehaviorFactoryBuilder.new(name, &block)
+ BehaviorFactories[name.to_sym] = bb.build
end
def robot(name, &block)
rb = RobotBuilder.new(name, &block)
Robots[name.to_sym] = rb.build
end
- def behavior(name, &block)
- bb = BehaviorBuilder.new(name, &block)
- Behaviors[name.to_sym] = bb.build
- end
-
def run(name)
Robots[name].run
end
-end
\ No newline at end of file
+end
|
Peeja/rubot
|
b1c5a7c3d08947b8c5c1dafa1678c56cc9e0c32d
|
Implemented basic DSL. Behaviors can be added to robots and will fire.
|
diff --git a/bin/rubot b/bin/rubot
old mode 100644
new mode 100755
index ae09f71..1a4b2b6
--- a/bin/rubot
+++ b/bin/rubot
@@ -1,10 +1,20 @@
#!/usr/bin/env ruby
require 'rubygems'
require 'main'
+require 'rubot'
-Main do
- argument 'definition' do
- required
- end
-end
+# Main do
+# argument 'file' do
+# required
+# description 'Rubot file to run'
+# end
+#
+# def run
+# include Rubot::DSL
+# load params['file']
+# end
+# end
+
+include Rubot::DSL
+load ARGV[0]
diff --git a/ext/rubot_aria/rubot_aria.cpp b/ext/rubot_aria/rubot_aria.cpp
index c4d5f1b..0690044 100644
--- a/ext/rubot_aria/rubot_aria.cpp
+++ b/ext/rubot_aria/rubot_aria.cpp
@@ -1,165 +1,192 @@
#include <csignal>
#include <iostream>
#include "rice/Module.hpp"
#include "rice/Data_Type.hpp"
#include "rice/Constructor.hpp"
#include "rice/Exception.hpp"
#include "Aria.h"
using namespace std;
using namespace Rice;
// Initializes Aria if it hasn't been done already.
void ensureAriaInit()
{
static char inited = 0;
if (!inited) Aria::init(Aria::SIGHANDLE_NONE);
inited = 1;
}
/*
* RAGenericAction
* Generic ArAction that runs a Ruby proc when it fires.
*
*/
class RAGenericAction : public ArAction
{
public:
RAGenericAction(const char *name);
- virtual ~RAGenericAction(void) {};
+ virtual ~RAGenericAction(void);
virtual ArActionDesired *fire(ArActionDesired currentDesired);
void setFireProc(Object proc);
+ virtual void setRobot(ArRobot *robot);
protected:
ArActionDesired myDesired;
Object *myProcP;
};
RAGenericAction::RAGenericAction(const char *name)
: ArAction(name)
{
ArLog::log(ArLog::Normal, "Created generic action \"%s\".", name);
myProcP = NULL;
}
+RAGenericAction::~RAGenericAction()
+{
+ if (myProcP != NULL)
+ delete myProcP;
+ ArLog::log(ArLog::Normal, "Destroyed generic action \"%s\".", getName());
+}
+
ArActionDesired *RAGenericAction::fire(ArActionDesired currentDesired)
{
myDesired.reset();
myDesired.merge(¤tDesired);
if (myProcP != NULL)
myProcP->call("call");
return &myDesired;
}
void RAGenericAction::setFireProc(Object proc)
{
if (!proc.is_a(rb_cProc))
throw Exception(rb_eArgError, "proc needs to be a Proc.");
if (myProcP != NULL)
delete myProcP;
myProcP = new Object(proc);
}
+void RAGenericAction::setRobot(ArRobot *robot)
+{
+ ArAction::setRobot(robot);
+ ArLog::log(ArLog::Normal, "Setting robot for action \"%s\".", getName());
+
+}
+
/*
* RARobotManager
* Encapsulates an ArRobot and its connection.
*
*/
class RARobotManager
{
public:
RARobotManager();
+ virtual ~RARobotManager();
void go(const char *argString);
void stop();
void addAction(RAGenericAction *action, int priority);
private:
ArRobot myRobot;
ArFunctorC<RARobotManager> myStopCB;
ArKeyHandler *myRobotKeyHandlerP;
};
// Not working yet
// void handler(int signum)
// {
// cout << "Got signal." << endl;
// }
RARobotManager::RARobotManager()
: myRobot(), myStopCB(this, &RARobotManager::stop)
{
+ ArLog::log(ArLog::Normal, "Created robot manager.");
myRobotKeyHandlerP = NULL;
}
+RARobotManager::~RARobotManager()
+{
+ if (myRobotKeyHandlerP != NULL)
+ delete myRobotKeyHandlerP;
+ ArLog::log(ArLog::Normal, "Destroyed robot manager.");
+}
+
// Connect to robot and run.
void RARobotManager::go(const char *argString="")
{
ensureAriaInit();
ArArgumentBuilder args;
args.add(argString);
ArSimpleConnector conn(&args);
conn.parseArgs();
// TODO: Handle connection error
conn.connectRobot(&myRobot);
myRobot.enableMotors();
// Not working yet.
// signal(SIGINT, handler);
if (myRobotKeyHandlerP != NULL)
delete myRobotKeyHandlerP;
myRobotKeyHandlerP = new ArKeyHandler(false, false);
myRobotKeyHandlerP->addKeyHandler(ArKeyHandler::ESCAPE, &myStopCB);
myRobot.attachKeyHandler(myRobotKeyHandlerP, false);
myRobot.run(true);
}
void RARobotManager::stop()
{
myRobot.stopRunning();
if (myRobotKeyHandlerP != NULL)
+ {
delete myRobotKeyHandlerP;
+ myRobotKeyHandlerP = NULL;
+ }
}
void RARobotManager::addAction(RAGenericAction *action, int priority)
{
ArLog::log(ArLog::Normal, "Adding action \"%s\" with priority %d.", action->getName(), priority);
myRobot.addAction(action, priority);
}
extern "C"
void Init_rubot_aria()
{
// Define Rubot::Adapters::Aria.
Object rb_MRubot = Class(rb_cObject).const_get("Rubot");
Object rb_MAdapters = Module(rb_MRubot).const_get("Adapters");
Object rb_MAria = Module(rb_MAdapters)
.define_module("Aria")
;
// Define Rubot::Adapters::Aria::RobotManager.
// Rubot::Adapters::Aria::Robot is defined in Ruby and uses this class.
Data_Type<RARobotManager> rb_cRobotManager = Module(rb_MAria)
.define_class<RARobotManager>("RobotManager")
.define_constructor(Constructor<RARobotManager>())
.define_method("go",&RARobotManager::go)
.define_method("add_behavior", &RARobotManager::addAction)
;
Data_Type<RAGenericAction> rb_cBehavior = Module(rb_MAria)
.define_class<RAGenericAction>("Behavior")
.define_constructor(Constructor<RAGenericAction, const char *>())
.define_method("set_fire_proc", &RAGenericAction::setFireProc)
;
}
diff --git a/lib/rubot.rb b/lib/rubot.rb
index 17e0090..251ef27 100644
--- a/lib/rubot.rb
+++ b/lib/rubot.rb
@@ -1,13 +1,14 @@
# Require everything except things under rubot/adapters/ (which load lazily).
# (Dir[File.join(::File.dirname(__FILE__), '**', '*.rb')] -
# Dir[File.join(::File.dirname(__FILE__), 'rubot', 'adapters', '**')]).sort.each {|rb| require rb}
unless defined? Rubot
-require 'rubot/adapters'
+module Rubot; end
+
require 'rubot/meta'
-module Rubot
-end
+require 'rubot/adapters'
+require 'rubot/dsl'
end
diff --git a/lib/rubot/adapters/aria.rb b/lib/rubot/adapters/aria.rb
index f58948a..234197a 100644
--- a/lib/rubot/adapters/aria.rb
+++ b/lib/rubot/adapters/aria.rb
@@ -1,5 +1,4 @@
require 'rubot' if not defined? Rubot
require 'rubot_aria'
require File.dirname(__FILE__) + "/aria/robot"
-require File.dirname(__FILE__) + "/aria/behavior"
diff --git a/lib/rubot/dsl.rb b/lib/rubot/dsl.rb
new file mode 100644
index 0000000..500a6e7
--- /dev/null
+++ b/lib/rubot/dsl.rb
@@ -0,0 +1,72 @@
+require 'facets/string/camelcase'
+
+module Rubot::DSL
+ Robots = {}
+ Behaviors = {}
+
+ class RobotBuilder
+ def initialize(name, &block)
+ @name = name.to_sym
+ @options = {}
+ @behaviors = []
+ self.instance_eval(&block)
+ end
+
+ def adapter(name)
+ @adapter = name.to_s.camelcase(true).to_sym
+ end
+
+ def behavior(name, priority)
+ @behaviors << [name.to_sym, priority]
+ end
+
+ def method_missing(opt, *args)
+ @options[opt] = ( args.size == 1 ? args.first : args )
+ nil
+ end
+
+ def build
+ raise "Robot #{@name} declared without an adapter." unless @adapter
+ robot = Rubot::Adapters.const_get(@adapter)::Robot.new
+ robot.options.merge! @options
+ @behaviors.each { |n, p| robot.add_behavior Behaviors[n], p }
+ robot
+ end
+ end
+
+ class BehaviorBuilder
+ def initialize(name, &block)
+ @name = name.to_sym
+ self.instance_eval(&block)
+ end
+
+ def adapter(name)
+ @adapter = name.to_s.camelcase(true).to_sym
+ end
+
+ def fire(&block)
+ @fire = block
+ end
+
+ def build
+ raise "Behavior #{@name} declared without an adapter." unless @adapter
+ behavior = Rubot::Adapters.const_get(@adapter)::Behavior.new @name.to_s
+ behavior.set_fire_proc @fire
+ behavior
+ end
+ end
+
+ def robot(name, &block)
+ rb = RobotBuilder.new(name, &block)
+ Robots[name.to_sym] = rb.build
+ end
+
+ def behavior(name, &block)
+ bb = BehaviorBuilder.new(name, &block)
+ Behaviors[name.to_sym] = bb.build
+ end
+
+ def run(name)
+ Robots[name].run
+ end
+end
\ No newline at end of file
diff --git a/spec/rubot/dsl_spec.rb b/spec/rubot/dsl_spec.rb
new file mode 100644
index 0000000..55c16e0
--- /dev/null
+++ b/spec/rubot/dsl_spec.rb
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+module Rubot::Adapters::Acme
+ class Robot
+ attr_reader :options
+ def initialize
+ @options = {}
+ end
+ end
+ class Behavior; end
+end
+
+describe Rubot::DSL do
+ include Rubot::DSL
+
+ it "should create a robot" do
+ robot :fred do
+ adapter :acme
+ end
+ Rubot::DSL::Robots[:fred].should be_an_instance_of(Rubot::Adapters::Acme::Robot)
+ end
+end
|
Peeja/rubot
|
641304db450b9664a2a398124d522521e6060536
|
Basic behavior system working. Will move some fire proc code into Ruby. # Please enter the commit message for your changes.
|
diff --git a/ext/rubot_aria/rubot_aria.cpp b/ext/rubot_aria/rubot_aria.cpp
index a6fe4c1..c4d5f1b 100644
--- a/ext/rubot_aria/rubot_aria.cpp
+++ b/ext/rubot_aria/rubot_aria.cpp
@@ -1,134 +1,165 @@
#include <csignal>
#include <iostream>
#include "rice/Module.hpp"
#include "rice/Data_Type.hpp"
#include "rice/Constructor.hpp"
+#include "rice/Exception.hpp"
#include "Aria.h"
using namespace std;
using namespace Rice;
// Initializes Aria if it hasn't been done already.
void ensureAriaInit()
{
static char inited = 0;
if (!inited) Aria::init(Aria::SIGHANDLE_NONE);
inited = 1;
}
/*
- * RAAction
+ * RAGenericAction
* Generic ArAction that runs a Ruby proc when it fires.
*
*/
-class RAAction : public ArAction
+class RAGenericAction : public ArAction
{
public:
- RAAction(const char *name);
- virtual ~RAAction(void) {};
+ RAGenericAction(const char *name);
+ virtual ~RAGenericAction(void) {};
virtual ArActionDesired *fire(ArActionDesired currentDesired);
+ void setFireProc(Object proc);
protected:
ArActionDesired myDesired;
+ Object *myProcP;
};
-RAAction::RAAction(const char *name)
+RAGenericAction::RAGenericAction(const char *name)
: ArAction(name)
-{}
+{
+ ArLog::log(ArLog::Normal, "Created generic action \"%s\".", name);
+ myProcP = NULL;
+}
-ArActionDesired *RAAction::fire(ArActionDesired currentDesired)
+ArActionDesired *RAGenericAction::fire(ArActionDesired currentDesired)
{
myDesired.reset();
myDesired.merge(¤tDesired);
-
+
+ if (myProcP != NULL)
+ myProcP->call("call");
return &myDesired;
}
+void RAGenericAction::setFireProc(Object proc)
+{
+ if (!proc.is_a(rb_cProc))
+ throw Exception(rb_eArgError, "proc needs to be a Proc.");
+ if (myProcP != NULL)
+ delete myProcP;
+ myProcP = new Object(proc);
+}
+
+
/*
* RARobotManager
* Encapsulates an ArRobot and its connection.
*
*/
class RARobotManager
{
public:
RARobotManager();
void go(const char *argString);
void stop();
+ void addAction(RAGenericAction *action, int priority);
private:
ArRobot myRobot;
ArFunctorC<RARobotManager> myStopCB;
ArKeyHandler *myRobotKeyHandlerP;
};
// Not working yet
// void handler(int signum)
// {
// cout << "Got signal." << endl;
// }
RARobotManager::RARobotManager()
: myRobot(), myStopCB(this, &RARobotManager::stop)
{
myRobotKeyHandlerP = NULL;
}
// Connect to robot and run.
void RARobotManager::go(const char *argString="")
{
ensureAriaInit();
ArArgumentBuilder args;
args.add(argString);
ArSimpleConnector conn(&args);
conn.parseArgs();
// TODO: Handle connection error
conn.connectRobot(&myRobot);
myRobot.enableMotors();
// Not working yet.
// signal(SIGINT, handler);
if (myRobotKeyHandlerP != NULL)
delete myRobotKeyHandlerP;
myRobotKeyHandlerP = new ArKeyHandler(false, false);
myRobotKeyHandlerP->addKeyHandler(ArKeyHandler::ESCAPE, &myStopCB);
myRobot.attachKeyHandler(myRobotKeyHandlerP, false);
myRobot.run(true);
}
void RARobotManager::stop()
{
myRobot.stopRunning();
if (myRobotKeyHandlerP != NULL)
delete myRobotKeyHandlerP;
}
+void RARobotManager::addAction(RAGenericAction *action, int priority)
+{
+ ArLog::log(ArLog::Normal, "Adding action \"%s\" with priority %d.", action->getName(), priority);
+ myRobot.addAction(action, priority);
+}
extern "C"
void Init_rubot_aria()
{
// Define Rubot::Adapters::Aria.
Object rb_MRubot = Class(rb_cObject).const_get("Rubot");
Object rb_MAdapters = Module(rb_MRubot).const_get("Adapters");
Object rb_MAria = Module(rb_MAdapters)
.define_module("Aria")
;
// Define Rubot::Adapters::Aria::RobotManager.
// Rubot::Adapters::Aria::Robot is defined in Ruby and uses this class.
- Data_Type<RARobotManager> rb_cAriaRobot = Module(rb_MAria)
- .define_class<RARobotManager>("RobotManager")
- .define_constructor(Constructor<RARobotManager>())
- .define_method("go",&RARobotManager::go)
+ Data_Type<RARobotManager> rb_cRobotManager = Module(rb_MAria)
+ .define_class<RARobotManager>("RobotManager")
+ .define_constructor(Constructor<RARobotManager>())
+ .define_method("go",&RARobotManager::go)
+ .define_method("add_behavior", &RARobotManager::addAction)
+ ;
+
+ Data_Type<RAGenericAction> rb_cBehavior = Module(rb_MAria)
+ .define_class<RAGenericAction>("Behavior")
+ .define_constructor(Constructor<RAGenericAction, const char *>())
+ .define_method("set_fire_proc", &RAGenericAction::setFireProc)
;
}
diff --git a/lib/rubot/adapters/aria.rb b/lib/rubot/adapters/aria.rb
index 234197a..f58948a 100644
--- a/lib/rubot/adapters/aria.rb
+++ b/lib/rubot/adapters/aria.rb
@@ -1,4 +1,5 @@
require 'rubot' if not defined? Rubot
require 'rubot_aria'
require File.dirname(__FILE__) + "/aria/robot"
+require File.dirname(__FILE__) + "/aria/behavior"
diff --git a/lib/rubot/adapters/aria/robot.rb b/lib/rubot/adapters/aria/robot.rb
index 8a457e0..dc5f5df 100644
--- a/lib/rubot/adapters/aria/robot.rb
+++ b/lib/rubot/adapters/aria/robot.rb
@@ -1,17 +1,22 @@
module Rubot::Adapters::Aria
class Robot
attr_reader :options
def initialize
@options = {}
@manager = RobotManager.new
end
def run
args = ''
args << "-remoteHost #{@options[:host]} " if @options[:host]
args << "-remoteRobotTcpPort #{@options[:port]} " if @options[:port]
@manager.go args
end
+
+ def add_behavior(behavior, priority)
+ raise ArgumentError, "Behavior must be an Aria::Behavior" unless behavior.instance_of? Behavior
+ @manager.add_behavior(behavior, priority)
+ end
end
end
diff --git a/spec/rubot/adapters/aria/robot_spec.rb b/spec/rubot/adapters/aria/robot_spec.rb
index 971dede..56fe440 100644
--- a/spec/rubot/adapters/aria/robot_spec.rb
+++ b/spec/rubot/adapters/aria/robot_spec.rb
@@ -1,38 +1,38 @@
require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])
# fred = Rubot::Adapters::Aria::Robot.new
# fred.options[:host] = 'localhost'
include Rubot::Adapters::Aria
describe Robot do
before(:each) do
@mock_manager = mock("manager")
RobotManager.stub!(:new).and_return(@mock_manager)
@robot = Robot.new
end
it "should have options hash" do
@robot.options[:be_awesome] = true
@robot.options.keys.should include(:be_awesome)
end
it "should run the robot" do
@mock_manager.should_receive(:go)
@robot.run
end
it "should connect to the specified host" do
@robot.options[:host] = 'robothost'
@mock_manager.should_receive(:go).with(/-remoteHost robothost/)
@robot.run
end
it "should connect to the specified port" do
@robot.options[:port] = 3456
@mock_manager.should_receive(:go).with(/-remoteRobotTcpPort 3456/)
@robot.run
end
- # Add serial connection support.
+ # TODO: Add serial connection support.
end
|
Peeja/rubot
|
fd93ed04a4f229c612b9fce14d480afc2854924e
|
Mostly working now. Running a robot takes over the thread and returns on ESC. Hitting occasional segfaults and terminal problems on running a robot twice.
|
diff --git a/ext/rubot_aria/rubot_aria.cpp b/ext/rubot_aria/rubot_aria.cpp
index 0bbaea4..a6fe4c1 100644
--- a/ext/rubot_aria/rubot_aria.cpp
+++ b/ext/rubot_aria/rubot_aria.cpp
@@ -1,115 +1,134 @@
#include <csignal>
#include <iostream>
#include "rice/Module.hpp"
#include "rice/Data_Type.hpp"
#include "rice/Constructor.hpp"
#include "Aria.h"
using namespace std;
using namespace Rice;
// Initializes Aria if it hasn't been done already.
void ensureAriaInit()
{
- static char inited = 0;
- if (!inited) Aria::init(Aria::SIGHANDLE_NONE);
- inited = 1;
+ static char inited = 0;
+ if (!inited) Aria::init(Aria::SIGHANDLE_NONE);
+ inited = 1;
}
/*
* RAAction
* Generic ArAction that runs a Ruby proc when it fires.
*
*/
class RAAction : public ArAction
{
public:
RAAction(const char *name);
virtual ~RAAction(void) {};
virtual ArActionDesired *fire(ArActionDesired currentDesired);
protected:
ArActionDesired myDesired;
};
RAAction::RAAction(const char *name)
- : ArAction(name)
+ : ArAction(name)
{}
ArActionDesired *RAAction::fire(ArActionDesired currentDesired)
{
- myDesired.reset();
- myDesired.merge(¤tDesired);
-
-
- return &myDesired;
+ myDesired.reset();
+ myDesired.merge(¤tDesired);
+
+
+ return &myDesired;
}
/*
* RARobotManager
* Encapsulates an ArRobot and its connection.
*
*/
class RARobotManager
{
public:
- RARobotManager();
- void go(const char *argString);
+ RARobotManager();
+ void go(const char *argString);
+ void stop();
private:
- ArRobot myRobot;
+ ArRobot myRobot;
+ ArFunctorC<RARobotManager> myStopCB;
+ ArKeyHandler *myRobotKeyHandlerP;
};
// Not working yet
// void handler(int signum)
// {
-// cout << "Got signal." << endl;
+// cout << "Got signal." << endl;
// }
RARobotManager::RARobotManager()
- : myRobot() {}
+ : myRobot(), myStopCB(this, &RARobotManager::stop)
+{
+ myRobotKeyHandlerP = NULL;
+}
// Connect to robot and run.
void RARobotManager::go(const char *argString="")
{
- ensureAriaInit();
- ArArgumentBuilder args;
- args.add(argString);
- ArSimpleConnector conn(&args);
- conn.parseArgs();
- // TODO: Handle connection error
- conn.connectRobot(&myRobot);
- myRobot.enableMotors();
-
- // Not working yet.
- // signal(SIGINT, handler);
-
- myRobot.run(true);
+ ensureAriaInit();
+ ArArgumentBuilder args;
+ args.add(argString);
+ ArSimpleConnector conn(&args);
+ conn.parseArgs();
+ // TODO: Handle connection error
+ conn.connectRobot(&myRobot);
+ myRobot.enableMotors();
+
+ // Not working yet.
+ // signal(SIGINT, handler);
+
+ if (myRobotKeyHandlerP != NULL)
+ delete myRobotKeyHandlerP;
+ myRobotKeyHandlerP = new ArKeyHandler(false, false);
+ myRobotKeyHandlerP->addKeyHandler(ArKeyHandler::ESCAPE, &myStopCB);
+ myRobot.attachKeyHandler(myRobotKeyHandlerP, false);
+
+ myRobot.run(true);
}
+void RARobotManager::stop()
+{
+ myRobot.stopRunning();
+ if (myRobotKeyHandlerP != NULL)
+ delete myRobotKeyHandlerP;
+}
+
extern "C"
void Init_rubot_aria()
{
- // Define Rubot::Adapters::Aria.
- Object rb_MRubot = Class(rb_cObject).const_get("Rubot");
- Object rb_MAdapters = Module(rb_MRubot).const_get("Adapters");
- Object rb_MAria = Module(rb_MAdapters)
- .define_module("Aria")
- ;
+ // Define Rubot::Adapters::Aria.
+ Object rb_MRubot = Class(rb_cObject).const_get("Rubot");
+ Object rb_MAdapters = Module(rb_MRubot).const_get("Adapters");
+ Object rb_MAria = Module(rb_MAdapters)
+ .define_module("Aria")
+ ;
- // Define Rubot::Adapters::Aria::RobotManager.
- // Rubot::Adapters::Aria::Robot is defined in Ruby and uses this class.
- Data_Type<RARobotManager> rb_cAriaRobot = Module(rb_MAria)
- .define_class<RARobotManager>("RobotManager")
- .define_constructor(Constructor<RARobotManager>())
- .define_method("go",&RARobotManager::go)
- ;
+ // Define Rubot::Adapters::Aria::RobotManager.
+ // Rubot::Adapters::Aria::Robot is defined in Ruby and uses this class.
+ Data_Type<RARobotManager> rb_cAriaRobot = Module(rb_MAria)
+ .define_class<RARobotManager>("RobotManager")
+ .define_constructor(Constructor<RARobotManager>())
+ .define_method("go",&RARobotManager::go)
+ ;
}
diff --git a/lib/rubot/adapters/aria/robot.rb b/lib/rubot/adapters/aria/robot.rb
index 7d1bdd5..8a457e0 100644
--- a/lib/rubot/adapters/aria/robot.rb
+++ b/lib/rubot/adapters/aria/robot.rb
@@ -1,19 +1,17 @@
module Rubot::Adapters::Aria
class Robot
attr_reader :options
def initialize
@options = {}
@manager = RobotManager.new
end
def run
args = ''
args << "-remoteHost #{@options[:host]} " if @options[:host]
args << "-remoteRobotTcpPort #{@options[:port]} " if @options[:port]
- Thread.new do
- @manager.go args
- end
+ @manager.go args
end
end
end
|
Peeja/rubot
|
fab645b0aa402560e59b84effc0d432cfa563ea4
|
Added TCP port option to Aria::Robot (:port). Aria::Robot now runs itself in a Thread (which does us no good yet on Ruby 1.8). Switched to long-form commandline options for Aria for readability. Stubbed RobotManager.new, rather than mock it. Expectations don't belong in before blocks.
|
diff --git a/lib/rubot.rb b/lib/rubot.rb
index 0ed6085..17e0090 100644
--- a/lib/rubot.rb
+++ b/lib/rubot.rb
@@ -1,15 +1,13 @@
# Require everything except things under rubot/adapters/ (which load lazily).
# (Dir[File.join(::File.dirname(__FILE__), '**', '*.rb')] -
# Dir[File.join(::File.dirname(__FILE__), 'rubot', 'adapters', '**')]).sort.each {|rb| require rb}
-require 'facets/string/case'
-
unless defined? Rubot
require 'rubot/adapters'
require 'rubot/meta'
module Rubot
end
end
diff --git a/lib/rubot/adapters.rb b/lib/rubot/adapters.rb
index b18adb2..5bac413 100644
--- a/lib/rubot/adapters.rb
+++ b/lib/rubot/adapters.rb
@@ -1,38 +1,38 @@
-require 'facets/string/case'
+require 'facets/string/snakecase'
require 'facets/module/alias'
# This module contains the robotics adapters. For instance, the ACME
# Robotics adapter would be <tt>Rubot::Adapters::AcmeRobotics</tt>. Its robot
# class would be <tt>Rubot::Adapters::AcmeRobotics::Robot</tt>, and one can be
# created with
#
# Rubot.add_robot(:fred, :acme_robotics)
#
# or, in Rubot syntax,
#
# robot :fred do
# adapter :acme_robotics
# end
module Rubot
# Raised when attempting to create a robot with an unrecognized adapter.
class AdapterMissingError < Exception; end
module Adapters
class << self
def const_missing_with_autoload(name)
begin
req_name = "rubot/adapters/#{name.to_s.snakecase}"
require req_name
if const_defined? name
return const_get(name)
else
raise AdapterMissingError, "Adapter #{name} not loaded by '#{req_name}'."
end
rescue LoadError
raise AdapterMissingError, "Adapter #{name} not found."
end
end
alias_method_chain :const_missing, :autoload
end
end
end
diff --git a/lib/rubot/adapters/aria/robot.rb b/lib/rubot/adapters/aria/robot.rb
index 519146f..7d1bdd5 100644
--- a/lib/rubot/adapters/aria/robot.rb
+++ b/lib/rubot/adapters/aria/robot.rb
@@ -1,16 +1,19 @@
module Rubot::Adapters::Aria
class Robot
attr_reader :options
def initialize
@options = {}
@manager = RobotManager.new
end
def run
args = ''
- args << "-rh #{@options[:host]}" if @options[:host]
- @manager.go args
+ args << "-remoteHost #{@options[:host]} " if @options[:host]
+ args << "-remoteRobotTcpPort #{@options[:port]} " if @options[:port]
+ Thread.new do
+ @manager.go args
+ end
end
end
end
diff --git a/spec/rubot/adapters/aria/robot_spec.rb b/spec/rubot/adapters/aria/robot_spec.rb
index f5d6b31..971dede 100644
--- a/spec/rubot/adapters/aria/robot_spec.rb
+++ b/spec/rubot/adapters/aria/robot_spec.rb
@@ -1,32 +1,38 @@
require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])
# fred = Rubot::Adapters::Aria::Robot.new
# fred.options[:host] = 'localhost'
include Rubot::Adapters::Aria
describe Robot do
before(:each) do
@mock_manager = mock("manager")
- RobotManager.should_receive(:new).and_return(@mock_manager)
+ RobotManager.stub!(:new).and_return(@mock_manager)
@robot = Robot.new
end
it "should have options hash" do
@robot.options[:be_awesome] = true
@robot.options.keys.should include(:be_awesome)
end
it "should run the robot" do
@mock_manager.should_receive(:go)
@robot.run
end
it "should connect to the specified host" do
@robot.options[:host] = 'robothost'
- @mock_manager.should_receive(:go).with(/-rh robothost/)
+ @mock_manager.should_receive(:go).with(/-remoteHost robothost/)
@robot.run
end
+ it "should connect to the specified port" do
+ @robot.options[:port] = 3456
+ @mock_manager.should_receive(:go).with(/-remoteRobotTcpPort 3456/)
+ @robot.run
+ end
+
# Add serial connection support.
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.