I kept my original question as brief as I could, but let me tell you what
problem I’m trying to solve, and maybe someone will have good advice I haven’t
yet considered.
I’m trying to code in pure Swift. I have an NSAttributedString which can
potentially be very large, and I want to save off the
On 02 Apr 2015, at 13:54, Charles Jenkins mailto:cejw...@gmail.com>> wrote:
> What would be nice is a way to count leading and trailing characters in place
> while the thing is still an NSAttributedString--without using
> NSAttributedString.string to convert to a Swift string in the first place.
On Apr 2, 2015, at 6:54 AM, Charles Jenkins wrote:
> What would be nice is a way to count leading and trailing characters in place
> while the thing is still an NSAttributedString--without using
> NSAttributedString.string to convert to a Swift string in the first place.
NSAttributedString.str
The documentation certainly says that, Ken, but stick this code in a playground
and see that you can’t examine the characters via index no matter whether you
assume it to be String or NSString:
let whitespaceSet = NSCharacterSet.whitespaceAndNewlineCharacterSet()
let attrStr = NSAttributedString
Oops. My documentation viewer was set up wrong. characterAtIndex() is indeed
supposed to be available in Swift. Don’t know what I’ve done wrong that I can’t
use it in a playground.
--
Charles
On April 2, 2015 at 10:18:00, Charles Jenkins (cejw...@gmail.com) wrote:
The documentation certainly
> On Apr 2, 2015, at 4:54 AM, Charles Jenkins wrote:
>
> What would be nice is a way to count leading and trailing characters in place
> while the thing is still an NSAttributedString--without using
> NSAttributedString.string to convert to a Swift string in the first place. If
> there were n
Hi,
I’m getting a crash in dealloc in an NSWindow Subclass.
I have a class that creates and closes Windows based on Notifications received
from elsewhere. One of the Notifications is “CloseWindow”.
I added this to my subclass:
-(void) close
{
LogIfDave(@"Overlay close");
[super close];
On Apr 2, 2015, at 10:56 AM, Dave wrote:
> I’m getting a crash in dealloc in an NSWindow Subclass.
> If I run this, then I get a crash when the autorelease pool is drained.
> However, if I take out the line:
>
> [super close];
>
> in my close method, all works fine.
>
> Is this expected?
If
> On 2 Apr 2015, at 17:09, Ken Thomases wrote:
>
> On Apr 2, 2015, at 10:56 AM, Dave wrote:
>
>> I’m getting a crash in dealloc in an NSWindow Subclass.
>
>> If I run this, then I get a crash when the autorelease pool is drained.
>> However, if I take out the line:
>>
>> [super close];
>>
Hi,
Is there a method similar in use to UIView’s layoutSubviews method? e.g a
layoutWindow method.
When the window is resized, I want to replace the Content View with a new one,
is there a better way of doing this.
This is a special case Overlay window that doesn’t have a Window Controller.
A
On Apr 2, 2015, at 04:54 , Charles Jenkins wrote:
> Swift has a built-in func stringByTrimmingCharactersInSet(set:
> NSCharacterSet) -> String
There is something wacky going on here — or not. (I know you don’t want to use
this particular method, but I’m just using it as an example.)
First o
On Apr 2, 2015, at 11:53 AM, Dave wrote:
> On 2 Apr 2015, at 17:09, Ken Thomases wrote:
>>
>> On Apr 2, 2015, at 10:56 AM, Dave wrote:
>>
>>> I’m getting a crash in dealloc in an NSWindow Subclass.
>>
>>> If I run this, then I get a crash when the autorelease pool is drained.
>>> However, i
>
> No, then the window will be uncloseable. What needs to be different
> depending on that property is whether you call -release, not whether you pass
> the -close call up to super. If you're using ARC, you don't get to control
> whether you call release. Therefore, you need to set released
Amen, brother.
Given my attributed string “attrStr,” I can indeed call
attrStr.string.rangeOfCharacterFromSet(). But in typical Swift string fashion,
the return type is as unfriendly as possible: Range? — as if the
NSString were a Swift string.
So after doing two anchored searches, one at the
On Apr 2, 2015, at 19:28 , Charles Jenkins wrote:
>
> So after doing two anchored searches, one at the beginning and one at the end
> of the string, if I get two different ranges, I’m stuck with two values that
> aren’t subtractable to determine the length of the NSRange I need in a call
> to
On Apr 2, 2015, at 19:28 , Charles Jenkins wrote:
>
> I can indeed call attrStr.string.rangeOfCharacterFromSet(). But in typical
> Swift string fashion, the return type is as unfriendly as possible:
> Range? — as if the NSString were a Swift string.
I finally read the whole of what you said he
I only ask because I’m using a stackview that while it behaves as I configured
it in a plain view in a window, it behaves completely different when put in a
tableview. For example, views which I’ve set to detach will never, ever detach,
regardless of the settings I’ve set.
Anyone have experienc
17 matches
Mail list logo