↧
Comment by kubi on Swift outlet collection - 'IBOutlet' property cannot be an...
Can you post the definition of Badge? It looks like Badge is a struct, not a class.
View ArticleComment by kubi on "Does not conform to protocol" error when extending...
My protocol specifies one function, which returns a URLSessionDataTask. NSURLSession has the same function, except it returns a NSURLSessionDataTask, which adopts URLSessionDataTask, so I would expect...
View ArticleComment by kubi on How do you dismiss the keyboard when editing a UITextField
Helpful class. One small point, you shouldn't prefix your own classes with "UI". In objective-c you should use your own prefix ("TL"?), in Swift, don't use anything.
View ArticleComment by kubi on Accessing the host app code from the Xcode 7 UI Test target
Like @Konnor says in their answer, you can't access your app's process from within a UI test. What are you trying to do? I've had some success working around these limitations in our tests.
View ArticleComment by kubi on Accessing the host app code from the Xcode 7 UI Test target
If you figure something out, write a blog post! i'm sure a lot of people would be interested. I think the way forward might be to make an API call to a local server. Sounds a bit complicated, but I bet...
View ArticleComment by kubi on "Infinite Drill-down" with UINavigationController
I don't know what has replaced, but unloading view controllers hasn't been part of iOS for years now, so my answer is a bit outdated.
View ArticleComment by kubi on Is it possible to refresh a single UITableViewCell in a...
@happiehappie beginUpdates() and endUpdates() consolidate a bunch of changes into a single animation. If you're only doing one reload, there's no need to consolidate anything.
View ArticleComment by kubi on Printing optional variable
I think the example would be slightly better if you changed it to use if let age = age { return ""} else { return "" }
View ArticleComment by kubi on Crash at NSOperationQueue addOperation Custom NSOperation
Did you ever find out what was causing this crash? We're seeing the same crash in our app.
View ArticleComment by kubi on Crashed: com.apple.main-thread when setting value on...
Carloshwa did you get anywhere with this crash? I'm seeing a similar crash in my own code.
View ArticleComment by kubi on Custom pattern matching fails with `Enum case is not a...
Thanks @hamish! Do you want to add this comment as an answer and I'll accept it?
View ArticleComment by kubi on How do you dismiss the keyboard when editing a UITextField
@IulianOnofrei The default behavior of the return button is to add a line return and keep the keyboard onscreen. By returning NO you avoid adding a line return to the text.
View ArticleAnswer by kubi for How to enable automatic method suggestion in swift in Xcode?
If you're referring to autocomplete, Swift does have autocomplete, but it's buggy and sometimes breaks. If it's not working, try deleting the derived data for your project and letting it re-index. The...
View ArticleAnswer by kubi for How to push a local Git repository to another computer?
Here's a script that I wrote to do just this thing. The script handles all my usual initialization of new git reposcreates .gitignore fileinitializes .gitcreates the bare git repo on the serversets up...
View ArticleAnswer by kubi for Swift - How do you cast a CVImageBufferRef as a...
@LombaX's solution didn't work for me in the latest build, Xcode Beta5. Here's what did work:let imageBuffer : CVImageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer)let srcPtr =...
View ArticleWhat do the contents of the general purpose registers contain?
I included the iOS tag, but I'm running in the simulator on a Core i7 MacBook Pro (x86-64, right?), so I think that's immaterial.I'm currently debugging a crash in Flurry's video ads. I have a...
View ArticleWhat type is the function input to String.withCString()?
I'm using the function String.withCString() as follows:let s = "Hey!"let c = s.withCString { strlen($0)}println(c)However, if I add a second line to the withCString closure, I get an errorlet s =...
View ArticleCan I return typed objects from a Dictionary?
Here's what I have right now:enum TestKeys: String { case login = "login" case username = "username"}var testData: Dictionary<String,AnyObject> = // a dictionary of known key/values// I want the...
View ArticleAnswer by kubi for Dynamically load nib for iPhone/iPad within view controller
EDIT: @Adam's answer below is the correct answer.To determine which nib to load, do the following, and scrap your initWithMyLovelyData method and use a property to set the data. You should be able to...
View ArticleAnswer by kubi for Xcode: issue "file xxx.png is missing from working copy"...
In my case, Xcode had somehow found old .svn directories that referenced the missing files. I had to go up a level above my project folder to find those .svn files. Once deleted, I restarted Xcode and...
View Article
More Pages to Explore .....