three20 TTTableViewController + TTActionSheetController
生活随笔
收集整理的這篇文章主要介紹了
three20 TTTableViewController + TTActionSheetController
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.?首頁要實現TTActionSheetControllerDelegate
@interface TSPublishViewController : TTTableViewController<TTActionSheetControllerDelegate> {CATETYPE _cateType; } @property(nonatomic,assign)CATETYPE cateType;@end2.?在init中聲明URLMAP規則
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];if (self) {self.tableViewStyle = UITableViewStyleGrouped;[[TTNavigator navigator].URLMap from:@"tt://displayChoices"toViewController:self selector:@selector(displayChoices:)];}return self; }3.?在DataSource中tableViewDidLoadModel添加url
[items addObject:[TTTableTextItem itemWithText:post.catname URL:@"tt://displayChoices"]];4.?實現在方法
- (UIViewController*)displayChoices:(NSDictionary*)query{TTActionSheetController *controller = [[[TTActionSheetController alloc] initWithTitle:@"Choose" delegate:self] autorelease];[controller addDestructiveButtonWithTitle:@"Sigin In & Post" URL:@"tt://safechoice"];[controller addButtonWithTitle:@"Create & Post" URL:@"tt://photo-library"];[controller addCancelButtonWithTitle:@"Cancel" URL:nil];return controller; }- (BOOL)actionSheetController:(TTActionSheetController *)controller didDismissWithButtonIndex:(NSInteger)buttonIndex URL:(NSString *)URL {TTDPRINT(@"buttonIndex: %d URL: %@", buttonIndex, URL);if (URL && [URL caseInsensitiveCompare:@"tt://manual"] == NSOrderedSame) {return NO;}return (nil != URL); }轉載于:https://www.cnblogs.com/hubj/archive/2012/05/22/2513400.html
總結
以上是生活随笔為你收集整理的three20 TTTableViewController + TTActionSheetController的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 深度学习之tensorflow (一)
- 下一篇: Unity3d随机数生成