Remove personal project confs.
Add xcuserdata to .gitignore
*.vcxproj.user\r
*.sdf\r
*.aps\r
+\r
+.DS_Store\r
+iOS/Tombo/Tombo.xcodeproj/project.xcworkspace/xcuserdata/\r
92DE3353151E277E00AD06EC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92DE332E151E277D00AD06EC /* Foundation.framework */; };
92DE335B151E277E00AD06EC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 92DE3359151E277E00AD06EC /* InfoPlist.strings */; };
92DE335E151E277E00AD06EC /* TomboTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 92DE335D151E277E00AD06EC /* TomboTests.m */; };
+ 92DE33861522998700AD06EC /* Storage.m in Sources */ = {isa = PBXBuildFile; fileRef = 92DE33851522998700AD06EC /* Storage.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
92DE335A151E277E00AD06EC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
92DE335C151E277E00AD06EC /* TomboTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TomboTests.h; sourceTree = "<group>"; };
92DE335D151E277E00AD06EC /* TomboTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TomboTests.m; sourceTree = "<group>"; };
+ 92DE33841522998700AD06EC /* Storage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Storage.h; sourceTree = "<group>"; };
+ 92DE33851522998700AD06EC /* Storage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Storage.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
92DE3347151E277D00AD06EC /* DetailViewController.h */,
92DE3348151E277D00AD06EC /* DetailViewController.m */,
92DE3333151E277D00AD06EC /* Supporting Files */,
+ 92DE33841522998700AD06EC /* Storage.h */,
+ 92DE33851522998700AD06EC /* Storage.m */,
);
path = Tombo;
sourceTree = "<group>";
92DE333D151E277D00AD06EC /* AppDelegate.m in Sources */,
92DE3346151E277D00AD06EC /* MasterViewController.m in Sources */,
92DE3349151E277D00AD06EC /* DetailViewController.m in Sources */,
+ 92DE33861522998700AD06EC /* Storage.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
92DE3363151E277E00AD06EC /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
92DE3364151E277E00AD06EC /* Build configuration list for PBXNativeTarget "TomboTests" */ = {
isa = XCConfigurationList;
92DE3366151E277E00AD06EC /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<Scheme
- version = "1.3">
- <BuildAction
- parallelizeBuildables = "YES"
- buildImplicitDependencies = "YES">
- <BuildActionEntries>
- <BuildActionEntry
- buildForTesting = "YES"
- buildForRunning = "YES"
- buildForProfiling = "YES"
- buildForArchiving = "YES"
- buildForAnalyzing = "YES">
- <BuildableReference
- BuildableIdentifier = "primary"
- BlueprintIdentifier = "92DE3327151E277D00AD06EC"
- BuildableName = "Tombo.app"
- BlueprintName = "Tombo"
- ReferencedContainer = "container:Tombo.xcodeproj">
- </BuildableReference>
- </BuildActionEntry>
- </BuildActionEntries>
- </BuildAction>
- <TestAction
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- shouldUseLaunchSchemeArgsEnv = "YES"
- buildConfiguration = "Debug">
- <Testables>
- <TestableReference
- skipped = "NO">
- <BuildableReference
- BuildableIdentifier = "primary"
- BlueprintIdentifier = "92DE334E151E277E00AD06EC"
- BuildableName = "TomboTests.octest"
- BlueprintName = "TomboTests"
- ReferencedContainer = "container:Tombo.xcodeproj">
- </BuildableReference>
- </TestableReference>
- </Testables>
- <MacroExpansion>
- <BuildableReference
- BuildableIdentifier = "primary"
- BlueprintIdentifier = "92DE3327151E277D00AD06EC"
- BuildableName = "Tombo.app"
- BlueprintName = "Tombo"
- ReferencedContainer = "container:Tombo.xcodeproj">
- </BuildableReference>
- </MacroExpansion>
- </TestAction>
- <LaunchAction
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- launchStyle = "0"
- useCustomWorkingDirectory = "NO"
- buildConfiguration = "Debug"
- ignoresPersistentStateOnLaunch = "NO"
- debugDocumentVersioning = "YES"
- allowLocationSimulation = "YES">
- <BuildableProductRunnable>
- <BuildableReference
- BuildableIdentifier = "primary"
- BlueprintIdentifier = "92DE3327151E277D00AD06EC"
- BuildableName = "Tombo.app"
- BlueprintName = "Tombo"
- ReferencedContainer = "container:Tombo.xcodeproj">
- </BuildableReference>
- </BuildableProductRunnable>
- <AdditionalOptions>
- </AdditionalOptions>
- </LaunchAction>
- <ProfileAction
- shouldUseLaunchSchemeArgsEnv = "YES"
- savedToolIdentifier = ""
- useCustomWorkingDirectory = "NO"
- buildConfiguration = "Release"
- debugDocumentVersioning = "YES">
- <BuildableProductRunnable>
- <BuildableReference
- BuildableIdentifier = "primary"
- BlueprintIdentifier = "92DE3327151E277D00AD06EC"
- BuildableName = "Tombo.app"
- BlueprintName = "Tombo"
- ReferencedContainer = "container:Tombo.xcodeproj">
- </BuildableReference>
- </BuildableProductRunnable>
- </ProfileAction>
- <AnalyzeAction
- buildConfiguration = "Debug">
- </AnalyzeAction>
- <ArchiveAction
- buildConfiguration = "Release"
- revealArchiveInOrganizer = "YES">
- </ArchiveAction>
-</Scheme>
+++ /dev/null
-<?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>SchemeUserState</key>
- <dict>
- <key>Tombo.xcscheme</key>
- <dict>
- <key>orderHint</key>
- <integer>0</integer>
- </dict>
- </dict>
- <key>SuppressBuildableAutocreation</key>
- <dict>
- <key>92DE3327151E277D00AD06EC</key>
- <dict>
- <key>primary</key>
- <true/>
- </dict>
- <key>92DE334E151E277E00AD06EC</key>
- <dict>
- <key>primary</key>
- <true/>
- </dict>
- </dict>
-</dict>
-</plist>
@property (strong, nonatomic) id detailItem;
-@property (strong, nonatomic) IBOutlet UILabel *detailDescriptionLabel;
+@property (weak, nonatomic) IBOutlet UITextView *detailText;
@end
-//
-// DetailViewController.m
-// Tombo
-//
-// Created by 平見 知久 on 12/03/25.
-// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
-//
-
#import "DetailViewController.h"
@interface DetailViewController ()
@implementation DetailViewController
@synthesize detailItem = _detailItem;
-@synthesize detailDescriptionLabel = _detailDescriptionLabel;
+@synthesize detailText = _detailText;
@synthesize masterPopoverController = _masterPopoverController;
#pragma mark - Managing the detail item
// Update the user interface for the detail item.
if (self.detailItem) {
- self.detailDescriptionLabel.text = [self.detailItem description];
+ self.detailText.text = [self.detailItem description];
}
}
- (void)viewDidUnload
{
+ [self setDetailText:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
- self.detailDescriptionLabel = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
-//
-// MasterViewController.m
-// Tombo
-//
-// Created by 平見 知久 on 12/03/25.
-// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
-//
-
#import "MasterViewController.h"
-
#import "DetailViewController.h"
+#import "Storage.h"
+
@interface MasterViewController () {
NSMutableArray *_objects;
+ Storage *storage;
}
@end
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)];
self.navigationItem.rightBarButtonItem = addButton;
self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController];
+
+ if (!storage) {
+ storage = [Storage init];
+ }
+ // Load initial items.
+ for (NSString *file in [storage listItems]) {
+ [self insertItem: file];
+ }
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
+ storage = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
}
+- (void)insertItem:(NSString *)item {
+ if (!_objects) {
+ _objects = [[NSMutableArray alloc] init];
+ }
+ [_objects insertObject:item atIndex:0];
+ NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
+ [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
+ withRowAnimation:UITableViewRowAnimationAutomatic];
+}
+
#pragma mark - Table View
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
}
*/
+// set item (for iPad)
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
}
}
+// set item (for iPhone)
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"showDetail"]) {
--- /dev/null
+/*
+ Data Storage
+ Abstraction of file and directory.
+ */
+#import <Foundation/Foundation.h>
+
+@interface Storage : NSObject
+
+@property NSString *currentDirectory;
+
++ (id)init;
+
+-(NSArray*)listItems;
+
+@end
--- /dev/null
+#import "Storage.h"
+
+@implementation Storage
+
+@synthesize currentDirectory;
+
++(id)init {
+ Storage *storage = [Storage alloc];
+ storage.currentDirectory = @"";
+ return storage;
+}
+
+-(NSArray*)listItems {
+ return [NSArray arrayWithObjects:@"abc", @"def", @"ghi", @"jkl", @"mno", @"pqr", nil];
+}
+
+@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="1.0" toolsVersion="1938" systemVersion="11C57" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="5">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="1.1" toolsVersion="2182" systemVersion="11D50b" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="5">
<dependencies>
+ <deployment defaultVersion="1296" identifier="iOS"/>
<development defaultVersion="4200" identifier="xcode"/>
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="933"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1179"/>
</dependencies>
<scenes>
+ <!--Navigation Controller-->
<scene sceneID="14">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="13" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="448" y="-630"/>
</scene>
+ <!--Detail View Controller - Detail-->
<scene sceneID="16">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="15" sceneMemberID="firstResponder"/>
<rect key="frame" x="0.0" y="64" width="703" height="704"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
- <label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="Detail view content goes here" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" id="27">
- <rect key="frame" x="20" y="341" width="663" height="21"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
- <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
- <fontDescription key="fontDescription" type="system" size="system"/>
- <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
- <nil key="highlightedColor"/>
- </label>
+ <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" id="I5K-hl-l4m">
+ <rect key="frame" x="0.0" y="0.0" width="703" height="704"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+ <fontDescription key="fontDescription" type="system" pointSize="14"/>
+ <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
+ </textView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
<toolbarItems/>
<navigationItem key="navigationItem" title="Detail" id="53"/>
<connections>
- <outlet property="detailDescriptionLabel" destination="27" id="29"/>
+ <outlet property="detailText" destination="I5K-hl-l4m" id="Mze-kK-DLs"/>
</connections>
</viewController>
</objects>
<point key="canvasLocation" x="448" y="248"/>
</scene>
+ <!--Split View Controller-->
<scene sceneID="18">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="17" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-687" y="-630"/>
</scene>
+ <!--Master View Controller - Master-->
<scene sceneID="24">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="23" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="859" y="-631"/>
</scene>
+ <!--Navigation Controller-->
<scene sceneID="50">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="49" userLabel="First Responder" sceneMemberID="firstResponder"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="1.0" toolsVersion="1938" systemVersion="11C57" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="3">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="1.1" toolsVersion="2182" systemVersion="11D50b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="3">
<dependencies>
+ <deployment defaultVersion="1296" identifier="iOS"/>
<development defaultVersion="4200" identifier="xcode"/>
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="933"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1179"/>
</dependencies>
<scenes>
+ <!--Navigation Controller-->
<scene sceneID="11">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="10" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1" y="64"/>
</scene>
+ <!--Master View Controller - Master-->
<scene sceneID="18">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="17" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="459" y="64"/>
</scene>
+ <!--Detail View Controller - Detail-->
<scene sceneID="24">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="23" sceneMemberID="firstResponder"/>
<rect key="frame" x="0.0" y="64" width="320" height="416"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
- <label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="Detail view content goes here" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" id="27">
- <rect key="frame" x="20" y="199" width="280" height="18"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
- <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
- <fontDescription key="fontDescription" type="system" size="system"/>
- <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
- <nil key="highlightedColor"/>
- </label>
+ <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="dcM-3R-DB6">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="416"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+ <fontDescription key="fontDescription" type="system" pointSize="14"/>
+ <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
+ </textView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<navigationItem key="navigationItem" title="Detail" id="26"/>
<connections>
- <outlet property="detailDescriptionLabel" destination="27" id="28"/>
+ <outlet property="detailText" destination="dcM-3R-DB6" id="xjt-Km-MjC"/>
</connections>
</viewController>
</objects>