Master-Detail app for iPhone
Master has a TableView with words and a SearchField.
DetailView has info about selected word.
Hitting the Back-Button in the DetailView shows the MasterView and then (after
what feels like a second) the Keyboard slides up.
This is not what I want.
Before iOS 9.0 the
I want to get some metadata for a remote file.
I tried:
NSString *path = @"/Public/UNIDATA/Blocks.txt";
NSURL *icuBlocksUrl = [ [ NSURL alloc ] initWithScheme: @"http" host:
@"unicode.org" path: path ];
NSArray *keys = @[ NSURLContentModificationDateKey, NSURLCreationDateKey,
NSURLFileSizeKey
> On 28 Sep 2015, at 00:31, Mike Abdullah wrote:
>
>
>> On 27 Sep 2015, at 18:08, Gerriet M. Denkmann wrote:
>>
>> I want to get some metadata for a remote file.
>>
>> Just seen in small print: “This method applies only to URLs that represent
>&
OS X 10.10.5
Trying to download a file with:
session = [ NSURLSessionsessionWithConfiguration:
defaultSessionConfiguration
delegate:
self
delegateQu
OS X 10.10.5
Trying to download a file with:
session = [ NSURLSessionsessionWithConfiguration:
defaultSessionConfiguration
delegate:
self
delegateQu
When I download a file using NSURLSession downloadTaskWithRequest the file ends
up in exactly the wrong volume.
Which means: I have to copy it to the right one, which, for really big files,
can take some non-trivial time.
Is it possible to advise NSURLSession which volume to use?
Gerriet.
___
Just tried 3 times to install 10.11. Always the same result:
First there is lots of talk like:
… Language Chooser[441:6816] TSplicedFont failed creating descriptor for:
[…]
".LastResort” is used instead.
Then, at about line 18 000:
Oct 1 00:10:55 MacBook-Pro OSInstaller[458]: Path enumeration
I inherited some code with:
@interface BaseThing : NSObject
@property (nonatomic) SomeDataClass *stuff;
@end
@interface SubThing : BaseThing
@property (nonatomic) SubDataClass* stuff; // SubDataClass is a
subclass of SomeDataClass
@end
@implementation SubThing
// nothing about
> On 2 Oct 2015, at 12:40, Quincey Morris
> wrote:
>
> On Oct 1, 2015, at 22:18 , Graham Cox wrote:
>>
>> It’s not really about making the compiler happy, it’s about making your code
>> clear and bug-free.
>
>> The compiler is telling you your design is probably faulty, but the correct
>>
I am trying to update some source code which does every second:
CNCopySupportedInterfaces and CNCopyCurrentNetworkInfo and extracts the values
of kCNNetworkInfoKeySSID and kCNNetworkInfoKeyBSSID.
All this is deprecated in iOS 9.0.
Xcode 7.0 tells me:
'CNCopySupportedInterfaces' is deprecated: f
A simple app with iOS 9.0.2:
MasterView has TableView + SearchBar
DetailView has other stuff.
Two things I am trying to do (and failing miserably)
Scenario A:
Back from DetailView to MasterView with keyboard already in place.
What I get (and don’t like) is: MasterView slides in from left (but wit
I just created a new project with Xcode 7.0: iOS Master-Detail App.
The TableView in one of the Master Scenes has a Cell, which in Utilities →
Connections inspector displays (under Triggered Segues):
selection → Navigation Controller show detail.
The same Scene has a UIStoryboardSegue called “sho
iPad / iPhone Master-Detail app. iOS 9.0, Xcode 7.0
Rotating the iPad to Portrait my AppDelegate will receive a
UIDeviceOrientationDidChangeNotification:
12:23:01.182 -[AppDelegate iPadHasTurned:]
and does:
UISplitViewControllerDisplayMode newMode = PrimaryOverlay
splitV
> On 13 Oct 2015, at 04:49, David Duncan wrote:
>
>
>> On Oct 11, 2015, at 11:21 PM, Gerriet M. Denkmann
>> wrote:
>>
>> iPad / iPhone Master-Detail app. iOS 9.0, Xcode 7.0
>>
>> Rotating the iPad to Portrait my AppDelegate will receive a
I put into some iOS 9 app (Xcode 7.0) 4 UILabels.
All have Clip Subviews = off, font size 96 with a coloured background, text
plain = “ฟี้กุฎุมพี”.
The difference is the font:
System: ok (but is too bold for my taste)
Thonburi and Thonburi Light: bottom get cut off
System Light: bottom gets cu
> On 15 Oct 2015, at 00:03, David Duncan wrote:
>
>
>> On Oct 14, 2015, at 4:02 AM, Gerriet M. Denkmann
>> wrote:
>>
>> I put into some iOS 9 app (Xcode 7.0) 4 UILabels.
>> All have Clip Subviews = off, font size 96 with a coloured background, te
Master-Detail iOS 9 app; Xcode 7.
Master has a TableView with UISearchController.
When I scroll the Master TableView and then use the scroll-to-top gesture (a
tap on the status bar) the expected thing happens.
But when I do the same with the SearchResultsTableView, nothing happens at all.
I have
I have a program which talks via NSXPCConnection to a privileged helper tool.
It also can install the helper tool, using SMJobBless().
The problem: When I change the helper tool, the only way to get the new version
running is to remove:
/Library/LaunchDaemons/myHelperTool.plist
/
ful hint.
But:
After doing SMJobBless twice, the third time I get kSMErrorInternalFailure.
Any cure for this (other than reboot)?
But anyway, this reduces the number of necessary reboots to one third.
Kind regards,
Gerriet.
>
>> Le 30 nov. 2015 à 12:28, Gerriet M. Denkmann a écrit :
I just made a Framework (Xcode 7.1), called ProcArgFramework.
I copied it into /Library/Frameworks.
In some other Project I added:
@import ProcArgFramework
But Xcode says: “Module ProcArgFramework not found”.
I tried all sorts of variations of this import-line. But all to no avail.
How
> On 2 Dec 2015, at 09:51, Roland King wrote:
>
>
>> On 2 Dec 2015, at 10:39, Gerriet M. Denkmann wrote:
>>
>> I just made a Framework (Xcode 7.1), called ProcArgFramework.
>> I copied it into /Library/Frameworks.
>>
>> In some other Pro
I have a HelperTool (installed via SMJobBless).
The HelperTool does:
NSXPCListener *listener = [[NSXPCListener alloc] initWithMachServiceName:
bundleId ];
listener.delegate = myNSXPCListenerDelegate;
[listener resume];
NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop];
[ currentRunLoop ru
> On 20 Feb 2016, at 06:32,Charles Srstka wrote:
>
>
>
>> On Feb 19, 2016, at 4:29 PM, Jens Alfke wrote:
>>
>> NSInteger is a typedef of ‘long’ in 64-bit, and ‘int’ in 32-bit.
>> You’re correct that %d should be used for NSInteger in 32-bit.
>
> The recommended way to use an NSInteger, as p
> On 20 Feb 2016, at 11:24, Quincey Morris
> wrote:
>
> On Feb 19, 2016, at 19:00 , Gerriet M. Denkmann wrote:
>>
>> I use Other C Flags: -DNS_BUILD_32_LIKE_64=1
>
> AFAIK this is a Mac-only thing. I don’t believe it works on a 32-bit iOS
> platform, in p
> On 20 Feb 2016, at 11:59, Quincey Morris
> wrote:
>
> On Feb 19, 2016, at 20:43 , Gerriet M. Denkmann wrote:
>>
>> This:
>> UIDevice *theDevice = [UIDevice currentDevice];
>> NSLog(@“%s NSUInteger %lu bytes on %@“,__FUNCTION__,
>> si
> On 20 Feb 2016, at 13:02, Quincey Morris
> wrote:
>
> On Feb 19, 2016, at 21:30 , Gerriet M. Denkmann wrote:
>
> Now that I code almost exclusively in Swift, the problem has largely
> disappeared, because ‘“\(someValue)"' is a lot easier*** than ‘[NSS
I have a file “Some Font.ttf” and I want to know the displayName of this font,
which might be “Some-Font” or “Nice Font” or anything else.
Or nil if this is not a well-formatted font file.
I do NOT want to install the font nor do anything with it.
Short of reverse-engeneering the ttf format (whic
> On 26 Feb 2016, at 17:33, Ken Thomases wrote:
>
> On Feb 26, 2016, at 4:16 AM, Gerriet M. Denkmann wrote:
>>
>> I have a file “Some Font.ttf” and I want to know the displayName of this
>> font, which might be “Some-Font” or “Nice Font” or anything else.
>
regards,
Gerriet.
>
>> On Feb 26, 2016, at 2:16 AM, Gerriet M. Denkmann
>> wrote:
>>
>> I have a file “Some Font.ttf” and I want to know the displayName of this
>> font, which might be “Some-Font” or “Nice Font” or anything else.
>> Or nil if this is no
hanks for the link - this might come in handy some other time.
Kind regards
Gerriet.
>
>> On Feb 26, 2016, at 10:31 AM, Jens Alfke wrote:
>>
>> If this functionality exists it would probably be down in the CoreText
>> framework. Take a look there.
>>
>&
> On 27 Feb 2016, at 09:54, Ken Thomases wrote:
>
> On Feb 26, 2016, at 7:17 AM, Gerriet M. Denkmann wrote:
>>
>> On 26 Feb 2016, at 17:33, Ken Thomases wrote:
>>>
>>> On Feb 26, 2016, at 4:16 AM, Gerriet M. Denkmann
>>> wrote:
>>>
I have a TextField bound to Shared User Defaults Controller.
The Null Placeholder is set to “default”.
When the window comes up, it shows the value from NSUserDefaults
registerDefaults:. Ok
When I remove the string from the TextField, I see a grey value “default”. Also
to be expected.
The actual
In 10.10.5 using a $-prefixed archiving key does NOT work.
Does it work in 10.11?
If not, I will file a bug.
Gerriet.
This is my test code:
#import "AppDelegate.h"
static NSString *const kArchivingKey = @"$my archiving key";// no bug
without leading '$'
@interface AppDelegate ()
@
I have a String message1, bound to TextField textField1. (OS X 10.10.5).
- (void)computeSomething
{
self.message1 = @“Start computing”;
// some seconds of computations
self.message1 = @“Result = 42”;
}
This never shows “Start computing”.
(same problem with self. textF
> On 14 Mar 2016, at 14:17, Quincey Morris
> wrote:
>
> On Mar 13, 2016, at 23:50 , Gerriet M. Denkmann wrote:
>>
>> - (void)computeSomething
>> {
>> self.message1 = @“Start computing”;
>> // some seconds of computations
>>
I have an iOS app (9.2.1) (not document based) which contains stuff in:
/private/var/mobile/Containers/Data/Application/55…F0/Documents, which is the
NSDocumentDirectory in NSUserDomainMask.
I want to see these files in iTunes → my iOS Device → Apps → File Sharing
But my app does not even make i
> On 20 Mar 2016, at 02:21, Quincey Morris
> wrote:
>
> On Mar 19, 2016, at 11:24 , Gerriet M. Denkmann wrote:
>>
>> I have an iOS app (9.2.1) (not document based) which contains stuff in:
>> /private/var/mobile/Containers/Data/Application/55…
In my calendar 2016/3/1 is a Friday, but:
- (NSString *)timerStringFor: (NSDate *)date
{
NSDateFormatter *dateFormatter = [ [ NSDateFormatter alloc ] init];
dateFormatter.dateFormat = @"EEE dd MMM HH:mm:ss ZZZ";
NSString *un = [ dateFormatter stringFromDate: date ];
Please ignore previous post.
NSDate *nextTh =[ currentCalendar dateByAddingUnit:
NSCalendarUnitDay
value: 7
toDate: now
options:NSCalendarWrapComponents
];
NSLog(@“%s now + %zd days = %@",__FUNCTION__, addDay, [
> On 25 Mar 2016, at 23:01, Clark Cox wrote:
>
>>
>> On Mar 25, 2016, at 08:43, Gerriet M. Denkmann wrote:
>>
>> In my calendar 2016/3/1 is a Friday, but:
>
>
> Something's wrong with your calendar then :). March 1, 2016 *is* a Tuesday:
Yes,
This is done once (OS X 10.10.5):
commonSendQueue = dispatch_queue_create( “common socket queue",
DISPATCH_QUEUE_SERIAL);
Several objects do this quite often:
NSDate *dax0 = [ NSDate date ];
dispatch_async(commonSendQueue, ^{ @autoreleasepool { [ someOtherObject
doSomethingwithD
> On 30 Mar 2016, at 18:35, Ken Thomases wrote:
>
> On Mar 30, 2016, at 1:44 AM, Gerriet M. Denkmann wrote:
>>
>> This is done once (OS X 10.10.5):
>> commonSendQueue = dispatch_queue_create( “common socket queue",
>> DISPATCH_QUEUE_SERIAL);
>
> On 30 Mar 2016, at 18:35, Ken Thomases wrote:
>
> On Mar 30, 2016, at 1:44 AM, Gerriet M. Denkmann wrote:
>
> This may have something to do with App Nap or timer coalescing.
I made a small test app (available on request) which exhibits the same problem.
For the first fe
I am trying to teach my iOS app to accept AirDroppings.
I added two Document Types: public.plain-text and public.folder, (no Additional
document type properties) and implemented application:openURL:options:
Dropping plain text files works fine.
But with folders: the iOS Device shows (shortly) “A
NSFileWrapper *fileWrapper = … some Folder …
NSData *dataRaw = fileWrapper.serializedRepresentation;
NSDate *dataCompressed = … COMPRESSION_LZFSE …
When I do this in OS X 10.11.4 dataRaw = 30380898, dataCompressed = 5638680 (
18.6 %)
But in the iOS Simulator 9.3.1: dataRaw = 28206422, dataCompre
I have an OS X app, which creates a file like: SomeName.zapmax
This file has:
ContentType: dyn.ad6s….j67df
Extended Attribut: com.apple.metadata:kMDLabel_u37…wqm = some unrecognisable
data
ContentTypeTree: public.data ← public.item
This file gets sent via AirDrop to an iOS Device.
On this iOS D
> On 4 Apr 2016, at 23:49, Jens Alfke wrote:
>
>
>> On Apr 4, 2016, at 1:18 AM, Gerriet M. Denkmann wrote:
>>
>> When I do this in OS X 10.11.4 dataRaw = 30380898, dataCompressed = 5638680
>> ( 18.6 %)
>> But in the iOS Simulator 9.3.1: dataR
> On 5 Apr 2016, at 00:35, Quincey Morris
> wrote:
>
> On Apr 4, 2016, at 09:59 , Gerriet M. Denkmann wrote:
>>
>> Both the Simulator and the OS X App compress the same folder (which resides
>> on OS X).
> Incidentally, the OS X documenta
> On 4 Apr 2016, at 23:48, Quincey Morris
> wrote:
>
> On Apr 4, 2016, at 08:30 , Gerriet M. Denkmann wrote:
>>
>> That is, how to associate a special UTI with the file?
>
> You first need to *define* your own UTI. Add an entry to the Exported UTIs
> sec
> On 5 Apr 2016, at 08:17, Graham Cox wrote:
>
>> On 5 Apr 2016, at 10:41 AM, Gerriet M. Denkmann wrote:
>>
>> What are the alternatives?
>
> file paths or NSURL?
Not really. If I send file paths or NSURLs (pointing to files on OS X) to my
iOS Devices, the
> On 5 Apr 2016, at 08:30, Jens Alfke wrote:
>
>
>> On Apr 4, 2016, at 9:59 AM, Gerriet M. Denkmann wrote:
>>
>> Both the Simulator and the OS X App compress the same folder (which resides
>> on OS X).
>
> OK, but the raw data size is significa
> On 4 Apr 2016, at 23:48, Quincey Morris
> wrote:
>
> On Apr 4, 2016, at 08:30 , Gerriet M. Denkmann wrote:
>>
>> That is, how to associate a special UTI with the file?
A quick follow-up:
Everything works even when the importing iOS app does NOT declare exporte
> On 5 Apr 2016, at 10:19, Quincey Morris
> wrote:
>
> On Apr 4, 2016, at 18:16 , Gerriet M. Denkmann wrote:
>>
>> The importing iOS app has both exported and imported UTI defined (not sure
>> what is really needed).
>>
>> But when the Document Typ
OS X 10.11.4; Xcode Version 7.3 (7D175).
self.timer = [ NSTimer scheduledTimerWithTimeInterval: 900 … repeats: YES ];
self.timer.fireDate = [ NSDate dateWithTimeIntervalSinceNow: ];
works fine without sleep.
But:
fireDate: Fri 29 Apr 2016 15:06:14 +0700 in 37.03 min +900 sec
Fri 29 Apr 201
I just did:
> cd
> /Applications/Xcode.app/Contents/Developer/Documentation/DocSets/com.apple.adc.documentation.watchOS.docset/Contents/Resources/Tokens/C/tag/-
>
> ls -skl
There are 8 files. Finder → File → Get Info → Size: has for each: xxx bytes
(Zero bytes on disk), where “xxx” is the same
> On 5 May 2016, at 13:13, Stephen J. Butler wrote:
>
> Those files are compressed by the filesystem. In HFS+/MacOS Extended that
> means that the data fork is empty and the file contents are stored in the
> resource fork or extended attributes structure.
>
> http://wiki.sleuthkit.org/index.p
Thing *aThing = [ Thing new ];
void *thingData = [ aThing data ]; // pointer to a buffer owned by
aThing
… never use aThing after this point → Arc might release aThing right now
… but do lots of things with thingData
… no more need for thingData
[ aThing release];
How to prevent Arc
> On 9 May 2016, at 09:25, Roland King wrote:
>
>
>> On 9 May 2016, at 10:11, Gerriet M. Denkmann wrote:
>>
>> Thing *aThing = [ Thing new ];
>>
>> void *thingData = [ aThing data ]; // pointer to a buffer owned by
>> aThing
>>
I have an OS X app (10.11.5) which has a button called AirDrop, which does:
- (IBAction)airDrop: (NSButton *)sender
{
NSArray *shareItems = list of one or more urls of pdf files
NSSharingService *service = [ NSSharingService sharingServiceNamed:
NSSharingServiceNameSendViaAirDrop
I have an OS X app (10.11.5) which has a button called AirDrop, which does:
- (IBAction)airDrop: (NSButton *)sender
{
NSArray *shareItems = list of one or more urls of pdf files
NSSharingService *service = [ NSSharingService sharingServiceNamed:
NSSharingServiceNameSendViaAirDrop
n. It is better to have this delegate method
implemented.
Kind regards,
Gerriet.
>
>
>> On May 26, 2016, at 10:23 PM, Gerriet M. Denkmann
>> wrote:
>>
>> I have an OS X app (10.11.5) which has a button called AirDrop, which does:
>>
>> - (IBAction)a
> On 28 May 2016, at 02:06, Jens Alfke wrote:
>
> File a bug report with Apple!
Just done.
>
> —Jens (who has intermittent troubles with AirDrop too)
>
>> On May 27, 2016, at 10:47 AM, Gerriet M. Denkmann
>> wrote:
>>
>>
>>> On 27 May 2
:06, Jens Alfke wrote:
>
> File a bug report with Apple!
>
> —Jens (who has intermittent troubles with AirDrop too)
>
>> On May 27, 2016, at 10:47 AM, Gerriet M. Denkmann
>> wrote:
>>
>>
>>> On 27 May 2016, at 23:18, Steve Christensen wrote:
OS X 10.11.5, Xcode Version 7.3.1 (7D1014).
App with TableView (View based). Works fine.
But when I give the TableView a delegate (even without implementing any
NSTableViewDelegate methods) it crashes (see below).
How to debug this?
Tried a symbolic breakpoint in -[__NSArrayM objectAtIndex:] -
> On 13 Jun 2016, at 21:43, Alastair Houghton
> wrote:
>
> On 12 Jun 2016, at 10:10, Gerriet M. Denkmann wrote:
>>
>> OS X 10.11.5, Xcode Version 7.3.1 (7D1014).
>>
>> App with TableView (View based). Works fine.
>> But when I give the TableView
> On 14 Jun 2016, at 16:03, Alastair Houghton
> wrote:
>
> On 14 Jun 2016, at 05:33, Gerriet M. Denkmann wrote:
>>
>> But I had:
>> - (void)awakeFromNib
>> {
>> self.someUniqueObject = [ [ UniqueObject alloc ] init ];
>> }
>>
>&
I have a server macOS app which publishes a service via NSNetService.
And a client iOS app which finds this service via NSNetServiceBrowser.
Then the client sends commands to the server via NSOutputStream and receives
data from the server via NSInputStream.
All this works fine - but there is cur
Is it possible to create an NSService (OS X 10.11.45) which is discoverable
(via NSServiceBrowser) outside of the local WiFi network?
What should be used for domain in this case?
If not: what is the use of domain ≠ “local.” , e.g. domain = “” ?
Also: I noticed that includesPeerToPeer = YES makes
> On 26 Jun 2016, at 05:12, Jens Alfke wrote:
>
>
>> On Jun 18, 2016, at 2:34 AM, Gerriet M. Denkmann
>> wrote:
>>
>> 1. (important) the client really wants to know that:
>> (1a) it is talking to the right server and not to some evil ent
> On 27 Jun 2016, at 06:11, Jens Alfke wrote:
>
>> On Jun 25, 2016, at 7:44 PM, Gerriet M. Denkmann
>> wrote:
>
>> Absolutely not sure whether the code above is correct, but it seems to be
>> working.
> It’s fine; the certificate is public and intended t
> On 26 Jun 2016, at 21:59, Keary Suska wrote:
>
>
>> On Jun 25, 2016, at 8:44 PM, Gerriet M. Denkmann
>> wrote:
>>
>> Following TN2326 I created a (self signed) Certificate Authority and a
>> Digital Identity called "MyServerId".
>>
> On 27 Jun 2016, at 12:57, Jens Alfke wrote:
>
>> On Jun 26, 2016, at 8:13 PM, Gerriet M. Denkmann
>> wrote:
>>
>> Assume that an evil entity has got hold of “MyServerCertificate.cer”, but
>> has no access to my keychain and thus to the private key o
iOS 9.3.2
I have an app with a UISearchBar.
I type something in the SearchBar. Keyboard appears.
I press a long time in the SearchBar.
I get a black thingy “Select | Select All | Paste” and select “Select All”
I get another black thingy: “Cut | Copy | … | Share” and select “Share".
Keyboard disapp
When I get an NSStream I do:
aStream.delegate = myStreamDelegate;
[ aStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:
NSDefaultRunLoopMode];
[ aStream open];
myStreamDelegate then receives stream:handleEvent: messages.
The documentation says: “The message is sent on the stream objec
> On 4 Jul 2016, at 12:00, Charles Srstka wrote:
>
>> On Jul 3, 2016, at 11:35 PM, Gerriet M. Denkmann
>> wrote:
>>
>> When I get an NSStream I do:
>>
>> aStream.delegate = myStreamDelegate;
>> [ aStream scheduleInRunLoop:[NSRunLoop c
I have a subclass of NSThread (called MyThread), which runs a RunLoop in main.
When it gets cancelled, it leaves the RunLoop and main will exit.
Some other thread does:
if ( myThread.isCancelled )
{
// probably the RunLoop of myThread is no longer running
// adding stuff
> On 11 Jul 2016, at 16:00, Alastair Houghton
> wrote:
>
> On 11 Jul 2016, at 06:35, Gerriet M. Denkmann wrote:
>>
>> I have a subclass of NSThread (called MyThread), which runs a RunLoop in
>> main.
>> When it gets cancelled, it leaves the RunLoop
I have an app (macOS 11.6) which uses kCFStreamPropertySSLSettings.
When it gets some streams it will show a panel:
“MyApp wants to sign using key “something” in your keychain” / “Allow” “Deny”
When I click “Deny” the streams get NSOSStatusErrorDomain errSecAuthFailed.
Else (clicked “Allow”) the
> On 23 Jul 2016, at 06:41, Jens Alfke wrote:
>
>
>> On Jul 22, 2016, at 2:46 AM, Gerriet M. Denkmann
>> wrote:
>>
>> When it gets some streams it will show a panel:
>> “MyApp wants to sign using key “something” in your keychain” / “Allow” “Deny”
>
> On 25 Jul 2016, at 15:30, Alastair Houghton
> wrote:
>
>
>> On 23 Jul 2016, at 00:41, Jens Alfke wrote:
>>
>>
>>> On Jul 22, 2016, at 2:46 AM, Gerriet M. Denkmann
>>> wrote:
>>>
>>> When it gets some streams it will sh
I have an iOS app and a macOS app - both implement handoff (NSUserActivity).
Handoff works between iOS devices and from iOS to macOS.
But never from macOS to iOS device.
The macOS app is document based, the iOS app is not.
In the macOS app the subclass of NSDocument implements updateUserActivit
I have an iOS app (9.3.5) which has an UITextView where the following is done
often:
User long presses first word
(User clicks “Select” - only needed if Keyboard is visible)
User clicks “Define”
→ the definition of the first word is displayed (e.g. in Oxford Dictionary of
English).
I want to a
> On 2 Sep 2016, at 13:46, Igor Ranieri wrote:
>
> You might want to look into UIReferenceLibraryViewController. That’s the
> class that presents the dictionary view for you, you can instantiate it with
> a term and present it to the user.
>
Thanks a lot! Exactly what I was trying to find.
How to translate this into Swift (current version, i.e. the one before 3.0):
UITextView *uitv = …
NSRange selectedRange = uitv.selectedRange;
NSString *textString = uitv.string;
NSString *selectedString = [ textString substringWithRange: selectedRange ];
Looks simple, but I have now tried for mor
> On 2 Sep 2016, at 20:00, Jim Adams wrote:
>
>
>> On Sep 2, 2016, at 5:17 AM, Gerriet M. Denkmann wrote:
>>
>> How to translate this into Swift (current version, i.e. the one before 3.0):
>>
>> UITextView *uitv = …
>> NSRange selectedRange
> On 3 Sep 2016, at 00:23, Quincey Morris
> wrote:
[…]
> My only quibble would be the double bridging:
>
>> let swiftString = uitv.text // bridging from
>> NSString to String
>> let nsString = swiftString as NSString // bridging from String
>> to NSStr
Did in a playground:
let s = String(format: "%2s → %2s", "a", "b")
print(“formatted = \"\(s)\"")
But this prints random garbage (e.g.: formatted = “‡“S → ‡“S”) (no error
message or compiler warning).
Why?
How to create a formatted string?
Gerriet.
> On 3 Sep 2016, at 12:22, Quincey Morris
> wrote:
>
> On Sep 2, 2016, at 22:02 , Gerriet M. Denkmann wrote:
>>
>> Did in a playground:
>>
>> let s = String(format: "%2s → %2s", "a", "b")
&
> On 3 Sep 2016, at 14:52, Quincey Morris
> wrote:
>
> The other issue I can think of would be how to interpret the field width,
> since “real” strings can be counted in different ways. Would %9@ mean 9
> UTF-16 code units? 9 Unicode code points? 9 grapheme clusters?
>
> There’s probably a s
> On 3 Sep 2016, at 16:23, Quincey Morris
> wrote:
>
> On Sep 3, 2016, at 02:06 , Gerriet M. Denkmann wrote:
>>
>> By the way: what I really wanted to do is:
>> let s = String(format: “%9d”, someString.endIndex )
>
> I don’t understand this. Is %9d a
I have a SuperClass with several Subclasses.
The SuperClass will never be instantiated. It just contains code common to all
subclasses.
Here an example:
I really want “onlyKnownBySubclass” to be a constant (i.e. let instead of var).
But cannot figure out how to do this.
class SuperClass
{
> On 5 Sep 2016, at 13:29, Quincey Morris
> wrote:
>
> On Sep 4, 2016, at 22:50 , Gerriet M. Denkmann wrote:
>
> If you can’t do that, you can do it with a closure, assuming the places of
> definition aren’t more complicated than in your code. Something like this:
&
var numbers: [UInt64] = …
func numbers( upTo nbr: Int ) -> [UInt64]
{
let slice = numbers[ 0 ..< nbr ]
return slice
// Cannot convert return expression of type ‘ArraySlice'
to return type '[UInt64]'
// workaound:
var outCopy:[UI
> On 7 Sep 2016, at 07:55, Jonathan Hull wrote:
>
> I realized my comment may not have been clear.
Probably clear enough.
> Here is the actual code (written in Mail):
>
> var numbers: [UInt64] = …
>
> func numbers( upTo nbr: Int ) -> [UInt64]
> {
> return Array( numbers[
> On 7 Sep 2016, at 10:49, Quincey Morris
> wrote:
>
>> Another problem:
>> Super → SubA and SubB.
>> SubA → SubA1 and SubA2
>> SubB → SubB1 and SubB2
>>
>> Both SubA1 and SubB1 have identical functions. As have SubA2 and SubB2.
>> Multiple inheritance would be a solution here; but neither Ob
> On 7 Sep 2016, at 10:49, Quincey Morris
> wrote:
>
> On Sep 6, 2016, at 17:17 , Gerriet M. Denkmann wrote:
>>
>> But what to do about localConstantDependingOnSuper?
[…]
> Anyway, this particular example is fairly easily solved by declaring
> “localConstantDep
> On 7 Sep 2016, at 11:28, Quincey Morris
> wrote:
>
> On Sep 6, 2016, at 21:14 , Gerriet M. Denkmann wrote:
>>
>> But I cannot get this to work.
>
> Meaning … ?? A compiler error? What does the source code look like, of the
> protocol with the class func
> On 7 Sep 2016, at 11:42, Quincey Morris
> wrote:
>
> On Sep 6, 2016, at 21:31 , Gerriet M. Denkmann wrote:
>>
>> My Swift book (2.2) has no mention of “private” (Swift 3 beta has).
>
> It’s in the 2.2 book under “Language Guide” section “Access Control”
You
Trying to eliminate code duplication I tried to use protocol extensions.
But I ran into a rather grave problem.
This probably is “working as documented”.
But it surely it is not working like I hoped it would.
Here is a Playground example:
protocol Number
{
func aFunction() -> Int
}
exte
I have several Swift classes CclassA, ClassB), all implementing the BitField
protocol:
protocol BitField
{
init?(limit: UInt64, verbose: Int)
}
My AppDelegate Swift class has:
var a: BitField?
switch mm
{
case .A:a = ClassA(limit: maxp, verbose: verbose )
c
1 - 100 of 1020 matches
Mail list logo