Skip to content

Commit

Permalink
add some changes by TomCallon .
Browse files Browse the repository at this point in the history
  • Loading branch information
TomCallon committed Jul 13, 2012
1 parent 44b37e6 commit 8c57298
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 45 deletions.
40 changes: 38 additions & 2 deletions MBook.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
4A4B328C15AC5634004229AB /* MScorePlayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A4B328A15AC560D004229AB /* MScorePlayViewController.m */; };
4A55FF8815AD853F004F85C1 /* BookShelfViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4A2ED7D015ABD38E0077A181 /* BookShelfViewController.xib */; };
4A821D7F15AEC22900537BE8 /* TRACKS1+2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4A821D7E15AEC22700537BE8 /* TRACKS1+2.jpg */; };
4AA4540F15B057EA000A7E7D /* BookStroeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AA4540D15B057EA000A7E7D /* BookStroeViewController.m */; };
4AA4541015B057EA000A7E7D /* BookStroeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4AA4540E15B057EA000A7E7D /* BookStroeViewController.xib */; };
4AA4541515B05925000A7E7D /* SettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AA4541315B05925000A7E7D /* SettingViewController.m */; };
4AA4541615B05925000A7E7D /* SettingViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4AA4541415B05925000A7E7D /* SettingViewController.xib */; };
C64E7DE615ACA34300F6D8D0 /* MScorePlayViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C64E7DE515ACA34300F6D8D0 /* MScorePlayViewController.xib */; };
CAA8D29B15AB098A00EE67E4 /* Pagination.m in Sources */ = {isa = PBXBuildFile; fileRef = CAA8D29A15AB098A00EE67E4 /* Pagination.m */; };
CAA8D2AF15AB0A8400EE67E4 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CAA8D2AE15AB0A8400EE67E4 /* QuartzCore.framework */; };
Expand Down Expand Up @@ -195,6 +199,12 @@
4A4B328915AC560D004229AB /* MScorePlayViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MScorePlayViewController.h; sourceTree = "<group>"; };
4A4B328A15AC560D004229AB /* MScorePlayViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MScorePlayViewController.m; sourceTree = "<group>"; };
4A821D7E15AEC22700537BE8 /* TRACKS1+2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "TRACKS1+2.jpg"; sourceTree = "<group>"; };
4AA4540C15B057EA000A7E7D /* BookStroeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BookStroeViewController.h; sourceTree = "<group>"; };
4AA4540D15B057EA000A7E7D /* BookStroeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BookStroeViewController.m; sourceTree = "<group>"; };
4AA4540E15B057EA000A7E7D /* BookStroeViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BookStroeViewController.xib; sourceTree = "<group>"; };
4AA4541215B05925000A7E7D /* SettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingViewController.h; sourceTree = "<group>"; };
4AA4541315B05925000A7E7D /* SettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingViewController.m; sourceTree = "<group>"; };
4AA4541415B05925000A7E7D /* SettingViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SettingViewController.xib; sourceTree = "<group>"; };
C64E7DE515ACA34300F6D8D0 /* MScorePlayViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MScorePlayViewController.xib; sourceTree = "<group>"; };
CAA8D29915AB098A00EE67E4 /* Pagination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pagination.h; sourceTree = "<group>"; };
CAA8D29A15AB098A00EE67E4 /* Pagination.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Pagination.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -441,6 +451,26 @@
name = Useless;
sourceTree = "<group>";
};
4AA4540B15B057C9000A7E7D /* StoreViewController */ = {
isa = PBXGroup;
children = (
4AA4540C15B057EA000A7E7D /* BookStroeViewController.h */,
4AA4540D15B057EA000A7E7D /* BookStroeViewController.m */,
4AA4540E15B057EA000A7E7D /* BookStroeViewController.xib */,
);
name = StoreViewController;
sourceTree = "<group>";
};
4AA4541115B058E9000A7E7D /* SettingViewController */ = {
isa = PBXGroup;
children = (
4AA4541215B05925000A7E7D /* SettingViewController.h */,
4AA4541315B05925000A7E7D /* SettingViewController.m */,
4AA4541415B05925000A7E7D /* SettingViewController.xib */,
);
name = SettingViewController;
sourceTree = "<group>";
};
CAA8D2B015AB0CDD00EE67E4 /* Image */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -572,6 +602,8 @@
CAB26FB215A48EBC009E4435 /* Controller */ = {
isa = PBXGroup;
children = (
4AA4541115B058E9000A7E7D /* SettingViewController */,
4AA4540B15B057C9000A7E7D /* StoreViewController */,
4A55FF7C15AD5799004F85C1 /* BookController */,
4A2ED84515ABF7230077A181 /* MusicScoreBookController */,
4A2ED7AC15ABD38E0077A181 /* BookShelf */,
Expand Down Expand Up @@ -713,6 +745,8 @@
4A2ED87115ABFA020077A181 /* 关闭按钮.png in Resources */,
4A4B327B15AC2D57004229AB /* musicInform.plist in Resources */,
4A821D7F15AEC22900537BE8 /* TRACKS1+2.jpg in Resources */,
4AA4541015B057EA000A7E7D /* BookStroeViewController.xib in Resources */,
4AA4541615B05925000A7E7D /* SettingViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -749,6 +783,8 @@
4A2ED80E15ABD38E0077A181 /* NSMutableArray+Rearrange.m in Sources */,
4A2ED81115ABD38E0077A181 /* SelectedBookDetailViewController.m in Sources */,
4A2ED81315ABD38E0077A181 /* BookShelfViewController.m in Sources */,
4AA4540F15B057EA000A7E7D /* BookStroeViewController.m in Sources */,
4AA4541515B05925000A7E7D /* SettingViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -780,7 +816,7 @@
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
armv7,
arm6,
armv6,
);
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
Expand All @@ -807,7 +843,7 @@
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
armv7,
arm6,
armv6,
);
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
Expand Down
Binary file not shown.
4 changes: 3 additions & 1 deletion MBook/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
#import <UIKit/UIKit.h>


@interface AppDelegate : UIResponder <UIApplicationDelegate>
@interface AppDelegate : UIResponder <UIApplicationDelegate,UITabBarControllerDelegate>

@property (retain, nonatomic) UIWindow *window;

@property (retain, nonatomic) UINavigationController *navigationController;
@property (retain, nonatomic) UITabBarController *tabBarController;


@end
28 changes: 23 additions & 5 deletions MBook/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,48 @@
//

#import "AppDelegate.h"
#import "BookController.h"

//书架
#import "BookShelfViewController.h"

//书店
#import "BookStroeViewController.h"

//设置

#import "SettingViewController.h"


@implementation AppDelegate

@synthesize window = _window;
@synthesize navigationController = _navigationController;
@synthesize tabBarController =_tabBarController;

- (void)dealloc
{
[_window release];
[_navigationController release];
[_tabBarController release];
[super dealloc];
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
BookShelfViewController *bookController = [[[BookShelfViewController alloc] init] autorelease];
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:bookController] autorelease];
[self.navigationController setNavigationBarHidden:NO];
self.window.rootViewController = self.navigationController;

//书架
BookShelfViewController *bShelfVC = [[[BookShelfViewController alloc] init] autorelease];
//书城
BookStroeViewController *bStroreVC = [[[BookStroeViewController alloc]initWithNibName:@"BookStroeViewController" bundle:nil]autorelease];
//设置
SettingViewController *settingVC = [[SettingViewController alloc]initWithNibName:@"SettingViewController" bundle:nil];


self.tabBarController = [[UITabBarController alloc]init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:bShelfVC,bStroreVC,settingVC,nil];
self.navigationController = [[[UINavigationController alloc]initWithRootViewController:self.tabBarController] autorelease];
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;
}
Expand Down
1 change: 0 additions & 1 deletion MBook/Controller/BookController.m
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ - (void)viewDidLoad
NSString *contentPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"txt"];
NSString *txtContent = [NSString stringWithContentsOfFile:contentPath encoding:NSUTF8StringEncoding error:nil];
pagination = [[Pagination alloc] initWithContent:txtContent withFont:SHOW_FONT inRect:SHOW_BOUNDS];
// [self.navigationController setNavigationBarHidden:YES];
[super viewDidLoad];
[leavesView setPreferredTargetWidth:PERFORM_WIDTH];
[self initViews];
Expand Down
40 changes: 16 additions & 24 deletions MBook/Controller/BookShelf/BookShelfViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@
@implementation BookShelfViewController


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
self.title = NSLocalizedString(@"我的书架", @"我的书架");

}
return self;
}




- (void)didReceiveMemoryWarning
Expand All @@ -55,7 +67,7 @@ - (void)didReceiveMemoryWarning
}

- (void)initBooks {
NSInteger numberOfBooks = 100;
NSInteger numberOfBooks = 6;
_bookArray = [[NSMutableArray alloc] initWithCapacity:numberOfBooks];
_bookStatus = [[NSMutableArray alloc] initWithCapacity:numberOfBooks];
for (int i = 0; i < numberOfBooks; i++) {
Expand All @@ -75,13 +87,9 @@ - (void)initBarButtons {
_addBarButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addButtonClicked:)];


//
// [self setRightBarButton];
// [self setLeftBarButton];
self.navigationController.navigationBar.barStyle =UIBarStyleBlack;


// [buttomToolBar setAlpha:0.1];

}
- (void)setLeftBarButton
Expand All @@ -99,14 +107,9 @@ - (void)setLeftBarButton
[refleshButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[refleshButton addTarget:self action:@selector(trashButtonClicked :) forControlEvents:UIControlEventTouchUpInside];
[rightButtonView addSubview:refleshButton];
// [refleshButton release];
UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc] initWithCustomView:rightButtonView];
// [rightButtonView release];

// [self.navigationItem setleftBarButtonItem: rightBarButton];
[self.navigationItem setLeftBarButtonItem:rightBarButton];
[self.navigationController.navigationItem setLeftBarButtonItem:rightBarButton];
_editBarButton = rightBarButton;
// [rightBarButton release];



Expand All @@ -126,13 +129,9 @@ - (void)setRightBarButton
[refleshButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[refleshButton addTarget:self action:@selector(addButtonClicked :) forControlEvents:UIControlEventTouchUpInside];
[rightButtonView addSubview:refleshButton];
// [refleshButton release];
UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc] initWithCustomView:rightButtonView];
// [rightButtonView release];

[self.navigationItem setRightBarButtonItem: rightBarButton];
_bookStoreBarButton = rightBarButton;
// [rightBarButton release];



Expand Down Expand Up @@ -200,9 +199,6 @@ - (void)viewDidLoad
[_setttingButton setTitle:@"设置" forState:UIControlStateNormal];
[_setttingButton setBackgroundImage:[UIImage imageNamed:@"Settings.png"] forState:UIControlStateNormal];
[_setttingButton setBackgroundImage:[UIImage imageNamed:@"SettingsPressed.png"] forState:UIControlStateSelected];





}
Expand Down Expand Up @@ -278,9 +274,7 @@ - (UIView *)headerViewOfBookShelfView:(GSBookShelfView *)bookShelfView {
else {
[_searchBar setFrame:CGRectMake(0, 0, 320, 44)];
_searchBar.text = @"请输入要搜索书名";
// [_searchBar setImage:[UIImage imageNamed:@"search.png"] forSearchBarIcon:UISearchBarIconResultsList state:UIControlStateNormal];
[_searchBar setBackgroundImage:[UIImage imageNamed:@"search.png"]];
// [_setttingButton setFrame:CGRectMake(10, 0, 80, 45)];
}

return _searchBar;
Expand Down Expand Up @@ -390,11 +384,9 @@ - (void)bookViewClicked:(UIButton *)button {
else {
[bookView setSelected:NO];
NSLog(@"i was clicked at index ,%d",bookView.index);
BookController *bc = [[BookController alloc] init];
// [self.navigationController pushViewController:bc animated:YES];
BookController *bc = [[BookController alloc] init];
[self.navigationController pushViewController:bc animated:YES];
// UIViewController *selectedBookDetailViewController = [[UIViewController alloc]initWithNibName:@"SelectedBookDetailViewController" bundle:nil];
// [self.navigationController pushViewController:selectedBookDetailViewController animated:YES];

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
<object class="IBUIView" id="774585933">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{0, 64}, {320, 416}}</string>
<string key="NSFrame">{{0, 44}, {320, 436}}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC43NQA</bytes>
Expand All @@ -44,7 +43,6 @@
</object>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics">
<bool key="IBUIPrompted">NO</bool>
</object>
Expand Down Expand Up @@ -100,7 +98,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">15</int>
<int key="maxID">17</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
Expand Down
2 changes: 2 additions & 0 deletions MBook/Controller/BookStroeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
self.title = NSLocalizedString(@"书城", @"书城");

}
return self;
}
Expand Down
2 changes: 2 additions & 0 deletions MBook/Controller/SettingViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
self.title = NSLocalizedString(@"设置", @"设置");

}
return self;
}
Expand Down
21 changes: 13 additions & 8 deletions MBook/Controller/SettingViewController.xib
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1280</int>
<string key="IBDocument.SystemVersion">11C25</string>
<string key="IBDocument.InterfaceBuilderVersion">1919</string>
<string key="IBDocument.AppKitVersion">1138.11</string>
<string key="IBDocument.HIToolboxVersion">566.00</string>
<int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">11E53</string>
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.47</string>
<string key="IBDocument.HIToolboxVersion">569.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">916</string>
<string key="NS.object.0">1181</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
Expand Down Expand Up @@ -69,6 +69,7 @@
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
Expand All @@ -95,7 +96,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">3</int>
<int key="maxID">5</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand All @@ -111,8 +112,12 @@
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<real value="1296" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">916</string>
<string key="IBCocoaTouchPluginVersion">1181</string>
</data>
</archive>
1 change: 1 addition & 0 deletions MBook/View/Leaves/LeavesCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- (CGImageRef) cachedImageForPageIndex:(NSUInteger)pageIndex;
- (void) precacheImageForPageIndex:(NSUInteger)pageIndex;
- (void) minimizeToPageIndex:(NSUInteger)pageIndex;
- (void) setPageSize:(CGSize)value;
- (void) flush;

@end

0 comments on commit 8c57298

Please sign in to comment.