> On Jul 6, 2015, at 23:22 , Kyle Sluder wrote:
>
> On Mon, Jul 6, 2015, at 07:57 PM, Rick Mann wrote:
>>
>>> On Jul 6, 2015, at 17:54 , Charles Srstka wrote:
>>>
>>> I’ve occasionally had issues getting Xcode to connect outlets and actions.
>>> My workaround for it is to open the Assistant
I want to implement some support for HTTP Headers in enums, such that I can
write this:
extension
NSMutableURLRequest
{
func
set(inHeader : String, _ inVal : String)
{
self.setValue(inVal.rawValue, forHTTPHeaderField:
inHeader.rawValue())
}
}
and
What? The docs say that substringToIndex is declared like this:
func substringToIndex(_ to: Int) -> String
So, why can't I call that here:
extension
NSURL
{
func
normalizedURLByAppendingPathComponent(var inComponent : String)
-> NSURL
{
var s = self.absoluteString;
On Jul 7, 2015, at 00:02 , Rick Mann wrote:
>
> I want to implement some support for HTTP Headers in enums, such that I can
> write this:
>
> extension
> NSMutableURLRequest
> {
> func
> set(inHeader : String, _ inVal : String)
> {
> self.setValue(inVal.rawValue,
The docs for NSString say that substringToIndex is declared like that. If you
looked at the autocomplete when you typed it in you’d see it wants an Index,
that’s a method on String. And no it’s not in the documentation but it is in
the API diffs and autocomplete gets it right (for me at least) a
You should file a documentation bug. The signature is actually:
func substringFromIndex(index: String.Index) -> String
So what you really want I believe is:
s = s.substringToIndex(advance(s.endIndex, -1))
On Tue, Jul 7, 2015 at 2:02 AM, Rick Mann wrote:
> What? The docs say that substringToI
On Jul 7, 2015, at 00:22 , Roland King wrote:
>
> If you want to use an NSString method with the same name as a String one,
> cast to an NSString, ( s as NSString )
The other thing to be really, really careful of when bridging is that all
indexes and ranges derived from NSString API are counti
The bug is really that they haven’t documented the new String method so you
only get the old (and still-existing) NSString method.
I did find it in some documentation which pointed to online documentation (you
can tell by the lag) so I went to prefs, updated my docsets, and now I don’t
have it
On Jul 7, 2015, at 2:47 AM, Rick Mann wrote:
>
>
>> On Jul 7, 2015, at 00:46 , Charles Srstka wrote:
>>
>> You don’t have an NSString. You have a String. It works differently.
>
> Well, they're toll-free bridged, and substringToIndex() is a method on
> NSString (or so I thought). Anyway, it
I thought I saw some Swift code that did this:
let someString : String?
if some things
{
// some stuff
someString =
// some other stuff
}
// use someString
But I can't get Swift 2 to let
On Jul 7, 2015, at 01:08 , Rick Mann wrote:
>
> But I can't get Swift 2 to let me.
You’ve left a path through the code that doesn’t set ‘someString’. So, you’ll
need to add:
> else
> {
> someString = nil
> }
to the ‘if’.
___
Cocoa-dev mailin
> On Jul 7, 2015, at 01:16 , Quincey Morris
> wrote:
>
> On Jul 7, 2015, at 01:08 , Rick Mann wrote:
>>
>> But I can't get Swift 2 to let me.
>
> You’ve left a path through the code that doesn’t set ‘someString’. So, you’ll
> need to add:
>
>> else
>> {
>> someString = nil
>> }
>
> t
On Jul 7, 2015, at 01:21 , Rick Mann wrote:
>
> let thumbURL: String?
> for imgD in images
> {
> if let isHero = imgD["is_hero"] as? Bool where isHero,
> let t = imgD["thumbnail_signed_src"] as? String
> {
>
Yeah, there doesn't seem to be an elegant way to do it, so I gave up and used a
var.
> On Jul 7, 2015, at 01:31 , Quincey Morris
> wrote:
>
> On Jul 7, 2015, at 01:21 , Rick Mann wrote:
>>
>> let thumbURL: String?
>> for imgD in images
>> {
>> if let isHero = imgD
On Jul 7, 2015, at 01:33 , Rick Mann wrote:
>
> Yeah, there doesn't seem to be an elegant way to do it
Actually, there is:
> let thumbURL: String? =
> {
> for imgD in images
> {
> if let isHero = imgD["is_hero"] as? Bool where isHero,
> let t = im
> On Jul 7, 2015, at 01:37 , Quincey Morris
> wrote:
>
> On Jul 7, 2015, at 01:33 , Rick Mann wrote:
>>
>> Yeah, there doesn't seem to be an elegant way to do it
>
> Actually, there is:
>
>> let thumbURL: String? =
>> {
>> for imgD in images
>> {
>> if let isHero = im
On Jul 7, 2015, at 01:39 , Rick Mann wrote:
>
> The problem arises when you want to initialize more than one variable in that
> block of work.
If you ask the wrong question, you get a wrong answer. :)
You can use a tuple:
> let (thumbURL, isHero) =
> {
> () -> (String?, Bool) in
>
> On Jul 7, 2015, at 01:49 , Quincey Morris
> wrote:
>
> On Jul 7, 2015, at 01:39 , Rick Mann wrote:
>>
>> The problem arises when you want to initialize more than one variable in
>> that block of work.
>
> If you ask the wrong question, you get a wrong answer. :)
Whether or not it was the
Ah, I see what you’re getting at. This is interesting.
Previously when I’ve wanted to implement things like this I’ve used
Transformable attributes, which provide an automatic packing/unpacking feature
using a packing/unpacking class that I specify in the data model. It is
necessary to be caref
Given a character (a Unicode code point, to be exact) like U+FF0B (FULLWIDTH
PLUS SIGN), I want to know the General Category of this.
For this example it would be “Sm" (aka. Math_Symbol or Symbol, Math).
I could download the current version of UnicodeData.txt and parse it.
But this looks not very
ICU’s
u_charType
and after that you can use
// http://www.fileformat.info/info/unicode/category/index.htm
std::tuple u_charTypeName(UCharCategory c) {
switch (c) {
/*case U_UNASSIGNED:*/
case U_GENERAL_OTHER_TYPES:
return std::make_tuple("Cn","Other, Not Assigned
>> If you ask the wrong question, you get a wrong answer. :)
>
> Whether or not it was the wrong question is debatable.
Honestly I find that assertion suspect considering that you've moved the
goalposts three times.
___
Cocoa-dev mailing list (Cocoa-d
> On 7 Jul 2015, at 19:33, Dmitry Markman wrote:
>
> ICU’s
>
> u_charType
Looks exactly like what I need.
But: are the headers and the library on my Mac?
There is /usr/lib/libicucore.A.dylib which might contain u_charType, but I
cannot find any headers (e.g. utypes.h).
Do I have to download
> On Jul 6, 2015, at 5:49 PM, Joel Norvell wrote:
>
> Hi Richard,
>
> When the instance of your NSTextField subclass becomes first responder, you
> have access to the NSText object (the field editor) and I believe you can use
> its methods to select the text. (I don't see why you can't, but s
> Op 6 jul. 2015, om 18:15 heeft Richard Charles het
> volgende geschreven:
>
> Does anyone have any insight into what is going on?
>
The animation of the focus ring isn't finished. If the focus ring is switched
off, the text is selected.
Safari's Address and Search field calls setSelectedRan
Hi,
I’m trying to figure out how to correctly calculate the required width of an
NSScrollView such that it will exactly fit the NSTableView inside, with no
horizontal scroller and no “filler column” to the right of the last column in
the table.
The number of columns in the table changes based
> On Jul 7, 2015, at 8:27 AM, Willeke wrote:
>
>> Op 6 jul. 2015, om 18:15 heeft Richard Charles het
>> volgende geschreven:
>>
>> Does anyone have any insight into what is going on?
>>
> The animation of the focus ring isn't finished. If the focus ring is switched
> off, the text is select
Is there any way to combine the for and if-let into one line that gives me
unwrapped NSURL objects to work on? I believe the enumerator (which came from
NSFileManager) will only have valid NSURLs in it.
for item in enumerator!
{
if let url = item as? NSURL
{
l
On Jul 7, 2015, at 16:42 , Rick Mann wrote:
>
> for item in enumerator!
Like this:
> for case let item? in enumerator!
(Yes, it’s stupid.)
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator co
> On Jul 7, 2015, at 16:52 , Quincey Morris
> wrote:
>
> On Jul 7, 2015, at 16:42 , Rick Mann wrote:
>>
>> for item in enumerator!
>
> Like this:
>
>> for case let item? in enumerator!
>
> (Yes, it’s stupid.)
Hmm. It doesn't seem to like that: '?' pattern cannot match values of type
'Ele
On Jul 7, 2015, at 16:58 , Rick Mann wrote:
>
> Also, the enumerator is a NSDirectoryEnumerator. It returns AnyObject type,
> so wouldn't there have to be an NSURL cast in there somewhere?
Try:
> for case let url as NSURL in enumerator
The way to figure these things out is to start with a sw
> On Jul 7, 2015, at 4:58 PM, Rick Mann wrote:
>
>> On Jul 7, 2015, at 16:52 , Quincey Morris
>> wrote:
>>
>>> On Jul 7, 2015, at 16:42 , Rick Mann wrote:
>>>
>>> for item in enumerator!
>>
>> Like this:
>>
>>> for case let item? in enumerator!
>>
>> (Yes, it’s stupid.)
>
> Hmm. It does
On Jul 7, 2015, at 17:28 , Greg Parker wrote:
>
> for case let item as NSURL in
Yes, but you can’t honestly tell me you’re proud of that syntax, can you? ;)
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests o
Thanks. I was looking at the Swift reference. The docs seem to be incorrect:
https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/pattern
"There are two type-casting patterns, the is pattern and the as
> On 8 Jul 2015, at 08:26, Quincey Morris
> wrote:
>
> On Jul 7, 2015, at 16:58 , Rick Mann wrote:
>>
>> Also, the enumerator is a NSDirectoryEnumerator. It returns AnyObject type,
>> so wouldn't there have to be an NSURL cast in there somewhere?
>
>
> Try:
>
>> for case let url as NSURL
> On Jul 7, 2015, at 17:30 , Roland King wrote:
>
> 1) If you’re sure it’s not nil, which for that particular case of an
> enumerator from a filemanager I’d agree it’s not (can’t make one work in a
> playground to test) then just force-unwrap it
> 2) As concise as ‘for case let url as NSURL in
Hi Gerriet
first of all it’s unicode/uchar.h header (not utypes.h)
I think it would be the best to download ICU distribution from
http://site.icu-project.org/download/55#TOC-ICU4C-Download
download sources and build it
in order to build you have to do the following
download and unarchive ic
> On Jul 7, 2015, at 5:30 PM, Rick Mann wrote:
>
> Thanks. I was looking at the Swift reference. The docs seem to be incorrect:
>
> https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html#//apple_ref/swift/grammar/pattern
>
> "
> On Jul 7, 2015, at 17:51 , Greg Parker wrote:
>
> The power of `case` outside `switch` was increased at some point. It's likely
> that the documentation has not caught up. You should file a bug report.
I did. Thanks for the confirmation, though!
--
Rick Mann
rm...@latencyzero.com
__
On 25 Oct 2014, at 10:23 am, Martin Wierschin wrote:
>> I have a subclass of a text view in my app. When I double-click on other
>> than a word (ie, a space or return), I get entries like these in the Console:
>>
>> _NSExtensionIsSafeExpressionForObjectWithSubquerySubstitutions: Expression
>>
40 matches
Mail list logo