uistoryboard

UITableView cells not nil at initialization

强颜欢笑 提交于 2019-12-03 16:28:33
I am setting up my UITableView using storyboard editor. For creating my cells I am using the standard delegate method: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SearchResultCell"]; if (cell == nil) { // Do cell setup } // etc return cell; } Except when the cell is dequeued the very first time it's not nil, as it should be. So the code inside the if statement is never executed. People get this error when their reuse identifiers are inconsistent, so I went ahead

position a view in storyboard at 1/3 of screen size

∥☆過路亽.° 提交于 2019-12-03 16:07:31
问题 I'm trying to position a view in storyboard to always have it top edge at 1/3 of screen size. I have currently set a constraint to Top Layout Guide, but the constraint's constant is...well it is constant no matter which screen size it is used in, but I want it to be 1/3 of screen size. Can this be done entirely in storyboard? Thanks for answers Screenshot of current state: 回答1: Create a constraint between the view's top edge and the superview's bottom edge. Set the constraint's constant to

Passing ManagedObjectContext to view controllers using storyboards with a root UITabBarController

无人久伴 提交于 2019-12-03 14:47:45
Using storyboards you have no easy access to the first view controller in appDelegate (though once you do prepareForSegue makes it easy to pass the ManagedObjectContext down the navigation stack. I've settled on giving each view controller (or superclass of each view controller) requiring Core Data access a moc member: @synthesize moc = _moc; @property (nonatomic) __weak NSManagedObjectContext *moc; I'm uneasy about it because it doesn't seem a very elegant way to do it - too much code. But assigning directly requires specifying absolute indexes into the viewControllers arrays and changing

UiSegmentedControl on NavigationBar below Title

社会主义新天地 提交于 2019-12-03 13:56:50
I am new on iOS Development and during my works for an app I am building right now some doubts have appeared to me. I am trying to build a Screen that will be compounded by multiple ViewControllers, but on the NavigationBar I would like to have a UiSegmentedControl above the Title, something like a Scope Bar to control the navigation between the children ViewController. I wanted to build something similar to what we have on HealthKit Dashboard: . What kind of approach do you suggest to do that? I understand that some questions have already been done about it, but after a long research I have

iOS Storyboards Should I use them or not? [duplicate]

走远了吗. 提交于 2019-12-03 13:33:47
问题 This question already has answers here : When to use Storyboard and when to use XIBs (9 answers) Closed 6 years ago . I am new to iOS development (No apps created yet), but I ask for advice from my friend that has really high rated apps on the market. He said not to use storyboards. As much as I want to take his advice, they seem really helpful. Is this something that can cause problems for my app in the future? Is there any reason I may want to not use storyboards? Coming from an Android

UITableView “selection” triggered segue

三世轮回 提交于 2019-12-03 12:31:28
I am using Storyboard and UITableView without UINavigationController . When tapping on any cell, it should bring user to a detail page. I can of course implement didSelectRowAtIndexPath: But I wished to try something fairly different. I want to do it with a storyboard segue . I use prototype cell, and I can simply config a triggered segue on the cell. I can implement prepareForSegue: , but here's the problem, how can I know what cell has been selected? The prepareForSegue:sender: method's sender parameter is the cell you are looking for. You can get it's index path by [self.tableView

iOS-like storyboard tool for Android project? [closed]

佐手、 提交于 2019-12-03 11:52:53
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Do we, Android developers, have any tool like iOS developers have which can help us make story board of all activities and links between them? Those who have seen iOS story board tool will know what I am talking about. It would be really cool as we would be able to visualise the UI logic. PS. check my storyboard

Close button on adaptive popover

*爱你&永不变心* 提交于 2019-12-03 11:36:16
问题 In a storyboard I have a root view controller with a button which triggers a 'Present as Popover' segue to a UINavigationController containing a UITableViewController. I want the nav controller to be present on both iPhone and iPad. On an iPad, this works great in a popover. On an iPhone, I get the modal presentation, so now I need an additional bar button item to dismiss the modal view. From watching the WWDC videos, I've attempted the following in the root view controller: - (void

Why does git add&remove the Storyboard <classes> section repeatedly?

ε祈祈猫儿з 提交于 2019-12-03 11:09:10
问题 When saving the storyboard and committing the changes to git, the chances are good that the whole <classes> section will be removed from or added to source control (git). I am using git on the command line, not the XCode integrated UI. First it looks like this: + <classes> + <class className="CPTGraphHostingView" superclassName="UIView"> + <source key="sourceIdentifier" type="project" relativePath="./Classes/CPTGraphHostingView.h"/> + </class> ... + </classes> And in the next commit it looks

How to select background views in a storyboard or xib

一世执手 提交于 2019-12-03 10:05:11
If I select a view with my mouse in a storyboard or xib, Xcode will select the front most view. I know that I can select the other views in the document outline, but if I want to grab a background view to move it with my mouse, the front most view gets selected again when I click in the storyboard. I think there is a way to cycle through the views and select the ones in the back by holding down on some keys, but I can't find what it is. Does anyone know? I'm using Xcode 4.6. I know that I can also move background views using the size inspector, but I'm looking for a way to position them with