xcode5

NSLineBreakByWordWrapping not working ios7

杀马特。学长 韩版系。学妹 提交于 2019-12-11 04:16:37
问题 I have a UILabel which is populated from the database .. the text in the UILabel can be long and can be short .. the problem is that the text is being cut at the end .. for example its shown like this: "www.sample.com/h1/h2/h3..." where it should be: "www.sample.com/h1/h2/h3/h4/h5/h6.html" This is the code I am using: CGFloat constraintWidth = 180.0f; CGSize labelsize = [details.web sizeWithFont:self.webTextLabel.font constrainedToSize:CGSizeMake(constraintWidth, CGFLOAT_MAX) lineBreakMode

UIView animating one constraint affects another constraint

时间秒杀一切 提交于 2019-12-11 03:35:32
问题 I have an UIImageView that I want to animate slowly with a pan effect at the background. My background image view has four constraints: Distance from top to top layout guide (zero) Distance from bottom to bottom layout guide (zero) Width (constant at 850) Leading space to superview (zero, connected to code as backgroundImageViewLeftMargin outlet) The image view's view mode is set to "aspect fill". When I run my app, there is no problem, the static image is displayed. I add the following code

How to suppress a “SpriteKit Texture Atlas Generator Warning”?

不想你离开。 提交于 2019-12-11 03:15:52
问题 Xcode is reporting the following warning: "SpriteKit Texture Atlas Generator Warning Splitting 'images.atlas' into 2 texture atlases due to input texture dimensions." Although I will modified my images in the future to avoid SpriteKit from generating this warning, I would like to temporarily suppress this warning using some pragma directives. Does anyone know the warning flag to use to suppress this warning using code like the following? #pragma clang diagnostic push #pragma clang diagnostic

UIPageControl doesn't obey it's constraints inside UIScrollView

妖精的绣舞 提交于 2019-12-11 02:56:38
问题 I have a UIScrollView and there are many views inside my scroll view. I am using autolayout and all my views are layed out in the same manner: Left and top spacing to the superview, width and height set. Everything scrolls just fine, however my page control stays whereever it is. It does not scroll with the other elements inside the scroll view. YES, I did check that the page control is inside the scroll view just like the other elements, and yes, I've quadruple-checked the constraints of the

-[GMSMapView animateToCameraPosition:]: unrecognized selector sent to instance

你说的曾经没有我的故事 提交于 2019-12-11 02:43:51
问题 Hi All i have implement the google maps sdk on my application and i am getting an error on this particular line mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera]; Can any one help me to find a solution 回答1: Please mention which version of iOS you are using and did you setted delegate method for MAPview. Please check the below link, may be helps you, all the best GoogleMaps basic iOS demo app crash - unrecognized selector sent to instance 回答2: This error occurs if you remove the

Xcode 5 not displaying Top/Bottom Layout Guides for TableViewControllers

若如初见. 提交于 2019-12-11 02:38:03
问题 The Interface Builder in Xcode 5.1.1 displays Top Layout Guide and Bottom Layout Guides for View Controllers but apparently not for Table View Controllers . Is this indeed (always) the case and what is the reason why? 回答1: Because the layout guides are irrelevant in table view controllers. If you need to add other views to a table view controller, you shouldn't be using a table view controller, but a regular view controller with a UITableView and any other views you'd like. 来源: https:/

OK to call test cases from within other test cases in XCTest

為{幸葍}努か 提交于 2019-12-11 01:59:18
问题 I'm build a set of XCTestCase methods to exercise the code around my core data model. I am planning on calling some of the test methods from other test methods so I can see different combinations of data while keeping the code to a minimum. I can't imagine why this would not work, but I'm wondering what the world thinks and whether this is considered to be good practice. Here's what it would look like: @interface sessionTests : XCTestCase @property (strong) Model *model; @end - (void)setUp {

Button inside table cell not clickable

懵懂的女人 提交于 2019-12-11 01:06:59
问题 I have a custom cell which has two buttons that are connected to it's methods. I add the cell to the table like this: BSOrderedItemCell *cell = (BSOrderedItemCell *)[tableView dequeueReusableCellWithIdentifier:@"OrderItemCell"]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"OrderItemCell" owner:self options:nil]; cell = (BSOrderedItemCell *)[nib objectAtIndex:0]; } And after that I set it's properties. The cell size is the same as table's heightForRowAtIndexPath: and

How to programmatically disable/enable a UIBarButtonItem

南楼画角 提交于 2019-12-10 21:29:34
问题 I currently have a button called continueButton that has been assigned to a UIBarButtonItem button in a Storyboard file. I've declared the button as such: - (IBAction)continueButton; When the view loads, I want the button to disable itself, so that there can be no user input unless a command is called that re-enables user input for the button. How would I go about doing this? I'm trying to use the function [continueButton setEnabled:YES]; to disable/enable the button programmatically, but it

XCode unit testing: Error while reading test scope bundle

安稳与你 提交于 2019-12-10 18:43:20
问题 I'm receiving Error while reading test scope bundle ! while running a Unit Test in XCode 5. No test runs. Any idea how to solve this? 回答1: Solved the issue. Appears that I must run all tests after creating a new test. Not possible to run a fresh test individually from the gui until all tests have run. 回答2: I got it solved by setting "Build Active Architecture Only" in the test target to No 回答3: Delete the built app from the simulator. Its bundle can get out of whack and Xcode can't fix it for