我有1個原始標籤,標籤A,其中包含一個按鈕原因請看到第二的ViewController(B)。在VC B中,選擇了一個數字並更改標籤A中的標籤以表示該數字(所有這些都完美無缺)。如何使用標籤欄控制器傳輸視圖控制器之間的浮點值?
我有,使一個新的選項卡的方法,我需要知道如何從標籤A和VC B中的浮點值被確認爲標籤C(新標籤)相同的值。任何幫助表示讚賞!
編輯:這是我必須做出一個新的標籤
-(void)makeNewTab: (NSString *)linkToSnipe {
NSMutableArray* tabs = [[NSMutableArray alloc] init];
[tabs addObjectsFromArray:self.tabBarController.viewControllers];
NewLinkViewController* newVC = [self.storyboard instantiateViewControllerWithIdentifier:@"Link"];
[tabs addObject: newVC];
UITabBarItem* item = [[UITabBarItem alloc] init];
NSString* itemTitle = [NSString stringWithFormat:@"Link # %lu", (unsigned long)[itemsAlreadyAddedToCart count]];
[item setTitle: itemTitle];
[item setImage:[UIImage imageNamed:@"shoe.png"]];
[newVC setTabBarItem:item];
[self.tabBarController setViewControllers: [NSArray arrayWithArray:tabs]];
int indexOfNewTab = [tabs count]-1;
[newVC setLinkToSnipe:linkToSnipe];
[newVC setSizeIWant: sizeChosen];
self.tabBarController.selectedIndex = indexOfNewTab;
}方法
setLinkToSnipe:linktosnipe完美的作品,該字符串被稱爲新標籤同樣的事情。 setSizeIWant:sizeChosen不起作用。選擇大小是浮點值,我需要在標籤Ç
這些「選項卡」控制器在標籤視圖控制器?你在說什麼按鈕,從選項卡A到選項卡B?其中一個標籤欄按鈕(沒有賽格瑞嵌入到標籤欄控制器控制器之間去的時候,所以我不明白你在說什麼)? – rdelmar