Date   

Re: Developer

Alex Zavatone
 

Seems like it’s a custom signed IPA.

On Oct 17, 2019, at 6:26 PM, Carl Hoefs <newslists@autonomy.caltech.edu> wrote:

Did you find out anything more about this problem? We're experiencing it too. iPhone app builds expire after 1 year, but last only a week or two on the iPad. My boss just got bitten by this at a demo.

-Carl


On Oct 6, 2019, at 2:20 AM, Gerriet M. Denkmann <gerriet@mdenkmann.de> wrote:

A friend of mine has a problem:

When he installs an app (via Xcode) on his iPhone it works fine (probably the app will expire after one year).
But when he installs the same app on his iPad, the app will expire after just one week.

What could be the reason for this behaviour?

Gerriet.







Re: Developer

Carl Hoefs
 

Did you find out anything more about this problem? We're experiencing it too. iPhone app builds expire after 1 year, but last only a week or two on the iPad. My boss just got bitten by this at a demo.

-Carl

On Oct 6, 2019, at 2:20 AM, Gerriet M. Denkmann <gerriet@mdenkmann.de> wrote:

A friend of mine has a problem:

When he installs an app (via Xcode) on his iPhone it works fine (probably the app will expire after one year).
But when he installs the same app on his iPad, the app will expire after just one week.

What could be the reason for this behaviour?

Gerriet.





Re: NSScrollView showing part of view with white space above

Graham Cox
 

One thing I find when working with scroll views is that making the contained view flipped is usually helpful. If you return YES from an override to -isFlipped, scroll views default to a position with the the scroller at the top, not the bottom. It generally makes layout and calculations in the view easier as you are working with a more conventional coordinate system. Flipping the view generally doesn’t make anything else more difficult -in fact, usually easier.

Also, just set the bounds to whatever size you need and NSScrollView will generally just figure out everything else. You don’t need to directly manipulate the scrollbars or calculate anything.

—Graham



On 14 Oct 2019, at 12:30 am, Aandi Inston via Cocoa-dev <cocoa-dev@...> wrote:

But, the vertical scroll bar position is at the BOTTOM of the window. 


UITableView selection changed at some point

Steve Mills
 

