xcode9

CoreData: annotation: Failed to load optimized model at path with Xcode 9 GM

和自甴很熟 提交于 2019-11-28 16:49:20
问题 Failed to load OMO warning (potential crash): Project with xcode 9 following warning is observed in the console during debug/release builds (iOS 11 GM/beta & iOS 10): CoreData: annotation: Failed to load optimized model at path "/Users/xyz.abc/Library/Developer/CoreSimulator/Devices/A-GUID/data/Containers/Bundle/Application/B-GUID/app-name.app/Frameworks/framework-name/mystorename.momd/mystorename 6.omo" Any custom framework (e.g. GoogleMaps, etc) that uses CD also results in this warning and

Where are iOS simulator screenshots stored?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 16:26:24
I have saved some screenshots in the iPhone Simulator running iOS 5, but I can't find them. I had this problem before, and it took me frickin' ages to find them in the file system. Is this so simple that I am just a dullard, or does no-one use this feature or what? I know I can get the screenshots off my real phone, but I don't want retina screenshots - I want normal screenshots. If you create screenshots from within the simulator using File -> Save Screen Shot (Command-S), those files end up on the Desktop as something like: iOS Simulator Screen shot Apr 22, 2012.png . Under Xcode 6 & newer,

How to collapse all methods in Xcode?

試著忘記壹切 提交于 2019-11-28 15:00:32
How to collapse all methods in a class in Xcode? Collapsing one by one is not an option anymore. As of Xcode 4 it seems to have changed. command - alt - shift - left arrow will do the trick... To fold/unfold current methods or if structures use: Fold: command - alt - left arrow Unfold: command - alt - right arrow Updates in Xcode 10 Xcode 10 has increased support for code folding, including: A new code folding ribbon showing all of the multi-line foldable blocks of code in the editor A new style for folded code in the editor that allows you to edit lines with folded code Support for folding

Shrink large title when scrolling (not UITableViewController) iOS 11

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 09:58:23
I got a View Controller embedded in a Navigation Controller with prefers large titles option set to true; inside the View Controller there’s a Scroll View. I want to make the nav bar shrink when scrolling. How could I archive this? XCode 9, Swift 4, iOS 11 I have not achieved that it works using a UIScrollView but I archived that it works with other ViewControllers using a UITableView as first view. If the tableView is not the first view, the large title fails to hide automatically. You most likely need to make sure your tableView is the first element in the main view’s subviews array. I hope

Custom Fonts Bug

五迷三道 提交于 2019-11-28 09:29:51
问题 TL;DR: Custom fonts couldn't be used programmatically before using them in a Storyboard/xib. Note: I've checked out this, tried the answers and they didn't work. I've also made sure that they're in target membership. I've noticed a strange bug while changing segment control title a custom font: segmentedControl.titleTextAttributes = NSDictionary(objects: [UIFont.init(name: "Comfortaa-Regular", size: UIFont.systemFontSize)!, UIColor.white], forKeys: [NSAttributedStringKey.font as NSCopying,

xcode 9 Could not load the image referenced from a nib in the bundle with identifier

…衆ロ難τιáo~ 提交于 2019-11-28 08:41:20
问题 I moved to Xcode 9.0 yesterday, but image resources don't work. I dragged image to root and select "Copy if needed" and "Create groups" and add to my project targets. The image is shown in storyboard but it is not shown in Simulator or even device. I get this warning "2017-09-24 11:49:46.578312+0330 testResource[3999:148745] Could not load the "past_exam_background.jpg" image referenced from a nib in the bundle with identifier "com.app.testResource".I tested png and the result was the same.

How to change home indicator background color on iPhone X?

为君一笑 提交于 2019-11-28 06:59:55
问题 I would like to change the background color of the view that appears on the bottom of the new iPhone X with a home indicator inside. Is it possible? 回答1: The home indicator color is determined automatically based on the color of the content below it. Most of the time, this means you should not worry about its color since it is out of your control, and will always be clearly visible to users. However, you can place a colored view in the area behind the home indicator to manipulate its color.

Xcode 9 asset catalog Preserves Vector Data not working?

耗尽温柔 提交于 2019-11-28 06:56:20
I thought the new Preserves Vector Data checkmark in the Xcode 9 asset catalog would finally give us resizing of vector PDF images, but apparently not. Here's my test image seen at two zooms in Preview: Nice and sharp with lots of zoom, so clearly this is a vector image. But here's what two image views look like in my app: So where's my vector data? Is this much-desired feature still missing in action? Does it still work only for the automatically generated 2x and 3x images? And if so, what does the Preserve Vector Data checkbox give us that we didn't have already? Edit: Still the same buggy

Swift 4 Cannot convert value of type '[String : AnyObject]?' to expected argument type '[NSAttributedStringKey : Any]?'

旧街凉风 提交于 2019-11-28 04:48:22
问题 I have just updated to Xcode 9 and converted my app from swift 3 to swift 4. I have graphs which use strings to label the axes and other variables. So I have a moneyAxisString = "Money". Previously I was able to draw them using this code: moneyAxisString.draw(in: CGRect(x: CGFloat(coordinateXOriginLT + axisLength/3), y: CGFloat(coordinateYOriginRT + axisLength + 5 * unitDim), width: CGFloat(300 * unitDim), height: CGFloat(100 * unitDim)), withAttributes: attributes as? [String : AnyObject])

Xcode 9 custom fonts not working

☆樱花仙子☆ 提交于 2019-11-28 02:58:35
问题 Custom fonts not working in Xcode 9. However if I open the same project in Xcode 8, the custom fonts work as expected I've ran this piece of code to ensure the fonts show up: NSArray *fontFamilies = [UIFont familyNames]; for (int i = 0; i < [fontFamilies count]; i++) { NSString *fontFamily = [fontFamilies objectAtIndex:i]; NSArray *fontNames = [UIFont fontNamesForFamilyName:[fontFamilies objectAtIndex:i]]; NSLog (@"%@: %@", fontFamily, fontNames); } I've ensured the fonts are in the plist,