Stuck in Swift

2014-08-14 Thread Gerriet M. Denkmann
I have a class called SomeClass which should be able to set some TextFields. But it just does not compile. And the error message: "'String' is not a subtype of 'AppDelegate'" while certainly true, is not too helpful. I tried several variations, but I just can't get it to compile. Very frustratin

Translating to Swift

2014-08-13 Thread Gerriet M. Denkmann
How could I translate this to Swift? + (Thing *)sharedThing { static Thing *commonThing; static dispatch_once_t justOnce; dispatch_once( &justOnce, ^void { commonThing = [ [ Thing alloc ] init ]; } );

Re: Common Date between Swift and ObjC

2014-08-12 Thread Gerriet M. Denkmann
On 13 Aug 2014, at 00:52, Jeff Kelley wrote: > Gerriet, > > You should be able to make a constant variable, not a preprocessor > definition, and import the file that declares it in your project’s bridging > header. Something like this: > > in Constants.h: > extern const NSInteger kPara

Common Date between Swift and ObjC

2014-08-12 Thread Gerriet M. Denkmann
In ObjC I used to do: CommonDefines.h #define PARAMETER_A 17 and then import CommonDefines.h into all files which have to know this parameter. But how do I make a Swift file and an ObjC file both aware of the value of PARAMETER_A? Keeping both in sync is rather error prone; I much rath

Re: How to get SDK at compile time?

2014-08-12 Thread Gerriet M. Denkmann
On 12 Aug 2014, at 17:20, Manoah F. Adams wrote: > > On Aug 12, 2014, at 02:44:000, Gerriet M. Denkmann wrote: > >> At runtime I do: >> // 10.8.x or earlier needsSpecialTreatment >> BOOL needsSpecialTreatment = floor(NSFoundationVersionNumber) <= &g

How to get SDK at compile time?

2014-08-12 Thread Gerriet M. Denkmann
At runtime I do: // 10.8.x or earlier needsSpecialTreatment BOOLneedsSpecialTreatment = floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber10_8; But how to do it at compile time? Like: #if BEFORE_10_10 <-- what to write here? NSString *infoPlistKey = kSMInfoKe

Re: How to make a LaunchAgent

2014-08-11 Thread Gerriet M. Denkmann
On 11 Aug 2014, at 17:53, Kevin Meaney wrote: > >> You’re not supposed to start it - launchd/XPC services is supposed to start >> it for you. You’re supposed to register it as a LaunchAgent/Daemon, creating >> the launchd.plist file and when you need the service, it starts and when you >> do

How to make a LaunchAgent

2014-08-11 Thread Gerriet M. Denkmann
I have a Xpc Helper, which is local to my App (that is only my App can talk to it) which works fine. Now I want to convert this Xpc Helper into a LaunchAgent. I guess I have to start it via SMJobSubmit(). But when I do this with the existing Helper, it crashes, gets restarted, crashes again, et

Re: Converting to Swift

2014-08-11 Thread Gerriet M. Denkmann
On 11 Aug 2014, at 16:05, Bavarious wrote: > >> On 11 Aug 2014, at 05:53, Gerriet M. Denkmann wrote: >> >> >> On 11 Aug 2014, at 15:43, Bavarious wrote: >> >>> On 11 Aug 2014, at 05:35, Gerriet M. Denkmann wrote: >>>> >

Re: Converting to Swift

2014-08-11 Thread Gerriet M. Denkmann
On 11 Aug 2014, at 15:43, Bavarious wrote: > On 11 Aug 2014, at 05:35, Gerriet M. Denkmann wrote: >> >> I am trying to convert: >> NSString * helperName = @"de.mdenkmann.Xpc-Exchange”; >> CFDictionaryRef diref = SMJobCopyDictionary( kSMDomainSystemLa

Converting to Swift

2014-08-11 Thread Gerriet M. Denkmann
I am trying to convert: NSString * helperName = @"de.mdenkmann.Xpc-Exchange”; CFDictionaryRef diref = SMJobCopyDictionary( kSMDomainSystemLaunchd, (__bridge CFStringRef)helperName ); NSDictionary *jobDict = (NSDictionary *)CFBridgingRelease(diref); if ( jobDict == n

Re: Putting Xpc Helper into Library/LaunchAgents

2014-08-10 Thread Gerriet M. Denkmann
On 10 Aug 2014, at 14:33, Roland King wrote: > >> On 10 Aug 2014, at 2:18 pm, Gerriet M. Denkmann wrote: >> >> I have an app with an Xpc Helper, which currently starts with: >> NSXPCConnection( serviceName: xpcServiceName ) >> But the goal is that two ap

Putting Xpc Helper into Library/LaunchAgents

2014-08-09 Thread Gerriet M. Denkmann
I have an app with an Xpc Helper, which currently starts with: NSXPCConnection( serviceName: xpcServiceName ) But the goal is that two apps should talk to each other, the Xpc Helper being used to exchange endpoints. So I have to use: NSXPCConnection(machServiceName: xpcServiceName

Re: Swift and NSXPCInterface

2014-08-09 Thread Gerriet M. Denkmann
On 9 Aug 2014, at 16:20, Quincey Morris wrote: > On Aug 8, 2014, at 23:48 , Gerriet M. Denkmann wrote: > >> let b = NSXPCInterface( protocol: Xpc_CommonProtocol ) > > When I try it, the “protocol” is syntax highlighted as a keyword, so I > suspect that’s the fi

Swift and NSXPCInterface

2014-08-08 Thread Gerriet M. Denkmann
I am trying to translate this: NSXPCInterface *b = [NSXPCInterface interfaceWithProtocol:@protocol(Xpc_CommonProtocol)]; to Swift. This compiles (and runs) as expected: var dummy : AnyObject? if let protoDummi = dummy as? Xpc_CommonProtocol { println("dummy DOES implement Xpc_Co

Re: restricting InterfaceOrientations

2014-08-07 Thread Gerriet M. Denkmann
On 8 Aug 2014, at 12:14, Roland King wrote: > >>> >>> >>> Why not just put them in the Deployment Info in the General tab so they go >>> in the plist file like you’ve been meant to since .. not sure .. iOS6 >>> perhaps. >> >> My Info.plist contains: >> >> Supported interface orientations

Re: restricting InterfaceOrientations

2014-08-07 Thread Gerriet M. Denkmann
On 8 Aug 2014, at 11:39, Quincey Morris wrote: > On Aug 7, 2014, at 20:50 , Gerriet M. Denkmann wrote: > >> Problem: on iPhone the DetailView does not make sense in landscape (iPad is >> fine with landscape). > > A while back I went through some self-immolation tryi

Re: restricting InterfaceOrientations

2014-08-07 Thread Gerriet M. Denkmann
On 8 Aug 2014, at 10:57, Roland King wrote: > >> On 8 Aug 2014, at 11:50 am, Gerriet M. Denkmann wrote: >> >> Master-Detail app on iOS. Universal, Xcode (Targets, General) allows all >> orientations. >> >> Problem: on iPhone the DetailView does not ma

restricting InterfaceOrientations

2014-08-07 Thread Gerriet M. Denkmann
Master-Detail app on iOS. Universal, Xcode (Targets, General) allows all orientations. Problem: on iPhone the DetailView does not make sense in landscape (iPad is fine with landscape). Fix1: added supportedInterfaceOrientations to DetailViewController, but this did never get called. "When the

Re: Getting Segue from TableView

2014-08-07 Thread Gerriet M. Denkmann
On 8 Aug 2014, at 04:03, Mike Abdullah wrote: > > On 7 Aug 2014, at 15:06, Gerriet M. Denkmann wrote: > >> iOS app, Master - Detail. >> Master has TableView, when one tabs a table row, a segue to the Detail View >> is performed. >> >> The problem: >

Getting Segue from TableView

2014-08-07 Thread Gerriet M. Denkmann
iOS app, Master - Detail. Master has TableView, when one tabs a table row, a segue to the Detail View is performed. The problem: Sometimes when the app starts, there is only one item in the TableView. In this case I want to segue to the DetailView programatically, because there is nothing to ch

Re: Talking to other apps - again

2014-08-06 Thread Gerriet M. Denkmann
On 6 Aug 2014, at 22:05, Alex Zavatone wrote: > By the way, if you do want to check out XPC, there is a good tutorial on > objc.io here: > > http://www.objc.io/issue-14/xpc.html Very interesting. Thanks for the link! A quote: "Let’s say we have two apps, and we would like them to be able to

Re: Talking to other apps - again

2014-08-06 Thread Gerriet M. Denkmann
On 6 Aug 2014, at 12:46, Jens Alfke wrote: > >> On Aug 5, 2014, at 10:06 PM, Gerriet M. Denkmann >> wrote: >> >> Scripting Bridge SBObject has a sendEvent:id:parameters:. Not sure I want to >> use this. > > It seems like your best bet, actually. &g

Re: Talking to other apps - again

2014-08-06 Thread Gerriet M. Denkmann
On 6 Aug 2014, at 12:30, Roland King wrote: > >> On 6 Aug 2014, at 1:06 pm, Gerriet M. Denkmann wrote: >> >> Step 1: Use XPC. >> >> Is there some other way to make this work? Or should I just forget about XPC? >> > > I’d forget about XPC, it’s

Re: Talking to other apps - again

2014-08-06 Thread Gerriet M. Denkmann
On 6 Aug 2014, at 12:30, Roland King wrote: > What happened to the suggestions of using a domain socket or a directory both > apps can read to do this? One thing at a time. This might be Step 3 or 4. First I have to investigate Step 1 (maybe a dead end) and Step 2. Kind regards, Gerriet.

Talking to other apps - again

2014-08-05 Thread Gerriet M. Denkmann
To sum up: I have two apps (A and B) both written by me, both not scriptable, both not using Sandbox (yet). A wants to send something to B (e.g. a serialisable Dictionary) and get some answer back (e.g. also a Dictionary). B should show some relevant info related to A's request. Step 1: Use XPC

Re: Talking to other apps

2014-08-04 Thread Gerriet M. Denkmann
Sorry about this. > > If your App is sandboxed and the service is not an xpc service embedded in > your application then I think your pretty much out of luck. > > Kevin > > On 4 Aug 2014, at 07:54, Gerriet M. Denkmann wrote: > >> My app wants to talk to some a

Talking to other apps

2014-08-03 Thread Gerriet M. Denkmann
My app wants to talk to some app-friend. Like sending a string and getting another string back. Or something slightly more complicated. In the good old days I would have used Distributed Objects, but this seems to be no longer the fashion. Xcode 6 does not provide any documentation about this (

Re: How to constrain a UISlider in a UIToolbar?

2014-07-30 Thread Gerriet M. Denkmann
On 31 Jul 2014, at 00:18, David Duncan wrote: >> That's the purpose of setting the auto-resizing mask to FlexibleWidth. At >> least for title views, that causes UINavigationBar to send -sizeThatFits: to >> the view. > > For UINavigationBar you shouldn’t need to even set flexible width, just

Re: How to constrain a UISlider in a UIToolbar?

2014-07-29 Thread Gerriet M. Denkmann
On 30 Jul 2014, at 11:27, Kyle Sluder wrote: >> On Jul 29, 2014, at 9:11 PM, "Gerriet M. Denkmann" >> wrote: >> >> >> But nobody ever cares to call sizeThatFits or systemLayoutSizeFittingSize. >> >> Overriding requiresConstraintBas

Re: How to constrain a UISlider in a UIToolbar?

2014-07-29 Thread Gerriet M. Denkmann
On 29 Jul 2014, at 22:14, Kyle Sluder wrote: >> On Jul 29, 2014, at 2:34 AM, "Gerriet M. Denkmann" >> wrote: >> >> I have a UIToolbar which contains a UISlider, flanked by two flexible spaces. >> I would like to have this slider to be as big as possi

Re: iOS 8 beta 4 messes with my TextView

2014-07-29 Thread Gerriet M. Denkmann
On 29 Jul 2014, at 22:06, Kyle Sluder wrote: > On Jul 29, 2014, at 1:58 AM, "Gerriet M. Denkmann" > wrote: >> >> Master Detail app, works fine in 7.1.2. >> The Detail View has a UITextView. >> Whenever I get a Keyboard Notification (Changed)

How to constrain a UISlider in a UIToolbar?

2014-07-29 Thread Gerriet M. Denkmann
I have a UIToolbar which contains a UISlider, flanked by two flexible spaces. I would like to have this slider to be as big as possible. Setting it's width does not make sense, as the UIToolbar width changes, depending on device and orientation. And setting constraints on the slider seems to be i

iOS 8 beta 4 messes with my TextView

2014-07-29 Thread Gerriet M. Denkmann
Master Detail app, works fine in 7.1.2. The Detail View has a UITextView. Whenever I get a Keyboard Notification (Changed) I change the height of the TextView accordingly. All would be fine; but after all Notifications have been delivered and before I can start typing, some evil agent resets the

Re: How to get iOS version at runtime?

2014-07-18 Thread Gerriet M. Denkmann
On 19 Jul 2014, at 10:36, Roland King wrote: > >> On 19 Jul 2014, at 11:05 am, Gerriet M. Denkmann >> wrote: >> >> >> On 18 Jul 2014, at 22:24, Roland King wrote: >> >>>> 2. these Notifications have two rects in their userInfo: >&g

Re: How to get iOS version at runtime?

2014-07-18 Thread Gerriet M. Denkmann
On 18 Jul 2014, at 22:24, Roland King wrote: >> 2. these Notifications have two rects in their userInfo: UIKeyboardFrameEnd >> and UIKeyboardFrameBegin. >> In 7.1.2 these are always in the portrait orientation. To be usable one has >> to rotate them to the actual orientation. >> In 8.0 they ar

Re: How to get iOS version at runtime?

2014-07-18 Thread Gerriet M. Denkmann
On 18 Jul 2014, at 20:30, Roland King wrote: > >> On 18 Jul 2014, at 3:40 pm, Gerriet M. Denkmann wrote: >> >> How to get iOS version at runtime? >> >> Like: >> >> BOOL isRunningOnDeviceOrSimulatorInVersion8 = ??? >> >> I seem to

Re: How to get iOS version at runtime?

2014-07-18 Thread Gerriet M. Denkmann
On 18 Jul 2014, at 20:14, Julius Oklamcak wrote: > [[UIDevice currentDevice] systemVersion] returns a string, i.e. "7.1.2". > > if ([[[UIDevice currentDevice] systemVersion] compare:@"8.0" > options:NSNumericSearch] == NSOrderedDescending) > // older than 8.0 > else > // 8.0 and new

How to get iOS version at runtime?

2014-07-18 Thread Gerriet M. Denkmann
How to get iOS version at runtime? Like: BOOL isRunningOnDeviceOrSimulatorInVersion8 = ??? I seem to have asked this question before (about OS X) and was told to use either NSAppKitVersionNumber or NSFoundationVersionNumber. iOS obviously has no NSAppKitVersionNumber, but I cannot find a UIKi

Master-Detail in iOS

2014-07-10 Thread Gerriet M. Denkmann
I got the default iOS Master-Detail project (using Swift) from Xocde 6 beta 3. Deployment target 7.1 There is a UISplitViewController which has an array of 2 UINavigationControllers, both have each one UIViewController: the first has MasterViewController, the second one has DetailViewController

Re: From BCP-47 to Natural?

2014-07-09 Thread Gerriet M. Denkmann
On 9 Jul 2014, at 19:27, Kyle Sluder wrote: > > On Tue, Jul 8, 2014, at 09:38 PM, Gerriet M. Denkmann wrote: >> There are several places where BCP-47 names (like "th-TH", "en-AU" etc.) >> are used. >> These are not really usable for users. >>

Where are my speechVoices?

2014-07-08 Thread Gerriet M. Denkmann
+[AVSpeechSynthesisVoice speechVoices] is "Available in iOS 7.0 and later." But when I do: NSArray *allVoices = [ AVSpeechSynthesisVoice speechVoices ]; NSLog(@"%s allVoices %@",__FUNCTION__, allVoices); I just get nil. But in the same function [ AVSpeechSynthesisVoice voiceWit

From BCP-47 to Natural?

2014-07-08 Thread Gerriet M. Denkmann
There are several places where BCP-47 names (like "th-TH", "en-AU" etc.) are used. These are not really usable for users. Is there anywhere some Cocoa library or class which converts these to natural language? Like: "th-TH" → "Thai" or "ไทย" "en-AU" → "Australian English" etc. I could create

Re: Creating Url with Fragment

2014-05-22 Thread Gerriet M. Denkmann
On 22 May 2014, at 17:25, Mike Abdullah wrote: > > On 22 May 2014, at 11:07, Gerriet M. Denkmann wrote: > >> >> This works: >> NSString *fragment = >> NSString *absString = [ @"https://translate.google.com/#"; >> string

Creating Url with Fragment

2014-05-22 Thread Gerriet M. Denkmann
This works: NSString *fragment = NSString *absString = [ @"https://translate.google.com/#"; stringByAppendingString: fragment ]; NSURL *url = [ [ NSURL alloc ] initWithString: absString ]; But I would like to use something like this: NSURL *url = [ [ NSURL al

Re: Where are the errors in NSOSStatusErrorDomain defined?

2014-05-21 Thread Gerriet M. Denkmann
May, 2014, at 1:32 pm, Roland King wrote: >>> >>> 560030580 = 0x21616374 which is '!act' >>> >>> I believe that's the pattern for Audio stuff, you turn it to a 4-char >>> string. >>> >>> There's a rumour on t

Re: cancelPerformSelector does not work

2014-05-21 Thread Gerriet M. Denkmann
ent. You are right. It is: [ NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(resumeMusic) object: nil ]; Thanks a lot! Gerriet. > > On 22 May, 2014, at 1:34 pm, Gerriet M. Denkmann wrote: > >> >> I have this code: >> >>

Re: Where are the errors in NSOSStatusErrorDomain defined?

2014-05-21 Thread Gerriet M. Denkmann
4-char >> string. Very clever! I would never have thought of this. >> >> There's a rumour on the internet that used to be kAudioSessionNotActiveError >> but I'm banana-ed if I can find that in the current SDK. >> >> On 22 May, 2014, at 1:17 pm,

cancelPerformSelector does not work

2014-05-21 Thread Gerriet M. Denkmann
I have this code: - (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didFinishSpeechUtterance:(AVSpeechUtterance *)utterance { NSTimeInterval delay = 5; NSLog(@"%s will resume music in %g sec.",__FUNCTION__, delay ); NSRunLoop *currentRunLoop = [ NSRunLoop curre

Where are the errors in NSOSStatusErrorDomain defined?

2014-05-21 Thread Gerriet M. Denkmann
Got an NSError with: "Error Domain=NSOSStatusErrorDomain Code=560030580 "The operation couldn’t be completed. (OSStatus error 560030580.)"" Have: if ( [ [ outError domain ] isEqualToString: NSOSStatusErrorDomain ] && [ outError code ] == 560030580 ) but would like to have: if

Don't stop the music

2014-05-21 Thread Gerriet M. Denkmann
I have an iOS app which can talk (using AVSpeechSynthesizer). The problem: when music is playing, it will stop (good), and my app will talk. But: the music will NOT resume afterwards, which is rather annoying. So I need something like: id previousPlayingApp = [ UIWorkspace appWhichCurrentlyPlays

Re: How to speak Chinese on 10.9.2

2014-05-15 Thread Gerriet M. Denkmann
nary per voice, since in at least one OS and earlier it > returned a retained object vs an autoreleased object against the Objective-C > memory naming contract. > -- > Gary L. Wade (Sent from my iPhone) > http://www.garywade.com/ > >> On May 15, 2014, at 5:53 AM,

Re: Obtain an NSDate object from any casually entered user string

2014-05-15 Thread Gerriet M. Denkmann
On 15 May 2014, at 19:53, Charles Srstka wrote: > On May 14, 2014, at 10:38 PM, Gerriet M. Denkmann > wrote: > >> >> On 15 May 2014, at 02:00, Ken Thomases wrote: >> >>> >>> On May 14, 2014, at 8:41 AM, Jonathan Mitchell wrote: >>>

Re: How to speak Chinese on 10.9.2

2014-05-15 Thread Gerriet M. Denkmann
s no visible effect whatsoever with any voice. > It’s been a while > since I’ve worked on my app, but I remember some calls will stop any > current speaking. > -- > Gary L. Wade > http://www.garywade.com/ > > On 5/14/2014, 11:15 PM, "Gerriet M. Denkmann" wrote: >

Re: How to speak Chinese on 10.9.2

2014-05-15 Thread Gerriet M. Denkmann
n a while since I’ve worked on my app, but I remember some calls will > stop any > current speaking. > -- > Gary L. Wade > http://www.garywade.com/ > > On 5/14/2014, 11:15 PM, "Gerriet M. Denkmann" wrote: > > >> >> On 15 May 2014, at 08:41, Jens

Re: How to speak Chinese on 10.9.2

2014-05-14 Thread Gerriet M. Denkmann
On 15 May 2014, at 08:41, Jens Alfke wrote: > On May 14, 2014, at 6:24 PM, Gerriet M. Denkmann wrote: > >> But the only thing in 10.9.2 I found was NSSpeechSynthesizer, which has 24 >> voices (which is nice) but all 24 have VoiceLanguage = VoiceLocaleIdentifier >&

Re: Obtain an NSDate object from any casually entered user string

2014-05-14 Thread Gerriet M. Denkmann
On 15 May 2014, at 02:00, Ken Thomases wrote: > > On May 14, 2014, at 8:41 AM, Jonathan Mitchell wrote: > >> Is there a way to obtain an NSDate object from a casually entered user >> string, say: 1 1 2015 or 25 jul 15? >> >> I have looked at the various NSDateFormatter and NSDate API and can

How to speak Chinese on 10.9.2

2014-05-14 Thread Gerriet M. Denkmann
My iPhone can speak in 36 languages, from German, to Thai and Chinese, using AVSpeechSynthesisVoice. But the only thing in 10.9.2 I found was NSSpeechSynthesizer, which has 24 voices (which is nice) but all 24 have VoiceLanguage = VoiceLocaleIdentifier = en_US (which seems rather odd). What am

Lenient Date Formatter

2014-05-13 Thread Gerriet M. Denkmann
I need a date formatter which can do (10.9.2): NSDate *d1 = [ dateFormatter dateFromString: @"2014-05-13 11:31:03.943 +0700" ]; NSDate *d2 = [ dateFormatter dateFromString: @"2014-05-13 11:31:03 +0700" ]; // no fractional seconds so that both d1 and d2 are non-nil. Is this possible? Cu

Accelerate vBigNum adding in place

2014-03-28 Thread Gerriet M. Denkmann
I need something like: vU1024 a = ... vU1024 b = ... a += b can one do (A): vU1024Add( &a, &b, &a); or do I have to write (B): vU1024 temp; vU1024Add( &a, &b, &temp) ; memcpy(&a, &temp, sizeof(a) ); I tried (A) and it seems to work. But this could be some (undocumented) implementation detail, a

Re: Multiple methods named 'compare:' found

2014-03-27 Thread Gerriet M. Denkmann
On 28 Mar 2014, at 12:46, Quincey Morris wrote: > On Mar 27, 2014, at 22:40 , Gerriet M. Denkmann wrote: > >> I do not want to switch off the warning for the whole file, just for this >> special line. > > IIRC, this should do it: > >> if ( [(id) a compare:

Multiple methods named 'compare:' found

2014-03-27 Thread Gerriet M. Denkmann
I have: id a,b; if (something) { a = @(43); b = some other NSNumber; } else { a = [ NSDate date]; b = some other NSDate; } if ( [ a compare: b] == NSOrderedDescending ) then ... Xcode Version 5.1 (5B130a) warns me that "Multiple methods named 'compare:' found".

Re: NSOperation Dispatch Thread Soft Limit

2014-03-03 Thread Gerriet M. Denkmann
On 3 Mar 2014, at 23:14, Jens Alfke wrote: > > On Mar 3, 2014, at 12:43 AM, Gerriet M. Denkmann wrote: > >> MyOperation does: >> create an NSOperationQueue >> add a few MyOperations to this queue >> waitUntilAllOperationsAreFinished >>

NSOperation Dispatch Thread Soft Limit

2014-03-03 Thread Gerriet M. Denkmann
I have a MyOperation, subclass of NSOperation. MyOperation does: create an NSOperationQueue add a few MyOperations to this queue waitUntilAllOperationsAreFinished (obviously this recursion stops at some point - I do not create an infinite number of operations). The good

Re: deprecated BIGNUM replaced by what?

2014-02-26 Thread Gerriet M. Denkmann
On 27 Feb 2014, at 02:03, Uli Kusterer wrote: > > On 26 Feb 2014, at 09:51, Gerriet M. Denkmann wrote: >> I want to multiply two (big) numbers. >> >> I found /usr/include/openssl/bn.h which has just what I need. >> But everything is marked DEPRECATED_IN_M

deprecated BIGNUM replaced by what?

2014-02-26 Thread Gerriet M. Denkmann
I want to multiply two (big) numbers. I found /usr/include/openssl/bn.h which has just what I need. But everything is marked DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER. So what is one expected to do in 10.9.2? There is vBigNum.h in Accelerate.framework, but this does not help with arbitrary

OpenCL with gcl buffer handling

2014-02-22 Thread Gerriet M. Denkmann
// the host has a (big) malloced hostArray, on which OpenCl should work. - (void)makeBufferOfSize: (size_t)arraySize from: (void *)hostArray { _clArray = clCreateBuffer( context, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, arraySize, hostArray, NULL ); _hostArray = hostA

gcl_create_dispatch_queue where is CL_DEVICE_TYPE_USE_DEVICE_ID

2014-02-17 Thread Gerriet M. Denkmann
gcl.h says: "gcl_queue_flags can be a combination of the followingCL_DEVICE_TYPE_GPU, CL_DEVICE_TYPE_CPU or CL_DEVICE_TYPE_USE_DEVICE_ID [...]" The slides for wwdc 2011 session_401__whats_new_in_opencl also mention CL_DEVICE_TYPE_USE_DEVICE_ID. The problem: I can find no definition for CL_DEVI

Re: OpenCL Basic Programming Question

2014-02-17 Thread Gerriet M. Denkmann
On 14 Feb 2014, at 21:53, Gerriet M. Denkmann wrote: > I am trying to build the Basic Programming Sample in: > <https://developer.apple.com/library/mac/documentation/Performance/Conceptual/OpenCL_MacProgGuide/ExampleHelloWorld/Example_HelloWorld.html#//apple_ref/doc/uid/TP40008312-

Re: OpenCL Basic Programming Question

2014-02-15 Thread Gerriet M. Denkmann
On 15 Feb 2014, at 15:51, Uli Kusterer wrote: > On 14 Feb 2014, at 15:53, Gerriet M. Denkmann wrote: >> I am trying to build the Basic Programming Sample in: >> <https://developer.apple.com/library/mac/documentation/Performance/Conceptual/OpenCL_MacProgGuide

OpenCL Basic Programming Question

2014-02-14 Thread Gerriet M. Denkmann
I am trying to build the Basic Programming Sample in: I have myKernel.cl: __kernel void squareq( __global float*

Re: Determining available or installed RAM on iOS device?

2014-02-11 Thread Gerriet M. Denkmann
On 12 Feb 2014, at 03:00, cocoa-dev-requ...@lists.apple.com wrote: > On 11 Feb 2014, at 16:46, Jens Alfke wrote: >> [...] >> Failing that, is there at least API for determining how much RAM is >> installed on the device? This isn't reported anywhere in the Settings app, >> as far as I can tel

Re: dispatch_apply strange results

2014-02-10 Thread Gerriet M. Denkmann
On 9 Feb 2014, at 15:53, Greg Parker wrote: > On Feb 9, 2014, at 12:19 AM, Gerriet M. Denkmann wrote: >> The real app (which I am trying to optimise) has actually two loops: one is >> counting, the other one is modifying. Which seems to be good news. >> >>

Re: dispatch_apply strange results

2014-02-09 Thread Gerriet M. Denkmann
On 9 Feb 2014, at 15:53, Greg Parker wrote: > On Feb 9, 2014, at 12:19 AM, Gerriet M. Denkmann wrote: >> The real app (which I am trying to optimise) has actually two loops: one is >> counting, the other one is modifying. Which seems to be good news. >> >>

Re: dispatch_apply strange results

2014-02-09 Thread Gerriet M. Denkmann
On 9 Feb 2014, at 15:53, Greg Parker wrote: > On Feb 9, 2014, at 12:19 AM, Gerriet M. Denkmann wrote: >> The real app (which I am trying to optimise) has actually two loops: one is >> counting, the other one is modifying. Which seems to be good news. >> >>

Re: dispatch_apply strange results

2014-02-09 Thread Gerriet M. Denkmann
On 9 Feb 2014, at 14:57, Kyle Sluder wrote: > On Sat, Feb 8, 2014, at 11:35 PM, Gerriet M. Denkmann wrote: >> But using two threads takes much longer than just using one! >> How could this happen? > > Because now you've got two CPUs fighting over one cache line?

dispatch_apply strange results

2014-02-08 Thread Gerriet M. Denkmann
I am trying to optimise a Cocoa app which spends most of it's time in a for-loop looking at the bytes of a huge array. So I decided to use dispatch_apply to divide the work of the for-loop onto different cpus (I seem to have 8 of them). Note: no two threads ever share a common byte of this array

Re: Delays in awaking iOS app

2014-02-03 Thread Gerriet M. Denkmann
On 4 Feb 2014, at 01:35, Matt Neuburg wrote: > On Fri, 31 Jan 2014 15:09:37 +0700, "Gerriet M. Denkmann" > said: >> The real problem is: iOS 7 ignores the first tap (if it comes too soon >> after applicationDidBecomeActive: - "too soon" meaning: less

Re: Delays in awaking iOS app

2014-01-31 Thread Gerriet M. Denkmann
On 29 Jan 2014, at 22:02, Gerriet M. Denkmann wrote: > I have an app with a button. > I start the app, then put the iPhone to sleep. > I wake the phone up and press the button repeatedly, until something happens. > > There is an NSLog() in applicationWillEnterForeground: an

Re: What iOS device?

2014-01-30 Thread Gerriet M. Denkmann
t;hw.model" which gives less cryptic results (like "iPhone4,1" instead of "N94AP"). An official API would be better still. But this is something I can live with. Kind regards, Gerriet. > > > On Fri, Jan 31, 2014 at 1:19 AM, Gerriet M. Denkmann > wrote:

What iOS device?

2014-01-30 Thread Gerriet M. Denkmann
I want (for logging purposes only) to know the kind of iOS device being used. UIDevice model or localizedModel returns just "iPhone", but I want something like "iPhone 4s" or "iPad Air" etc. NSProcessInfo physicalMemory can be used to distinguish between some models, but not all. Then there is

Re: Delays in awaking iOS app

2014-01-29 Thread Gerriet M. Denkmann
On 30 Jan 2014, at 07:01, Rick Mann wrote: > All I can say is to write a bug. I did, regarding the Hangouts keyboard delay. I planned to do so (but was waiting for 7.1 to appear). But I might as well do it now. Done: 15941951. > > On Jan 29, 2014, at 16:00 , Gerriet M. Denkma

Re: Delays in awaking iOS app

2014-01-29 Thread Gerriet M. Denkmann
that had I seen this delay in iOS 6, I would have investigated it (as it is so annoying); which means that there was no noticeable delay before iOS 7. > > On Jan 29, 2014, at 07:02 , Gerriet M. Denkmann wrote: > >> >> I have an app with a button. >> I start the app, then p

Delays in awaking iOS app

2014-01-29 Thread Gerriet M. Denkmann
I have an app with a button. I start the app, then put the iPhone to sleep. I wake the phone up and press the button repeatedly, until something happens. There is an NSLog() in applicationWillEnterForeground: and in the action method of the button. The time difference between these two is 1.1 ..

Re: start in NSOperation

2014-01-06 Thread Gerriet M. Denkmann
On 7 Jan 2014, at 10:03, Jens Alfke wrote: > > On Jan 6, 2014, at 5:54 PM, Gerriet M. Denkmann wrote: > >>> Turn on -Woverriding-method-mismatch >> >> How to do this in Xcode? > > Add it in “Additional Warning Flags” in the build settings. O

Re: start in NSOperation

2014-01-06 Thread Gerriet M. Denkmann
On 7 Jan 2014, at 03:00, glenn andreas wrote: > > Turn on -Woverriding-method-mismatch How to do this in Xcode? Gerriet. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

start in NSOperation

2014-01-06 Thread Gerriet M. Denkmann
MyOperation is a subclass of NSOperation: #import "MyOperation.h" @interface MyOperation() @property (assign) NSUInteger start; @end @implementation MyOperation - initWithStart:(NSUInteger)s ; { self = [ super init ]; if ( self == nil ) return nil;

Re: Status Bar problem

2014-01-03 Thread Gerriet M. Denkmann
Le 3 Jan 2014 à 16:54, Roland King a écrit : >> >> But the iPad version does NOT work (status Bar overlaps): >> > > ... > >> When I Toggle In-Call Status Bar the UILayoutContainerView does not change. >> BUT: here the status bar overlaps the top of the UITableView, which looks >> rather ugl

Status Bar problem

2014-01-03 Thread Gerriet M. Denkmann
This works: MyViewController *wwc = ... self.navController = [[UINavigationController alloc] initWithRootViewController: wwc ]; self.window.rootViewController = self.navController; In the Simulator for a iPhone 3.5 I see: https://lists.apple.com/mailman/options/cocoa-dev/archive

Ugly Inspector Bar in TextView

2013-12-28 Thread Gerriet M. Denkmann
I created a new project (10.9.1, Xcode 5.0.2) not document based. Put a TextView into the window and made constraints to the 4 sides = Default. Clicked (selected) "Inspector Bar" for the TextView. Build and Run. Window shows, TextView has Inspector Bar, but the right half is obscured by some stra

Re: Should copy + paste change characters?

2013-12-27 Thread Gerriet M. Denkmann
On 27 Dec 2013, at 15:23, Ken Thomases wrote: > On Dec 27, 2013, at 2:01 AM, Gerriet M. Denkmann wrote: > >> When I have a rich text (with the font set to Heiti SC Light), which >> contains these three lines: >> >> L'œuf de volaille = 鸡卵 Note: LATIN S

Should copy + paste change characters?

2013-12-27 Thread Gerriet M. Denkmann
When I have a rich text (with the font set to Heiti SC Light), which contains these three lines: L'œuf de volaille = 鸡卵 Note: LATIN SMALL LIGATURE OE traditional: "盧" simplified: "卢" Note: CJK COMPATIBILITY IDEOGRAPH-F933 traditional: "雞" simplified: "鸡" and I select all and copy it into anothe

Re: rangeOfString behaves wierd

2013-12-09 Thread Gerriet M. Denkmann
> > On Mon, Dec 9, 2013 at 3:20 AM, Gerriet M. Denkmann > wrote: > > On 9 Dec 2013, at 16:00, Stephen J. Butler wrote: > > > I don't get the same result. 10.9.0, Xcode 5.0.2. I created an empty > > command line utility, copied the code, and I get NSNotFound. > &

Re: rangeOfString behaves wierd

2013-12-09 Thread Gerriet M. Denkmann
t;見" {3, 1} = 0x898b = "見" "见≠見" has characters: {0, 1} = 0x89c1 = "见" {1, 1} = 0x2260 = "≠" {2, 1} = 0x898b = "見" > > On Mon, Dec 9, 2013 at 2:43 AM, Gerriet M. Denkmann > wrote: > > On 9 Dec 2013, at 15:05, Quincey Morris

Re: rangeOfString behaves wierd

2013-12-09 Thread Gerriet M. Denkmann
On 9 Dec 2013, at 15:05, Quincey Morris wrote: > On Dec 8, 2013, at 23:46 , Gerriet M. Denkmann wrote: > >> NSString *b = @"见≠見";// 0x89c1 0x2260 0x898b > > So what are the results with: > >> NSString *b = @"见”; &

Re: rangeOfString behaves wierd

2013-12-09 Thread Gerriet M. Denkmann
On 9 Dec 2013, at 15:05, Quincey Morris wrote: > On Dec 8, 2013, at 23:46 , Gerriet M. Denkmann wrote: > >> NSString *b = @"见≠見";// 0x89c1 0x2260 0x898b > > So what are the results with: > >> NSString *b = @"见”; &

Re: rangeOfString behaves wierd

2013-12-09 Thread Gerriet M. Denkmann
On 9 Dec 2013, at 15:05, Quincey Morris wrote: > On Dec 8, 2013, at 23:46 , Gerriet M. Denkmann wrote: > >> NSString *b = @"见≠見";// 0x89c1 0x2260 0x898b > > So what are the results with: > >> NSString *b = @"见”; &

Re: rangeOfString behaves wierd

2013-12-09 Thread Gerriet M. Denkmann
; {1, 1} = 0x003d = "=" {2, 1} = 0xfa0a = "見" {3, 1} = 0x898b = "見" "见≠見" has characters: {0, 1} = 0x89c1 = "见" {1, 1} = 0x2260 = "≠" {2, 1} = 0x898b = "見" which shows (to my limited understanding) that there are NO composed charact

rangeOfString behaves wierd

2013-12-08 Thread Gerriet M. Denkmann
In 10.9.0, Xcode 5.0.2 I added these lines to applicationDidFinishLaunching: NSString *a = @"见=見見"; // 0x89c1 0x3d0xfa0a 0x898b NSString *b = @"见≠見"; // 0x89c1 0x2260 0x898b NSRange aRange = [ a rangeOfString: b ]; NSLog(@"%s \"%@\" (%lu shorts) occurs in \"%@\" (%lu s

Re: WebView blocks User Interface

2013-12-05 Thread Gerriet M. Denkmann
On 6 Dec 2013, at 01:24, Scott Ribe wrote: > On Dec 5, 2013, at 11:09 AM, Gerriet M. Denkmann wrote: > >> Really. But I just changed all non-european characters to German characters >> and the time changed from 53 sec to 1.2 seconds. >> >> Looks like CoreT

<    1   2   3   4   5   6   7   8   9   10   >