I have a UITableView that has x number of simple rows (name and image), then one row at the end that also has a name and image, but also uses a disclosure indicator accessory, which opens a new scene (I'll call it scene B) when tapped. In previous versions of iOS (currently I can only check 10.0), tapping that last row would select it, and then when returning from the scene B, it would still correctly be selected. Now in iOS 13, it no longer *appears* to be selected when I return from scene B. But, if I get the table view's indexPathForSelectedRow, it is indeed the correct row.

Is there something I need to do to fix this? I'll obviously report this bug, but I sure would like to find a hack to make it work correctly.

--
Steve Mills
Drummer, Mac geek


Developer

Gerriet M. Denkmann
 

A friend of mine has a problem:

When he installs an app (via Xcode) on his iPhone it works fine (probably the app will expire after one year).
But when he installs the same app on his iPad, the app will expire after just one week.

What could be the reason for this behaviour?

Gerriet.


Re: CMSensorRecorder.accelerometerDataSince(_:) missing?

Fritz Anderson
 

I found one reference for iOS 10:


but on inspection it’s clear it’s derived from a class dump, not the documented interface. Hence accursed for distribution.

Off to Feedback Assistant to ask that the API be exposed.

— F

On 25 Sep 2019, at 7:50 PM, Quincey Morris <quinceymorris@...> wrote:

On Sep 25, 2019, at 14:49 , Fritz Anderson <anderson.fritz@...> wrote:

Xcode 11 won’t complete the symbol; it raises an error when I try to use it anyway; and the derived interface for the class doesn’t include it.

It’s not in the Obj-C header file either. (iOS 13.0 SDK in Xcode 11) This just looks like an error in the documentation.

Perhaps this method existed for a while in the beta period for 13.0. I checked in the iOS 13.1 SDK (Xcode 11.1 beta), but it’s also not there.


Re: CMSensorRecorder.accelerometerDataSince(_:) missing?

Quincey Morris
 

On Sep 25, 2019, at 14:49 , Fritz Anderson <anderson.fritz@...> wrote:

Xcode 11 won’t complete the symbol; it raises an error when I try to use it anyway; and the derived interface for the class doesn’t include it.

It’s not in the Obj-C header file either. (iOS 13.0 SDK in Xcode 11) This just looks like an error in the documentation.

Perhaps this method existed for a while in the beta period for 13.0. I checked in the iOS 13.1 SDK (Xcode 11.1 beta), but it’s also not there.


Re: How to have users select a directory

Graham Cox
 



I’d stick with the button, because its clickability shouldn’t be in doubt.

The text field, if it’s just a label, is not generally assumed to be clickable, and if you show it as editable, that sends the message that you’re expected to type something. NSPathControl is also a good choice for displaying the path, since it deals with excessive length more intelligently than a text field, and also shows icons (optionally), which can be helpful. NSPathControl can be made an active control, but I don’t think it works very well for choosing a directory.

Also, consider the case of when no folder has been set. When an app is sandboxed, this is very often the case when your app first launches, since until you pick something you don’t have the necessary security privileges to display a path. After choosing a location, you would create a security-scoped bookmark to persist that choice, but on first run you can’t so that. So your text field will be initially blank, and only the button offers any clue that you’re expected to do something. You can of course back that up with a sheet alert that prompts you to pick a folder when that UI first appears and there’s no folder set. You should also set the placeholder text (of the text label or NSPathControl) to instruct the user to choose a folder - it will be displayed automatically when that path is empty.

Here’s all I do in one of my apps - this is a button and an NSPathControl used passively.



—Graham





On 26 Sep 2019, at 1:49 am, Gabriel Zachmann via Cocoa-dev <cocoa-dev@...> wrote:

I am looking for a nice, intuitive way to let users select a directory.

Right now, I have a simple TextField in my GUI that shows the current path,
and a simple Button next to it that says "Change".
When users click on it, it opens an NSOpenPanel that is runModal.

This works fine, but I am wondering if there are more elegant methods.
For instance, whether it might be possible to dispense with the button,
make it obvious that users can click on the text field, and then open the NSOpenPanel.

Or are there any other neat ideas?

(I was stumbling across NSPathControl, but it is not clear to me whether that would be a good alternative,
and how difficult it might be.)

Thanks a lot in advance for all kinds of insights and hints.

Best regards, Gabriel


CMSensorRecorder.accelerometerDataSince(_:) missing?

Fritz Anderson
 

Xcode 11, targeted at 13 or 12.x (no difference to this issue).

I need to accumulate accelerometer data from Core Motion over long periods of time (I’m aware of the 12-hour / 3-day limits). The class reference includes

func accelerometerDataSince(_ identifier: UInt64) -> CMSensorDataList?

which would be ideal, because you can keep the batch ID for the last records you retrieved, pass it to this func, and get only and exactly the subsequent records. No calculations or races.

Xcode 11 won’t complete the symbol; it raises an error when I try to use it anyway; and the derived interface for the class doesn’t include it.

On top of this, the Class Reference lists the function.

On top of THAT, the headword for the function is “accelerometerDataSince:” — ObjC idiom.

---


The alternative, accelerometerData(from:to:), looks error-prone. You could pass distant-past (or first-run) to “from”, and then the latest-reported timestamp from the previous fetch (plus a millisecond, the two limits are _inclusive_).

But the docs say there is a lag of up to 3 minutes between recording a record and its availability through the API: (… to: Date()) won’t get you all the data already captured. If I pass only the last-_reported_ date (plus a millisecond) to the from: in the next call, that should be fine. I’d expect the request for records in the 3-minute gap not to taint the “from” in the next request.

But I’m not paid to be optimistic.

---

Am I confined to this accelerometerData(from:to:) dance, or am I missing something? The compiler and the generated interface seem to be pretty definitive.

— F


Re: Devmate: what are people using when it disappears?

Leo
 

I was in a similar situation last year - albeit not with DevMate: had to find an alternative to eSellerate.

After a lengthy research and comparison of whatever licensing platforms I could find, I switched to SoftwareKey.com.

To me they offered the best pricing model with all features I needed.

Their customer support is also excellent.

Since, unlike me, you're using FastSpring for e-commerce, your transition should be even easier as SoftwareKey already has some kind of established integration with FastSpring.

One detail: I had a major requirement to any licensing platform: to provide a personal online license portal for the users. That is, a place where users can login at any time to manage their activations without having to contact me at all. This portal was also a major reason why I chose SoftwareKey.

If you don't have such a requirement, you may have a wider range of platforms to choose from.

In any case, switching to a different licensing platform is a major ordeal. If you have any questions let me know.


Leo

On 9/19/19 7:58 PM, Graham Cox wrote:
Is anyone out there using Devmate as a means of handling licensing in their Mac apps?

If so, you???ll know it???s deprecated as of December, and so far Fastspring, who bought out Devmate, appear not to have any real alternative.

So if this is you, what are you planning to do about it? I???d like to get some sort of discussion going so that the various alternatives are laid out and a clear forward path becomes more obvious. At the moment I???m totally unclear what to do. Fastspring say ???contact us??? if we are affected by this, but having done so, they never reply. Very poor.

???Graham




Devmate: what are people using when it disappears?

Graham Cox
 

Is anyone out there using Devmate as a means of handling licensing in their Mac apps?

If so, you’ll know it’s deprecated as of December, and so far Fastspring, who bought out Devmate, appear not to have any real alternative.

So if this is you, what are you planning to do about it? I’d like to get some sort of discussion going so that the various alternatives are laid out and a clear forward path becomes more obvious. At the moment I’m totally unclear what to do. Fastspring say “contact us” if we are affected by this, but having done so, they never reply. Very poor.

—Graham


Re: Swift definition of "_"

Dave
 

Thanks, found it now. The documentation is pretty good, a cross reference/index would be icing of the cake!

Cheers
Dave

On 17 Sep 2019, at 13:39, Bernie Maier <apple-dev@worklists.blurk.net> wrote:

On Tue, 17 Sep 2019, at 8:28 PM, Dave wrote:
Hi All,

In a definition like this:

func NSLocationInRange(_ loc: Int, _ range: NSRange) -> Bool

What does the “_” by itself mean? I can’t seem to find anywhere in the
documentation where this is mentioned? If its in there somewhere I’d
appreciate a pointer to it.
It means the corresponding function argument does not have a parameter label when **calling** the function. So you would call via something like:

NSLocationInRange(42, someRange)
This is documented in the Swift Language Guide (https://docs.swift.org/swift-book/LanguageGuide/Functions.html)

Omitting Argument Labels
If you don’t want an argument label for a parameter, write an underscore (_) instead of an explicit argument label for that parameter.

func someFunction(_ firstParameterName: Int, secondParameterName: Int) {
// In the function body, firstParameterName and secondParameterName
// refer to the argument values for the first and second parameters.
}
someFunction(1, secondParameterName: 2)
If a parameter has an argument label, the argument must be labeled when you call the function.
Cheers,
Bernie



Re: Swift definition of "_"

Bernie Maier
 

On Tue, 17 Sep 2019, at 8:28 PM, Dave wrote:
Hi All,

In a definition like this:

func NSLocationInRange(_ loc: Int, _ range: NSRange) -> Bool

What does the “_” by itself mean? I can’t seem to find anywhere in the
documentation where this is mentioned? If its in there somewhere I’d
appreciate a pointer to it.
It means the corresponding function argument does not have a parameter label when **calling** the function. So you would call via something like:

NSLocationInRange(42, someRange)
This is documented in the Swift Language Guide (https://docs.swift.org/swift-book/LanguageGuide/Functions.html)

Omitting Argument Labels
If you don’t want an argument label for a parameter, write an underscore (_) instead of an explicit argument label for that parameter.

func someFunction(_ firstParameterName: Int, secondParameterName: Int) {
// In the function body, firstParameterName and secondParameterName
// refer to the argument values for the first and second parameters.
}
someFunction(1, secondParameterName: 2)
If a parameter has an argument label, the argument must be labeled when you call the function.
Cheers,
Bernie


Swift definition of "_"

Dave
 

Hi All,

In a definition like this:

func NSLocationInRange(_ loc: Int, _ range: NSRange) -> Bool

What does the “_” by itself mean? I can’t seem to find anywhere in the documentation where this is mentioned? If its in there somewhere I’d appreciate a pointer to it.

Thanks in Advance
Dave


Re: Swizzle class property?

Shane Stanley
 

On 27 Aug 2019, at 4:51 am, Jens Alfke <jens@mooseyard.com> wrote:

Shouldn't that be "if (!didAddMethod)" ?
Thank you! It didn't occur to me because it's been working like that elsewhere for several years -- but with an instance method (and different class). Looking again, I'm not sure that class_replaceMethod() branch will ever work. I should probably just call class_addMethod(), and regardless of result call method_exchangeImplementations().

--
Shane Stanley <sstanley@myriad-com.com.au>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>


Re: Swizzle class property?

 



On Aug 25, 2019, at 6:08 PM, Shane Stanley <sstanley@...> wrote:

       if (didAddMethod) {

Shouldn't that be "if (!didAddMethod)" ?

—Jens


Swizzle class property?

Shane Stanley
 

The subject more or less says it. I tried using code similar to how I do it with instance methods, to no avail. I'm now wondering if it's actually possible. (It's a read-only property, if that makes a difference.)

+ (void)load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class theClass = [self class];

SEL originalSelector = @selector(classPropertyName); // name of original property
SEL swizzledSelector = @selector(patchedClassPropertyName); // new method

Method originalMethod = class_getClassMethod(theClass, originalSelector);
Method swizzledMethod = class_getClassMethod(theClass, swizzledSelector);

BOOL didAddMethod =
class_addMethod(theClass,
originalSelector,
method_getImplementation(swizzledMethod),
method_getTypeEncoding(swizzledMethod));

if (didAddMethod) {
class_replaceMethod(theClass,
swizzledSelector,
method_getImplementation(originalMethod),
method_getTypeEncoding(originalMethod));
} else {
method_exchangeImplementations(originalMethod, swizzledMethod);
}
});
}



--
Shane Stanley <sstanley@myriad-com.com.au>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>


NSImage/Bitmap and colorspaces

Jonathan Taylor
 

Hi all,

I have realised I’m having some subtle problems with images not being saved quite how I need them to be, and the problem seems to be caused by colorspace issues. Up until now I’ve kind of ignored the issue of colorspaces and presumed that things will behave “reasonably” if I don’t go out of my way to specify something unusual - it turns out this optimism was misplaced! I am hoping somebody can help me with understanding colorspaces just enough that I don’t inadvertently cause anything unexpected to happen. I am not concerned about pedantic photorealism on screen or on printed paper, but it is essential that I have precise control over the exact 3x8bit channel values written out to the TIFF files I am saving to disk.

At the moment I create a bitmap (specifying NSCalibratedRGBColorSpace just because that seemed like the most obvious one to use), populate it with the pixel values I want, add it to a new NSImage, call lockFocus on that NSImage, draw some annotations, and save the image as a TIFF (by passing the bitmap data to libtiff). I have realised that this pipeline is interfering with the original pixel values I set - merely calling lockFocus is enough to cause the red channel to bleed slightly into the green.

I noticed that the colorspace for the bitmap has been changed to NSDeviceRGBColorSpace by the call to lockFocus, and the pixel values have been changed (bleeding into green). If I instead create the bitmap using NSDeviceRGBColorSpace (instead of NSCalibratedRGBColorSpace) then a subsequent call to lockFocus does not seem to interfere with the pixel/channel values.

I also notice that if, instead of adding to an NSImage and drawing, I use:
    [NSGraphicsContext graphicsContextWithBitmapImageRep:theBitmap]
then there does not seem to be any problems with channel bleed-through (whichever colorspace I set for the bitmap).

So, I think my questions are:
- Can anyone point me to a basic explanation of Cocoa and colorspaces, giving me the minimal understanding I need given that I *don’t* want to do anything clever with colorspaces, I just want to “do the right things” so that nothing weird happens.
- Do both the solutions I’ve described (NSDeviceRGBColorSpace + lockFocus, and graphicsContextWithBitmapImageRep) seem like they should be robust for what I want (i.e. not messing with the exact pixel values I initially set manually in the bitmap)?
- Is one solution better than the other for any reason? I’m wondering, for example, if specifying NSDeviceRGBColorSpace from the outset would give better performance when it comes to drawing these images to a window in my program (which I also do, so optimizing performance there would be a nice secondary consideration).
- A beyond-cocoa question: in the TIFF files I output (via libtiff), I write out the colorspace information (because I figure I might as well). Does anybody happen to have any advice on whether any scientific image tools like ImageJ or commercial scientific renderers would pay any attention to the colorspace specified in the TIFF files? How important is it that I get the exact right colorspace for downstream software reading them (and if so then what is the “right” one…)?

Cheers
Jonny


Re: Trouble implementing selection property

Steve Mills
 

It turns out that if you dink around enough, sooner or later things just work right. Maybe AppleScript was keeping a cached version of my dict in memory or something, but I quit Script Debugger and cleaned & built my app many times. Then suddenly it worked.

But now I'm getting this problem. Returning some objects to a script shows them as the wrong class. Like here's the AppleEvent when I request "keyword 1 of document 1":

<NSAppleEventDescriptor: 'core'\'getd'{ '----':'obj '{ 'form':'indx', 'want':'Keyw', 'seld':1, 'from':'obj '{ 'form':'indx', 'want':'docu', 'seld':1, 'from':null() } }, &'csig':65536 }>

Looks good. Now here's the object specifier as seen in my app's log when I have NSScriptingDebugLogLevel set to 1:

Result: <NSAppleEventDescriptor: 'obj '{ 'from':'obj '{ 'from':null(), 'want':'docu', 'form':'name', 'seld':'utxt'("_Untitled") }, 'want':', 'form':'name', 'seld':'utxt'(" test picts 2") }>

Notice the malformed value for the 2nd 'want'. It should be 'want':'Keyw', but it's 'want':'

Looking at the returned object in Script Debugger shows the same thing when I view as AEPrint:

'obj '{ 'form':'name', 'want':', 'seld':'utxt'(" test picts 2"), 'from':'obj '{ 'form':'name', 'want':'docu', 'seld':'utxt'("_Untitled"), 'from':[0x0,104003f "Image Chest"] } }

And viewed as Best shows:

asset "test picts 2" of document "_Untitled"

The class should be "keyword" not "asset". Why is AppleScript being annoying?

--
Steve Mills
Drummer, Mac geek


Trouble implementing selection property

Steve Mills
 

I'm not sure what I'm doing wrong when adding a "selection" property to my document class so the user can get and set the selected assets. When I run:

tell application "Image Chest"
tell document 1
set blah to selection
set selection to blah
—>Can’t make asset 76 of document "_Untitled" into type specifier.
end tell
end tell

I've tried using both NSIndexSpecifier and NSUniqueIDSpecifier when returning the objectSpecifier for the Asset class, and they work if I do something simple like:

set blah to asset 1 of document 1
return name of blah

The selection property is structured in the sdef as:

<property name="selection" code="seld" description="The selected assets.">
<type type="asset" list="yes" />
<cocoa key="scriptableSelection" />
</property>

Do I need to override some method in some class, like indicesOfObjectsByEvaluatingObjectSpecifier:? I tried adding one of those to the Document class so I could inspect all the incoming specifiers, then returned nil so the default implementation would do the evaluation instead. It never gets called when the "set selection to blah" line is being run.

It's been a long time since I've done any serious AppleScript implementation, and that was in a huge Carbon app. So maybe I'm trying to do something that's impossible? Maybe I instead need to add a "select" verb?

--
Steve Mills
Drummer, Mac geek

381 - 400 of 1426