|
1 /* |
|
2 * Hedgewars-iOS, a Hedgewars port for iOS devices |
|
3 * Copyright (c) 2015-2016 Anton Malmygin <antonc27@mail.ru> |
|
4 * |
|
5 * This program is free software; you can redistribute it and/or modify |
|
6 * it under the terms of the GNU General Public License as published by |
|
7 * the Free Software Foundation; version 2 of the License |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU General Public License |
|
15 * along with this program; if not, write to the Free Software |
|
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
17 */ |
|
18 |
|
19 #import "CampaignViewController.h" |
|
20 |
|
21 @interface CampaignViewController () |
|
22 |
|
23 @end |
|
24 |
|
25 @implementation CampaignViewController |
|
26 |
|
27 - (void)viewDidLoad { |
|
28 [super viewDidLoad]; |
|
29 |
|
30 UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismiss)]; |
|
31 self.navigationItem.rightBarButtonItem = doneButton; |
|
32 [doneButton release]; |
|
33 |
|
34 NSString *campaignIniPath = [CAMPAIGNS_DIRECTORY() stringByAppendingFormat:@"%@/campaign.ini", self.campaignName]; |
|
35 NSLog(@"%@", campaignIniPath); |
|
36 } |
|
37 |
|
38 - (void)dismiss { |
|
39 [self.navigationController.presentingViewController dismissViewControllerAnimated:YES completion:nil]; |
|
40 } |
|
41 |
|
42 - (void)didReceiveMemoryWarning { |
|
43 [super didReceiveMemoryWarning]; |
|
44 // Dispose of any resources that can be recreated. |
|
45 } |
|
46 |
|
47 #pragma mark - Table view data source |
|
48 |
|
49 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { |
|
50 #warning Incomplete implementation, return the number of sections |
|
51 return 0; |
|
52 } |
|
53 |
|
54 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { |
|
55 #warning Incomplete implementation, return the number of rows |
|
56 return 0; |
|
57 } |
|
58 |
|
59 /* |
|
60 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
|
61 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath]; |
|
62 |
|
63 // Configure the cell... |
|
64 |
|
65 return cell; |
|
66 } |
|
67 */ |
|
68 |
|
69 /* |
|
70 // Override to support conditional editing of the table view. |
|
71 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { |
|
72 // Return NO if you do not want the specified item to be editable. |
|
73 return YES; |
|
74 } |
|
75 */ |
|
76 |
|
77 /* |
|
78 // Override to support editing the table view. |
|
79 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { |
|
80 if (editingStyle == UITableViewCellEditingStyleDelete) { |
|
81 // Delete the row from the data source |
|
82 [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; |
|
83 } else if (editingStyle == UITableViewCellEditingStyleInsert) { |
|
84 // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view |
|
85 } |
|
86 } |
|
87 */ |
|
88 |
|
89 /* |
|
90 // Override to support rearranging the table view. |
|
91 - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { |
|
92 } |
|
93 */ |
|
94 |
|
95 /* |
|
96 // Override to support conditional rearranging of the table view. |
|
97 - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { |
|
98 // Return NO if you do not want the item to be re-orderable. |
|
99 return YES; |
|
100 } |
|
101 */ |
|
102 |
|
103 /* |
|
104 #pragma mark - Table view delegate |
|
105 |
|
106 // In a xib-based application, navigation from a table can be handled in -tableView:didSelectRowAtIndexPath: |
|
107 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
|
108 // Navigation logic may go here, for example: |
|
109 // Create the next view controller. |
|
110 <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:<#@"Nib name"#> bundle:nil]; |
|
111 |
|
112 // Pass the selected object to the new view controller. |
|
113 |
|
114 // Push the view controller. |
|
115 [self.navigationController pushViewController:detailViewController animated:YES]; |
|
116 } |
|
117 */ |
|
118 |
|
119 /* |
|
120 #pragma mark - Navigation |
|
121 |
|
122 // In a storyboard-based application, you will often want to do a little preparation before navigation |
|
123 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { |
|
124 // Get the new view controller using [segue destinationViewController]. |
|
125 // Pass the selected object to the new view controller. |
|
126 } |
|
127 */ |
|
128 |
|
129 - (void)dealloc { |
|
130 [_campaignName release]; |
|
131 [super dealloc]; |
|
132 } |
|
133 |
|
134 @end |