xcode6

Interface Builder: How to clean up the deleted constraint?

混江龙づ霸主 提交于 2019-12-10 02:44:49
问题 I used command-delete to remove some constraints on the Map View widget in IB. Instead of being completely removed, the constraints are actually just faded as shown in the attached picture. I have tried both saving the file and reopening the project, but it seems like they will not be removed by XCode. How can I get them removed? EDIT This is what I see in the Size Inspector window I am using XCode 6 (6A313) 回答1: instead of using cmd and delete, select the view ,goto size inspector and delete

How to format a date like “5 min”, “1 hour,”, “Yesterday”, “1 Week ago”?

血红的双手。 提交于 2019-12-10 00:20:13
问题 I am trying to get something similar to facebook post date/time. Like 1 min, 1 hour, Yesterday, Week ago etc. This is the is function I am using to get this format: ( Oct-22 17:28 PM ) func convertTime(serverTime: Double) -> String { let serverTime = serverTime let date = Date(timeIntervalSince1970: serverTime) let dateFomatter = DateFormatter() dateFomatter.dateFormat = "MMM-dd HH:mm a" let strDate = dateFomatter.string(from: date) print("This is the post's date: \(strDate)") return strDate

Display records of next page in json in uitableview on scrolling the tableView when I reach the last record

柔情痞子 提交于 2019-12-10 00:08:19
问题 I am trying to make an application that uses SBJSON and ASIHTTPRequest containing 273 pages (50 records in each page)in json. When I scroll the tableView I want to get next 50 records when I reach the last record.Currently I am getting only the first 50 records. How will I get all the records? I am using Xcode 6 objective c. //Here I am taking the json data on view load - (void)viewDidLoad { [super viewDidLoad]; main_array = [[NSMutableArray alloc] init]; NSURL *countryURL = [NSURL

Autolayout constraint that uses UIScrollview contentSize

流过昼夜 提交于 2019-12-09 23:47:41
问题 I have a UIView inside a UIScrollView . I can easily pin the height to the UIScrollView 's frame height. How do I add a constraint that pins to the UIScrollView's contentSize instead? Thanks! 回答1: UIScrollView have dynamic constraints, left, top, width and height are generated at runtime. If you put a UIView inside a UIScrollview and Pin fixed constraints in Interface Builder it will generate an error because the parameters are relative to Superview/Container View. You can try some

How can Create Model class in swift and get values form model class in another class [closed]

假如想象 提交于 2019-12-09 23:32:08
问题 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 4 years ago . How can i create model class in Swift. I am getting errors wile accessing values form the model class. Thank you. Here I am attaching my demo project, U can download it 回答1: This way you can add and get values from model class: var user = User(firstName: "abcd", lastName: "efghi", bio: "biodata") print("\n First

Swift println() not showing autocomplete options while writing code

若如初见. 提交于 2019-12-09 19:06:42
问题 When I am trying to print using println() function it is not showing autocomplete parameter list in swift. Is there any problem in my Xcode? 回答1: Delete user/Library/Developer/Xcode/DeriveData and delete the data of folder(Derive data) and restart Xcode. Should work. If doesn't, restart mac after doing this. 回答2: Hi I found the reason for this.... As Dhruv mentioned, it only accepts string argument. So we need to convert object to string inline println() function. For example: we have integer

Unwind Segue in Xcode 6.1.1 with storyboard

夙愿已清 提交于 2019-12-09 15:18:12
问题 I have been reading that unwind segue's are bugged in Xcode 6. I am using Xcode 6.1.1 and I use swift. I use the "Back" button that is put by the navigation controller. Thus I can't cntrl drag to the exit icon. Moreover I can't drag from viewController icon to exit icon either. Is this a bug? Or else I am missing some fundamental knowledge about how to use unwind segue. How can I set unwind segues from the storyboard? 回答1: Got it working. If you are presenting from a NavigationController or

Design app that supports both iOS8 and iOS7

大兔子大兔子 提交于 2019-12-09 15:16:12
问题 Suppose I want to design a master detail application, Xcode6 master-detail project template for universal app includes UISplitViewController and splitViewController is new in iOS8. I want to support app for iOS7 also. In general What is the best way to design an universal app using Xcode6 storyboard that support both iOS8 and iOS7 ? Is it better to use separate story board for different OS version ? What are the best practices we should follow to make app compatible with both OS? 回答1: The

Xcode test target with host application forces wrong target into build section of scheme

六月ゝ 毕业季﹏ 提交于 2019-12-09 14:20:29
问题 When I add a test target that needs a host application in order to run Xcode adds targets that are not associated with the application I added. I have two schemes (internal & production). I want to run tests on our internal application. When I add the internal application as a host I end up with the production target being added to builds and cannot delete it. If I remove the host application this goes away but the tests also fail. Does anyone know where I'm going wrong? 回答1: We had the same

Xcode6: Is there any easy way to copy constrains between size classes?

为君一笑 提交于 2019-12-09 12:36:50
问题 I setup constrains in wAny hAny size class, and it worked on iPhone & iPad simulators. Then I switched to wAny hCompact size class and made some changes It looks good in iPhone landscape mode, but change nothing in iPad, because iPad is wRegular hRegular. I try to apply these constrains to wRegular hAny size class, but can't find a quick way to do that. It makes no sense to manually modify all the constrains again. I found that if I double click a constrain in Inspector panel, there's a