|
Re: Dealing with unicodes in strings
Don’t really see how NSString would be able to deal with that, it has no way of knowing there are embedded escape sequences in what is otherwise UTF-8. This looks like a fairly standard web encoding
Don’t really see how NSString would be able to deal with that, it has no way of knowing there are embedded escape sequences in what is otherwise UTF-8. This looks like a fairly standard web encoding
|
By
Roland King
·
#967
·
|
|
Re: Dealing with unicodes in strings
Yes, I think it’s putting these 6 characters into the string.
The original data is an HTML page, and these strings come from some embedded javascript on the page - I’m scraping the page to extract
Yes, I think it’s putting these 6 characters into the string.
The original data is an HTML page, and these strings come from some embedded javascript on the page - I’m scraping the page to extract
|
By
Graham Cox
·
#966
·
|
|
Re: Dealing with unicodes in strings
That’s what I was thinking too.
This would easily be resolved if we could see the bytes of the NSData in hex.
That’s what I was thinking too.
This would easily be resolved if we could see the bytes of the NSData in hex.
|
By
Quincey Morris
·
#965
·
|
|
Re: Dealing with unicodes in strings
Is it possible that the code "\u002D" is in the string as the six characters? It is just the minus sign, but could the source have encoded certain characters so they wouldn't be accidentally
Is it possible that the code "\u002D" is in the string as the six characters? It is just the minus sign, but could the source have encoded certain characters so they wouldn't be accidentally
|
By
Glenn L. Austin
·
#964
·
|
|
Dealing with unicodes in strings
I’m converting some NSData to a NSString using UTF8 encoding, which is what I believe it should be.
But the strings are sometimes ending up with embedded codes that are not converting, like
I’m converting some NSData to a NSString using UTF8 encoding, which is what I believe it should be.
But the strings are sometimes ending up with embedded codes that are not converting, like
|
By
Graham Cox
·
#963
·
|
|
Encoding / decoding an Array of structs
Hi All
I’m trying to encode / decode an Array of struct.
The struct in question is itself Codable - and the compiler is happy with it.
In the following code, roles is an Array of struct called
Hi All
I’m trying to encode / decode an Array of struct.
The struct in question is itself Codable - and the compiler is happy with it.
In the following code, roles is an Array of struct called
|
By
Peter Hudson
·
#962
·
|
|
Re: How to Display a Time Interval
As has been discussed before, you most likely won’t have to roll your own with the modern, non-deprecated frameworks. If you do need something that seems basic but you can’t find it, please write
As has been discussed before, you most likely won’t have to roll your own with the modern, non-deprecated frameworks. If you do need something that seems basic but you can’t find it, please write
|
By
Gary L. Wade
·
#961
·
|
|
Re: How to Display a Time Interval
You want NSDateComponentsFormatter:
/* NSDateComponentsFormatter provides locale-correct and flexible string formatting of quantities of time, such as "1 day" or "1h 10m", as specified by
You want NSDateComponentsFormatter:
/* NSDateComponentsFormatter provides locale-correct and flexible string formatting of quantities of time, such as "1 day" or "1h 10m", as specified by
|
By
Jens Alfke
·
#960
·
|
|
Re: How to Display a Time Interval
Hi Dave
I seem to remember using NSCalendatDate and the descriptionWithCalendarFormat: method to get what you want.
NSCalendarDate is now deprecated - the docs advocate the use of NSDate,
Hi Dave
I seem to remember using NSCalendatDate and the descriptionWithCalendarFormat: method to get what you want.
NSCalendarDate is now deprecated - the docs advocate the use of NSDate,
|
By
Peter Hudson
·
#959
·
|
|
Re: Why would an instance of NSMutableArray be immutable?
Nope. This is due to the way CF bridging works — the magic class __NSCFArray (?) is bridged to CFArray and CFMutableArray. To support mutable arrays, that means __NSCFArray has to subclass
Nope. This is due to the way CF bridging works — the magic class __NSCFArray (?) is bridged to CFArray and CFMutableArray. To support mutable arrays, that means __NSCFArray has to subclass
|
By
Jens Alfke
·
#958
·
|
|
Why would an instance of NSMutableArray be immutable?
I was trying to add an object to an array and got an exception saying that I was trying to modify an immutable object. I set a breakpoint just before the addObject: line, and said to lldb
po
I was trying to add an object to an array and got an exception saying that I was trying to modify an immutable object. I set a breakpoint just before the addObject: line, and said to lldb
po
|
By
James Walker
·
#957
·
|
|
Re: Some gestures aren't working right away
No ideas about this?
I have an iOS app that's giving me a pain. One view hierarchy has a scroll view, page view, and other views. The storyboard has 3 gesture recognizers scattered among a couple of
No ideas about this?
I have an iOS app that's giving me a pain. One view hierarchy has a scroll view, page view, and other views. The storyboard has 3 gesture recognizers scattered among a couple of
|
By
Steve Mills
·
#956
·
|
|
Some gestures aren't working right away
I have an iOS app that's giving me a pain. One view hierarchy has a scroll view, page view, and other views. The storyboard has 3 gesture recognizers scattered among a couple of the view controllers.
I have an iOS app that's giving me a pain. One view hierarchy has a scroll view, page view, and other views. The storyboard has 3 gesture recognizers scattered among a couple of the view controllers.
|
By
Steve Mills
·
#955
·
|
|
Dragging a file unto an app in iOS simulator
Hi:
Previously, you could drag and drop from the Mac desktop over an app in iOS Simulator, and if the app was set up for that file extension, it would open the app and open the file through the
Hi:
Previously, you could drag and drop from the Mac desktop over an app in iOS Simulator, and if the app was set up for that file extension, it would open the app and open the file through the
|
By
Owen Hartnett
·
#954
·
|
|
Re: flagsChanged: not being called on NSControl subclass
Aha! No, it was not. It does now and I’m getting flagsChanged. I guess that makes sense that the OS only sends those to the firstResponder. Thanks for your hunch.
Extending your suggestion, I added
Aha! No, it was not. It does now and I’m getting flagsChanged. I guess that makes sense that the OS only sends those to the firstResponder. Thanks for your hunch.
Extending your suggestion, I added
|
By
Steve Mills
·
#953
·
|
|
Re: flagsChanged: not being called on NSControl subclass
Does your control actually become first responder? That might be necessary for flagsChanged: to go to your control.
A less than perfect option would be to poll the modifier flags on mouse
Does your control actually become first responder? That might be necessary for flagsChanged: to go to your control.
A less than perfect option would be to poll the modifier flags on mouse
|
By
James Walker
·
#952
·
|
|
Re: How to Display a Time Interval
They wanted the number of weeks - I didn’t ask questions, plus the Total Number of Weeks and Total Number of days.
Cheers
Dave
They wanted the number of weeks - I didn’t ask questions, plus the Total Number of Weeks and Total Number of days.
Cheers
Dave
|
By
Dave
·
#951
·
|
|
Re: How to Display a Time Interval
*snip*
I'm not sure why you needed to reinvent the wheel when NSCalendar and NSDateComponents already does this via:
-(NSDateComponents*) components:(NSCalendarUnit)unitFlags
*snip*
I'm not sure why you needed to reinvent the wheel when NSCalendar and NSDateComponents already does this via:
-(NSDateComponents*) components:(NSCalendarUnit)unitFlags
|
By
Steve Mills
·
#950
·
|
|
Re: How to Display a Time Interval
Hi,
As far as I know I don’t have to worry about leap years, get the Interval between now and some future date, this includes all the leap years in between. I am displaying it at the moment by
Hi,
As far as I know I don’t have to worry about leap years, get the Interval between now and some future date, this includes all the leap years in between. I am displaying it at the moment by
|
By
Dave
·
#949
·
|
|
Re: How to Display a Time Interval
If he has a time interval, why not just use NSDateComponentsFormatter's -stringFromTimeInterval:?
Either way, be aware that NSDateComponentsFormatter doesn't cope with an interval of 2^32 or above.
If he has a time interval, why not just use NSDateComponentsFormatter's -stringFromTimeInterval:?
Either way, be aware that NSDateComponentsFormatter doesn't cope with an interval of 2^32 or above.
|
By
Shane Stanley
·
#948
·
|