Re: setting Finder search input

2022-12-13 Thread Torsten Curdt via Cocoa-dev
> Is it not enough to use NSWorkspace’s showSearchResultsForQueryString?
>

I need to see what queries this allows.
(IIRC there were two different ways to specifying search queries)

But this looks perfect! I didn't realize this was available on NSWorkspace.
Thank you so much.

I'll report back when I have some more details.
But this is looking promising!

cheers,
Torsten

https://torstencurdt.com/
https://twitter.com/tcurdt
https://www.linkedin.com/in/tcurdt/

Ever had broken flip flops

?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setting Finder search input

2022-12-13 Thread Torsten Curdt via Cocoa-dev
Thanks for the help, Rob

Is it always going to be the same search?  If so, you could create a Saved
> Search in the Finder and include it with your app.  Then when you want to
> bring up the search you can open the Saved Search bundle and it will open
> in the Finder.  Hope that helps.
>

I was hoping to pass it in so that search parameters are still accessible
to the user.
Basically the same as CMD+F and entering some search parameters.
That would be the ideal solution.

But maybe a Saved Search could be a workaround.
I am quite sure it would be OK if the user could see and change the
properties of the Saved Search.

But I could not figure out how to edit a Saved Search myself yet 🙃

Is there a way to edit a Saved Search?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


setting Finder search input

2022-12-13 Thread Torsten Curdt via Cocoa-dev
I would like to open a Finder window with a pre-filled search filter and
search results - but I just cannot find a good way to do it. I tried to
find a way through the Scripting Bridge but it seems like this is not
exposed at all.

Any other suggestions?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: ITMS-90276 Missing Bundle Identifier

2019-12-13 Thread Torsten Curdt via Cocoa-dev
So I did - and it did pass the MAS review. Thanks.


On Thu, Dec 12, 2019 at 12:35 PM Shane Stanley 
wrote:

> On 12 Dec 2019, at 12:52 am, Torsten Curdt via Cocoa-dev <
> cocoa-dev@lists.apple.com> wrote:
> >
> > I am not sure - is there a better place to ask questions about
> codesigning
> > and problems with submissions to the MAS?
> >
> > I am trying to submit an app to the MAS that includes an automator
> workflow
> > in the bundle resources (Contents/SharedSupport/Examples). When uploading
> > to iTunes Connect I get an error message that the workflows is missing a
> > bundle identifier.
> >
> >  ERROR ITMS-90276: "Missing Bundle Identifier. The application bundle
> > contains a tool or framework ... that is missing the bundle identifier in
> > its Info.plist file."
> >
> > Of course I could just add this to the Info.plist - but it feels wrong to
> > modify it.
>
> Just modify it. Automator often generates illegal ones anyway.
>
> --
> Shane Stanley 
> , 
>
>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


ITMS-90276 Missing Bundle Identifier

2019-12-11 Thread Torsten Curdt via Cocoa-dev
I am not sure - is there a better place to ask questions about codesigning
and problems with submissions to the MAS?

I am trying to submit an app to the MAS that includes an automator workflow
in the bundle resources (Contents/SharedSupport/Examples). When uploading
to iTunes Connect I get an error message that the workflows is missing a
bundle identifier.

  ERROR ITMS-90276: "Missing Bundle Identifier. The application bundle
contains a tool or framework ... that is missing the bundle identifier in
its Info.plist file."

Of course I could just add this to the Info.plist - but it feels wrong to
modify it.

Any advice?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


continuity scanner

2018-11-19 Thread Torsten Curdt
So far I haven't found docs on how to use the continuity scanner in Mojave.
Is this still Apple only? Or does someone have a pointer to some
docs/examples?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Can anyone suggest an open source license for Nursery framework?

2017-10-28 Thread Torsten Curdt
I'd suggest to have a look at the Apache or MIT open source license.

cheers,
Torsten

On Sat, Oct 28, 2017 at 1:17 PM, Akifumi Takata  wrote:

> Dear all,
>
> Can anyone suggest an open source license for Nursery framework?
>
> I am not familiar with open source license.
>
> I prefer a license that can be used for both commercial and non-commercial
> use, without having to return the changes made by the user to the source
> code to the repository.
>
> Regards,
> Akifumi Takata
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/tcurdt%40vafer.org
>
> This email sent to tcu...@vafer.org
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Finalizing CVPixelBuffer while lock count is 1

2017-01-03 Thread Torsten Curdt
While doing some image processing I am also trying to detect QR codes from
an image buffer.
The following code works just fine

func captureOutput(_ captureOutput: AVCaptureOutput,
didOutputSampleBuffer sampleBuffer: CMSampleBuffer, from connection:
AVCaptureConnection) {

if !CMSampleBufferIsValid(sampleBuffer) {
return
}

let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer)! as
CVPixelBuffer
var image = CIImage(cvPixelBuffer: pixelBuffer)

...

let qrFeatures = qrDetector?.features(in: CIImage(cvImageBuffer:
pixelBuffer))
print("qr", qrFeatures ?? "nil")

if let previewView = self.previewView {
previewView.image = image
}
}


but the QR code detector is producing a warning and spamming the console.

  Finalizing CVPixelBuffer 0x17412f500 while lock count is 1.
  qr []
  Finalizing CVPixelBuffer 0x17012ed80 while lock count is 1.
  qr []
  Finalizing CVPixelBuffer 0x17012ed80 while lock count is 1.
  qr []

>From this stackoverflow post it sounds like that's a iOS10 bug.


http://stackoverflow.com/questions/35956538/how-to-read-qr-code-from-static-image/35957461

Has anyone come across this before?

It sounds like an imbalance
of CVPixelBufferLockBaseAddress/CVPixelBufferUnlockBaseAddress calls. But
calling CVPixelBufferUnlockBaseAddress myself didn't help either.

Any thoughts on fixing this?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: function signature specialization crashlog

2016-10-31 Thread Torsten Curdt
>
> If it helps, it looks like:
>
>  - you're calling a function with the signature ([Foo.Store], CLLocation?,
> CLLocation?, Bool) throws -> [Foo.Store]
>  - that function is calling another closure
>

Correct.


 - that closure is crashing
>

That I got as well.

After a lot of staring at my code I might found a possible out of bounds
error.
But this has clearly not contributed much in finding it:

  function signature specialization  of Foo.StoresViewController.(viewDidLoad () ->
()).(closure #20) (StoresViewController.swift:0)

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: function signature specialization crashlog

2016-10-31 Thread Torsten Curdt
>
> > I have a real hard time understanding this iOS/Swift3 crashlog.
>
> This is an odd list to be posting this to.  Crash logs are there for the
> developers
> of the crashing software.  If you're interested in helping fix the
> compiler, that's great,
> but you should be bringing this up on swift-dev.  If you're just trying to
> figure out how
> to get the Swift compiler to stop crashing on your code, the crash logs
> probably
> aren't going to help that much.
>

Hey John,

maybe this was misleading. It's from a crashlog from an iOS app - not the
compiler. I only tried to point out it was written in Swift3. But you might
be right and it's more a Swift question and therefor the wrong list.

My app crashed and I am trying to figure out what that crashlog means.
Given that I have no line numbers it's a bit of a guessing game.
And the error itself does not ring a bell either yet.

Maybe I should also try on the Swift IRC channel.

Thanks for that input.


> For one the closure #s do not help that very much (I just assume they
> numbered
> > from the beginning of the file?)
>
> They should be numbered from the beginning of the enclosing entity: in this
> case, the enclosing method.
>

Ah. OK. Wish I could have Xcode show me those numbers.


> and the closure line numbers are all 0.
>
> That's probably because it's implicitly-generated code.
>

Hm. What is implicit about that closure code?
I wrote it and hence it should have line numbers.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

function signature specialization crashlog

2016-10-31 Thread Torsten Curdt
I have a real hard time understanding this iOS/Swift3 crashlog. For one the
closure #s do not help that very much (I just assume they numbered from the
beginning of the file?) and the closure line numbers are all 0.

Any ideas what could be going on?

cheers,
Torsten

0   Foo  0x0001000b8e10

function signature specialization  of Foo.StoresViewController.(viewDidLoad () ->
()).(closure #20) (StoresViewController.swift:0)

1   Foo  0x0001000b8fa4

function signature specialization  of function signature
specialization  ()).(closure #20)]> of
Foo.StoresViewController.(viewDidLoad () -> ()).(closure #21)
(StoresViewController.swift:0)

2   Foo  0x0001000b2814
function signature specialization  ()).(closure #20)]> of
Foo.StoresViewController.(viewDidLoad () -> ()).(closure #21)
(StoresViewController.swift:0)

3   Foo  0x0001000bb11c

partial apply forwarder for reabstraction thunk helper from @callee_owned
(@owned [Foo.Store], @owned __ObjC.CLLocation?, @owned __ObjC.CLLocation?,
@unowned Swift.Bool) -> (@owned [Foo.Store], @error @owned Swift.Error) to
@callee_owned (@in [Foo.Store], @in __ObjC.CLLocation?, @in
__ObjC.CLLocation?, @in Swift.Bool) -> (@out [Foo.Store], @error @owned
Swift.Error) (StoresViewController.swift:0)

...
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: ITMS-90171 libswiftRemoteMirror.dylib

2016-09-25 Thread Torsten Curdt
As it turns out xcodebuild logs the actual error somewhere before and just
gives the summary at the end.
The error building the archive was a library that didn't have bitcode
enabled.

Oh well.

Still would love to understand why "build" adds the
" libswiftRemoteMirror.dylib" though.


On Sun, Sep 25, 2016 at 12:07 PM, Torsten Curdt  wrote:

> Current reading suggests that (whatever ibswiftRemoteMirror.dylib is)
> this is a difference between xcodebuild archive vs build (for whatever
> reasons). Since I can't find any further information on this I tried the
> archive approach:
>
> xcodebuild
>   -project "Foo.xcodeproj"
>   -scheme "App"
>   -configuration "Release"
>   -sdk "iphoneos10.0"
>   -archivePath "/foo/build/iphoneos10.0/Release.xcarchive"
>   archive
>   PROVISIONING_PROFILE="48d27476-3d52-45a5-9a56-798dc440f66a"
>   CODE_SIGN_IDENTITY="iPhone Distribution: Foo (L9EV9UUBV1)"
>
> unfortunately that fails with very little information
>
> ** ARCHIVE FAILED **
>
> The following build commands failed:
>   Ld /Users/tcurdt/Library/Developer/Xcode/DerivedData/Foo-
> btjldebpjrkpqcgbdqvakwjpfyim/Build/Intermediates/ArchiveIntermediates/App/
> IntermediateBuildFilesPath/Foo.build/Release-iphoneos/
> Foo.build/Objects-normal/armv7/Foo normal armv7
> (1 failure)
>
> Looking at the target for "Ld" I find
>
> ls -la /Users/tcurdt/Library/Developer/Xcode/DerivedData/Foo-
> btjldebpjrkpqcgbdqvakwjpfyim/Build/Intermediates/ArchiveIntermediates/App/
> IntermediateBuildFilesPath/Foo.build/Release-iphoneos/
> Foo.build/Objects-normal/armv7/Foo*
>
> -rw-r--r--  1 tcurdt  staff  136881 Sep 25 11:48
> [...]/Foo.build/Objects-normal/armv7/Foo-OutputFileMap.json
> -rw-r--r--  1 tcurdt  staff   26533 Sep 25 11:48
> [...]/Foo.build/Objects-normal/armv7/Foo-Swift.h
> -rw-r--r--  1 tcurdt  staff8672 Sep 25 11:48
> [...]/Foo.build/Objects-normal/armv7/Foo-master.swiftdeps
> -rw-r--r--  1 tcurdt  staff   18599 Sep 25 11:48
> [...]/Foo.build/Objects-normal/armv7/Foo.LinkFileList
> -rw-r--r--  1 tcurdt  staff 608 Sep 25 11:48
> [...]/Foo.build/Objects-normal/armv7/Foo.swiftdoc
> -rw-r--r--  1 tcurdt  staff  521816 Sep 25 11:48
> [...]/Foo.build/Objects-normal/armv7/Foo.swiftmodule
> -rw-r--r--  1 tcurdt  staff   68757 Sep 25 11:48
> [...]/Foo.build/Objects-normal/armv7/Foo_dependency_info.dat
>
> Any idea?
>
> cheers,
> Torsten
>
>
> On Sun, Sep 25, 2016 at 2:02 AM, Torsten Curdt  wrote:
>
>> I was just trying to upload an IPA to Testflight I am getting:
>>
>> ERROR ITMS-90171: "Invalid Bundle Structure - The binary file
>> 'Foo.app/libswiftRemoteMirror.dylib' is not permitted. Your app can’t
>> contain standalone executables or libraries, other than the
>> CFBundleExecutable of supported bundles. Refer to the Bundle Programming
>> Guide at https://developer.apple.com/go/?id=bundle-structure for
>> information on the iOS app bundle structure."
>>
>> What's libswiftRemoteMirror.dylib? And where is it coming from?
>>
>> Google and SO were not particularly helpful yet.
>> Any pointers would be great.
>>
>> cheers,
>> Torsten
>>
>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: ITMS-90171 libswiftRemoteMirror.dylib

2016-09-25 Thread Torsten Curdt
As for going with "build" instead of "archive" I see this in the log

builtin-swiftStdLibTool --copy --verbose --sign
99D83694482D58B0EBB9A85D9528ECC7247A7DB1
--scan-executable /project/build/iphoneos10.0/Applications/Foo.app/Foo
--scan-folder
/project/build/iphoneos10.0/Applications/Foo.app/Frameworks
--scan-folder /project/build/iphoneos10.0/Applications/Foo.app/PlugIns

--scan-folder
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/SystemConfiguration.framework
...the frameworks from the platform...

--scan-folder /project/Carthage/Build/iOS/HockeySDK.framework
...the frameworks from Carthage...

--platform iphoneos
--toolchain
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
--toolchain
/Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain
--toolchain
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
--destination
/project/build/iphoneos10.0/Applications/Foo.app/Frameworks
--strip-bitcode
--resource-destination /project/build/iphoneos10.0/Applications/Foo.app
--resource-library libswiftRemoteMirror.dylib

Besides the weird toolchain parameter (twice the default and Swift 2.3
while I am using Swift 3.0) there is "--resource-library
libswiftRemoteMirror.dylib"

Not that this makes me any wiser.


On Sun, Sep 25, 2016 at 2:02 AM, Torsten Curdt  wrote:

> I was just trying to upload an IPA to Testflight I am getting:
>
> ERROR ITMS-90171: "Invalid Bundle Structure - The binary file
> 'Foo.app/libswiftRemoteMirror.dylib' is not permitted. Your app can’t
> contain standalone executables or libraries, other than the
> CFBundleExecutable of supported bundles. Refer to the Bundle Programming
> Guide at https://developer.apple.com/go/?id=bundle-structure for
> information on the iOS app bundle structure."
>
> What's libswiftRemoteMirror.dylib? And where is it coming from?
>
> Google and SO were not particularly helpful yet.
> Any pointers would be great.
>
> cheers,
> Torsten
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: ITMS-90171 libswiftRemoteMirror.dylib

2016-09-25 Thread Torsten Curdt
Current reading suggests that (whatever ibswiftRemoteMirror.dylib is) this
is a difference between xcodebuild archive vs build (for whatever reasons).
Since I can't find any further information on this I tried the archive
approach:

xcodebuild
  -project "Foo.xcodeproj"
  -scheme "App"
  -configuration "Release"
  -sdk "iphoneos10.0"
  -archivePath "/foo/build/iphoneos10.0/Release.xcarchive"
  archive
  PROVISIONING_PROFILE="48d27476-3d52-45a5-9a56-798dc440f66a"
  CODE_SIGN_IDENTITY="iPhone Distribution: Foo (L9EV9UUBV1)"

unfortunately that fails with very little information

** ARCHIVE FAILED **

The following build commands failed:
  Ld
/Users/tcurdt/Library/Developer/Xcode/DerivedData/Foo-btjldebpjrkpqcgbdqvakwjpfyim/Build/Intermediates/ArchiveIntermediates/App/IntermediateBuildFilesPath/Foo.build/Release-iphoneos/Foo.build/Objects-normal/armv7/Foo
normal armv7
(1 failure)

Looking at the target for "Ld" I find

ls -la
/Users/tcurdt/Library/Developer/Xcode/DerivedData/Foo-btjldebpjrkpqcgbdqvakwjpfyim/Build/Intermediates/ArchiveIntermediates/App/IntermediateBuildFilesPath/Foo.build/Release-iphoneos/Foo.build/Objects-normal/armv7/Foo*

-rw-r--r--  1 tcurdt  staff  136881 Sep 25 11:48
[...]/Foo.build/Objects-normal/armv7/Foo-OutputFileMap.json
-rw-r--r--  1 tcurdt  staff   26533 Sep 25 11:48
[...]/Foo.build/Objects-normal/armv7/Foo-Swift.h
-rw-r--r--  1 tcurdt  staff8672 Sep 25 11:48
[...]/Foo.build/Objects-normal/armv7/Foo-master.swiftdeps
-rw-r--r--  1 tcurdt  staff   18599 Sep 25 11:48
[...]/Foo.build/Objects-normal/armv7/Foo.LinkFileList
-rw-r--r--  1 tcurdt  staff 608 Sep 25 11:48
[...]/Foo.build/Objects-normal/armv7/Foo.swiftdoc
-rw-r--r--  1 tcurdt  staff  521816 Sep 25 11:48
[...]/Foo.build/Objects-normal/armv7/Foo.swiftmodule
-rw-r--r--  1 tcurdt  staff   68757 Sep 25 11:48
[...]/Foo.build/Objects-normal/armv7/Foo_dependency_info.dat

Any idea?

cheers,
Torsten


On Sun, Sep 25, 2016 at 2:02 AM, Torsten Curdt  wrote:

> I was just trying to upload an IPA to Testflight I am getting:
>
> ERROR ITMS-90171: "Invalid Bundle Structure - The binary file
> 'Foo.app/libswiftRemoteMirror.dylib' is not permitted. Your app can’t
> contain standalone executables or libraries, other than the
> CFBundleExecutable of supported bundles. Refer to the Bundle Programming
> Guide at https://developer.apple.com/go/?id=bundle-structure for
> information on the iOS app bundle structure."
>
> What's libswiftRemoteMirror.dylib? And where is it coming from?
>
> Google and SO were not particularly helpful yet.
> Any pointers would be great.
>
> cheers,
> Torsten
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

ITMS-90171 libswiftRemoteMirror.dylib

2016-09-24 Thread Torsten Curdt
I was just trying to upload an IPA to Testflight I am getting:

ERROR ITMS-90171: "Invalid Bundle Structure - The binary file
'Foo.app/libswiftRemoteMirror.dylib' is not permitted. Your app can’t
contain standalone executables or libraries, other than the
CFBundleExecutable of supported bundles. Refer to the Bundle Programming
Guide at https://developer.apple.com/go/?id=bundle-structure for
information on the iOS app bundle structure."

What's libswiftRemoteMirror.dylib? And where is it coming from?

Google and SO were not particularly helpful yet.
Any pointers would be great.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: CALayer kCAGravityResizeAspectFill and kCAGravityTop

2016-09-23 Thread Torsten Curdt
>
>
> Its still an option, especially if you are otherwise using UIViews –
> UIView.maskView would do the trick.
>

Wow - I wasn't even aware that exists. Nice!

Thanks!
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: CALayer kCAGravityResizeAspectFill and kCAGravityTop

2016-09-21 Thread Torsten Curdt
>
> There isn’t an option to fill width and align top. The more general
> recommendation in this space however would be to use a UIImageView, which
> has all the same options but participates in higher level layout (including
> the content of autoResizingMasks, and also auto layout).
>

I am using the layer as a mask - so the UIImageView isn't really an option.
BUT I just found that adjusting the contentsRect to the right ratio does
the trick.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

CALayer kCAGravityResizeAspectFill and kCAGravityTop

2016-09-21 Thread Torsten Curdt
On iOS I want to fill a layer with an image.
The width should be filled and the image should retain its aspect ratio.
This

layer.contents = image.cgImage
layer.contentsGravity = kCAGravityResizeAspectFill

almost does the right thing - but it positions the image at the centers.
I would like to have it positioned at the top.

While looking at the docs for CALayer I found "autoresizingMask" but that
seems to be macOS only.

Any pointers?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: uitabbar translucency and hiding

2016-08-22 Thread Torsten Curdt
Hey Scott


> Can you elaborate further on your use case and what problem you are trying
> to solve?
>
> I would suggest you have found this difficult because a UITabBarController
> does not sound like an appropriate UI element for your use case. Specially,
> what you're describing is using a tab as an action, rather than navigation
> (or both navigation and an action), and the action of hiding the tab bar is
> one the user will not expect if they are familiar with Apple's apps, and
> other human interface guidelines (HIG) compliant apps from third parties.
>

Hm. Sounds like I might have given a wrong impression here? I don't see how
a fullscreen controller is in violation of the HIG. The challenge I am
facing is only how to get there in my app setup.

It's a tab based app. In one of the tabs there is a controller that needs
to go fullscreen at some stage. The problem is that the view controller has
a webview - so I cannot easily just re-create it and present it as a modal
view controller.

So to gain a fullscreen experience in this situation I see two possible
options (at this time of writing):

1. Hide the tab bar (The original start of this post)
2. Present a modal view controller that has the original view controller
instance as a child controller. (Untested at this stage)



> Since the tab bar view controller is a view controller container, it
> manages the frame of its child view controller's views.
>

Certainly.



> Attempts to change them manually will likely be unsuccessful as the tab
> bar controller has other ideas (compliant with Apple's HIG) of what the
> frame should be and will likely disagree with you.
>

The idea was to the hide the bar and tell the UITabBarController to do a
re-layout. It does know about the scenario of the two different content
sizes already. If you set the UITabBar translucent property at application
start the UITabController does the right thing for both cases.

So the problem could also be seen as changing the translucency of UITabBar
of a UITabBarController at runtime. Unfortunately a change of the property
does not trigger the required re-layout.


... Manually adjusting the frame of that view will only temporarily be
> successful, at best.
>

Certainly - but since the UITabBarController already knows about those two
content sizes. (translucent and non-translucent UITabBar - which is even
accessible through the appearance proxy) It should be merely a question of
re-layouting.


If you are looking for buttons to perform actions, perhaps a navigation
> controller with toolbar with bar button items is more appropriate?
>

I am not. It's a classic tab bar navigation. Just one controller wants to
go fullscreen at some stage.


As of iOS 8, toolbar and navigation bars can be hidden in an animated
> fashion to provide a full screen experience programmatically or via
> gestures, similar to that in Safari.
>

Hm. Maybe that's an option, too. But I then would really abuse a toolbar to
be a tab bar. It really is a navigation - not actions.


Since you were planning on hiding the tab bar, the lack of a selected icon
> in the toolbar might not be a problem.
>

No - I really have separate tabs.



> Instead of using a toolbar, you can subclass UINavigation controller and
> adding you own custom views to the bottom.
>

But I have multiple tabs - each have their UINavigationController. So that
doesn't sound right. Writing my own UITabBarController is of course an
option, too. But I would love to avoid that.



> At the extreme end of the spectrum, you can create a custom view
> controller container class with a set of views that specifically meet your
> needs without looking like a tab bar controller - therefore avoiding
> confusion since it would not behave like one.
>

Indeed.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: uitabbar translucency and hiding

2016-08-21 Thread Torsten Curdt
>
>
> Well, you can use a plain UIViewController as the root controller, and
> make the UITabBarController a child of that. But I don’t think that helps
> if there’s a sub-hierarchy of controllers under the tab bar controllers
> that isn’t easy to recreate when you do a segue.
>

Yeah - I don't think that will fly.


> Maybe there’s a sanctioned way of moving a child view controller to a
> different parent view controller (so, move the view controller, not the
> view), but I’m in over my head at this point.
>

That sound like an interesting approach worth checking out.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: uitabbar translucency and hiding

2016-08-21 Thread Torsten Curdt
On Sun, Aug 21, 2016 at 9:56 PM, Quincey Morris <
quinceymor...@rivergatesoftware.com> wrote:

> On Aug 21, 2016, at 12:47 , Torsten Curdt  wrote:
>
>
> Ideally I would present a modal controller
>
>
> Is there a solution where you segue from the tab view controller to a
> non-tab-view controller which has an identical view, aside from being a bit
> taller?
>

Unfortunately that view controller has a WKWebView as part of its hierarchy
- which makes just rebuilding the identical view a lot harder.

If I could have the same view instance inside two separate view controller
instances this would be totally doable.

I've even tried moving a view from one view controller instance into
another. Basically leaving a UIImageView of a snapshot in the old one. But
I couldn't get that to work properly.



> You might have to embed the tab view controller in a parent controller to
> avoid messing up its place in the navigation hierarchy. Isn’t there a segue
> that will replace an embedded child controller with another one?
>

You lost me here. Wrap the root controller (of UIWindow - which is my
UITabBarController)?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: uitabbar translucency and hiding

2016-08-21 Thread Torsten Curdt
>
> I’m no expert in iOS view controller behavior, but since no one has jumped
> in, I’ll contribute how I understand it.
>

Thanks for jumping in here, Quincey.


Hiding the tab does NOT seem like a reasonable way to approach this.
> According to the UITabBarController documentation, “You should never access
> the tab bar view of a tab bar controller directly.”
>

Darn - I didn't see that. That said there are ways through the appearance
proxy to access some of the UITabBar properties. I guess the ones exposed
are the only ones that are official usable in that context then.



> In any case, it’s the view *controller* that controls the geometry of the
> views it manages, so if the tab bar controller isn’t expecting the tab bar
> to be hidden, it likely has no way of “reclaiming” the tab bar view’s real
> estate without its own API for this.
>

I had the following idea for a work-around: Wrapping the controllers that
go into the UITabController with a UIViewController that has a child view
controller. And then I could adjust the size of the child view controller
(and thereby hopefully the whole view controller stack). But I haven't
tried this yet. I am also quite sceptical how well this works with the
UINavigationController in the mix.



> So that leads to the question of why the view controller (apparently) has
> no API for properly hiding the tab bar. That (I believe) is because you’re
> not supposed to do that. According to the HIG, tab bar controllers are
> supposed to be used only at the top level of your controller hierarchy, and
> (I believe) it’s considered undesirable for your app’s UI to undergo as a
> radical change as losing its tab bar. In general, the user has no clue how
> to get it back, and loses the ability to switch directly between the areas
> of functionality the tabs represent.
>

Well, one could say the same thing of any fullscreen view controller. Of
course there would be a way to leave the view controller. And yes - the
UITabController is a the root of the navigation.

It's more than unfortunate I have to go down the tab bar hiding route - but
at this stage there isn't really a way around it. (Ideally I would present
a modal controller - but cannot for reason beyond my control. long story)

Thanks for your input!
cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

uitabbar translucency and hiding

2016-08-20 Thread Torsten Curdt
I have an app with UITabBar und UINavigationBar(s). All are
non-translucent. So the content area of the view controllers is in between
the two. Now I would like to hide the UITabBar (on action). One would think
this would be enough:

 if let tabBar = self.tabBarController?.tabBar {
  tabBar.hidden = !visible
  }

but apparently the content area stays the same. The UITabBar hides and
leaves a big nothing behind. How can that be? What is in need to be updated?

self.view.setNeedsLayout()
self.view.setNeedsUpdateConstraints()
self.view.setNeedsDisplay()

Of the current view controller? or the navigation controller?

When you look at StackOverflow or Search people are throwing

  extendedLayoutIncludesOpaqueBars
  edgesForExtendedLayout
  layout guides

into the mix but a clear explanation or working solution seems nowhere to
be found.

Could anyone please enlighten me? I've already spent too much with trial
and error. Super frustrating.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

gesture-based and interruptible animations

2016-07-13 Thread Torsten Curdt
I have a few UIViews that I want to animate either by telling the animation
to just run or by using a gesture. Very similar to UIViewController
transitions that can be both.

It seems like iOS10 has the new UIViewPropertyAnimator for exactly doing
this now. Since iOS10 is still a few months out, question is what to use
with iOS9 (and Swift)?

The possible options I found were:

 https://github.com/marmelroy/Interpolate

 https://github.com/facebook/pop

Any pros/cons of those two?
Any other suggestions?
Or how would you do this?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

UINavigationBar transition

2016-07-13 Thread Torsten Curdt
I am pushing a new UINavigationController onto the navigation stack. But
instead of having the default transition migrating to new UIBarButtonItems
I want to animate the layout of the existing items. (at least that's how it
should look like)

Trying to explain this more visually:

Animating from

[ [textfield   ] [button] ]

to

[ > [textfield  ] ]

So I would like to
...fade out the right button
...move the textfield and adjust its size
...fade in the back button

Right now I am seeing no good way of doing this but wrapping the whole
navigation controller and then overlay a fake UINavigationBar.

But then again the animation should be interactive with the back/swipe
gesture - which adds another complication to this.

Any thoughts on how you would tackle this?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: WKWebView and Mobile Safari and cookie sharing

2016-07-09 Thread Torsten Curdt
Hm - noone?
Any idea where else to ask or read up on?

cheers,
Torsten

On Fri, Jul 8, 2016 at 11:19 AM, Torsten Curdt  wrote:

> I am finding conflicting information on this on the interwebs - and
> nothing in the docs.
>
> Is the WKWebView sharing cookies with Safari or not? My tests resulted in
> a "not sharing" but people e.g. on StackOverflow claim the opposite.
>
> What is it?
>
> cheers,
> Torsten
>
>
>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

WKWebView and Mobile Safari and cookie sharing

2016-07-08 Thread Torsten Curdt
I am finding conflicting information on this on the interwebs - and nothing
in the docs.

Is the WKWebView sharing cookies with Safari or not? My tests resulted in a
"not sharing" but people e.g. on StackOverflow claim the opposite.

What is it?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: edgesForExtendedLayout outside of loadView/viewDidLoad

2016-06-17 Thread Torsten Curdt
This is odd. This seems to eventually work

  self.edgesForExtendedLayout = UIRectEdge.None
  self.view.superview?.setNeedsUpdateConstraints()
  self.view.superview?.updateConstraintsIfNeeded()

but only after the 2nd call.

So as a work around I am calling it like this:

  self.edgesForExtendedLayout = UIRectEdge.None
  self.view.superview?.setNeedsUpdateConstraints()
  self.view.superview?.updateConstraintsIfNeeded()
  self.view.superview?.setNeedsUpdateConstraints()
  self.view.superview?.updateConstraintsIfNeeded()

I am OK for now (given it's just for testing) but I would love to
understand the "why".
cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

edgesForExtendedLayout outside of loadView/viewDidLoad

2016-06-17 Thread Torsten Curdt
 For debugging purposes I am trying to toggle "edgesForExtendedLayout"
outside of loadView/viewDidLoad - but it seems like the change goes
unnoticed.

I tried "setNeedsLayout" and "setNeedsUpdateConstraints" on the vc view -
but that does not work.

Now I am a bit stumped - how can I trigger a re-layout?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: UINavigationController back gesture animation

2016-06-15 Thread Torsten Curdt
Since I am getting nowhere with this I thought maybe at least I could know
when the animation finishes.
So I was trying it like this:

extension UINavigationController {
func pushViewController(viewController: UIViewController, animated:
Bool, completion: (Void -> Void)) {
pushViewController(viewController, animated: animated)

if let coordinator = transitionCoordinator() where animated {
coordinator.animateAlongsideTransition(nil) { _ in
completion()
}
} else {
completion()
}
}
}

...but the coordinator is just nil.

Any thoughts?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

UINavigationController back gesture animation

2016-06-14 Thread Torsten Curdt
Since iOS7 we have the back gesture to go up the navigation stack. The
gesture basically controls the push/pop animation. We can basically pick
the controller and go back and forth in the animation phases.

Does anyone see a good way to piggyback onto that?
I would like to have another animation that is also controlled by the same
gesture.

I am not really sure where to even start with this.
Any pointers and suggestions are much welcome.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Xcode user defined settings from pre-action

2016-05-10 Thread Torsten Curdt
Is there any way of passing values from a build pre-action into the user
defined settings of the project?

The only good way I found so far is to pass them to the xcodebuild command
line - that doesn't really help much when not building from the command
line though.

As a work around it seem like one could write out a xcconfig file in the
pre-action and then use that in the project. That feels quite hackish
though.

Any other options?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: WKWebView and cookies

2016-04-12 Thread Torsten Curdt
>
> Cookie headers are added later. I haven’t used WKWebView, but when using
> an NSURLSession the cookies aren’t part of the NSURLRequest, but get added
> when the request is sent.
>

Hm - but shouldn't they be available in the response at least?

I also tried to find it in the cookie storage
>NSHTTPCookieStorage.sharedHTTPCookieStorage().cookies!
>
> WKWebView runs in a separate process, which has its own cookie storage.
>

And there is no way to access that storage yet?



> What’s the higher-level goal you’re trying to achieve?
>

I want read and ideally restore a cookie that holds a website
authentication.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

WKWebView and cookies

2016-04-12 Thread Torsten Curdt
I am starting a request in a WKWebView on the iOS 9.3 simulator

let url = NSURL(string:"http://localhost:8000/";)
let req = NSMutableURLRequest(URL:url!)
webView.loadRequest(req)

and intercept the response where I try to print out the cookies

func webView(webView: WKWebView, decidePolicyForNavigationResponse
navigationResponse: WKNavigationResponse, decisionHandler:
(WKNavigationResponsePolicy) -> Void) {
if let httpResponse = navigationResponse.response as?
NSHTTPURLResponse {
if let headers = httpResponse.allHeaderFields as? [String:
String], url = httpResponse.URL {
NSLog("cookies for %@", url)
let cookies =
NSHTTPCookie.cookiesWithResponseHeaderFields(headers, forURL: url)
for cookie in cookies {
NSLog(cookie.description)
NSLog("found cookie " + cookie.name + " " +
cookie.value)
}
NSLog("cookies for %@ done", url)
}
}
decisionHandler(WKNavigationResponsePolicy.Allow)
}

The first request is to show a form - no cookies

GET /
cookies for http://localhost:8000/
cookies for http://localhost:8000/ done

The POST then triggers the backend to set one

POST /
Set-Cookie: remember=1; Max-Age=300; Path=/; Expires=Tue, 12 Apr 2016
08:56:41 GMT
cookies for http://localhost:8000/
cookies for http://localhost:8000/ done

but I still cannot see the cookie on the client.

If I now restart the app the cookie is sent

GET /
Cookie: remember=1

and the backend confirms that the cookie is set - but I still can't see it
from the WKWebView.

cookies for http://localhost:8000/
cookies for http://localhost:8000/ done

I also tried to find it in the cookie storage

NSHTTPCookieStorage.sharedHTTPCookieStorage().cookies!

but that does not seem to have it either.

After lots of reading of StackOverflow and searching the mailing list
archives I am left a bit puzzled.
What am I missing here?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Scary Stuff!

2015-06-17 Thread Torsten Curdt
Wow - and not fixed in those 6 months.
That does not sound good.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: orderFront: 10.10 vs 10.9

2015-05-08 Thread Torsten Curdt
Seems like I found the culprit.

The drawing code was throwing an exception for a font that couldn't be
found.

cheers,
Torsten

On Fri, May 8, 2015 at 4:40 PM, sqwarqDev  wrote:

> >
> > On 10.9 I am seeing
> >
> >  "unlockFocus called too many times.
>
>
>
> Can't help with the "why", but try putting
>
> [button lockFocus];
>
> in that method. Even when there isn't an explicit unlockFocus call, I've
> had this error message a couple of times and adding an explicit lockFocus
> cured it.
>
>
>
>
> Best
>
> Phil
>
> DisplayDroid beta (a lightweight script editor and automation tool) is now
> available for free download. More info on sqwarq.com/displaydroid
> OSXClock - big, beautiful alarm clock and timer for your mac. More info on
> sqwarq.com/osxclock
>
> http://applehelpwriter.com
> http://sqwarq.com - apps for OS X & iOS
>
>
>
>
>
>
>
>
>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

orderFront: 10.10 vs 10.9

2015-05-08 Thread Torsten Curdt
I am staring at this code and don't get why it works fine under 10.10 while
under 10.9 it does not.

NSScreen *screen = self.window.screen;
NSWindow *overlay = [[NSWindow alloc]
initWithContentRect:screen.frame

styleMask:NSBorderlessWindowMask

backing:NSBackingStoreBuffered
defer:NO];
self.instructionsWindow = overlay; // strong reference
overlay.opaque = NO;
overlay.ignoresMouseEvents = NO;
overlay.level = NSFloatingWindowLevel - 1;
overlay.backgroundColor = [NSColor colorWithCalibratedWhite:0.0
alpha:0.6];

InstructionsView *view = [[InstructionsView alloc]
initWithFrame:overlay.frame];

view.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
view.wantsLayer = YES;

overlay.contentView = view;
// [overlay.contentView addSubview:view];

InstructionsButton *button = [[InstructionsButton alloc]
initWithFrame:NSMakeRect(120, 45, 172, 44)];
[button setTitle:@"Done"];
[button setTarget:self];
[button setAction:@selector(actionInstructions:)];
[view addSubview:button];

NSLog(@"to front");
[overlay orderFront:nil];
// [overlay makeKeyAndOrderFront:nil];
NSLog(@"in front");

On 10.9 I am seeing

  "unlockFocus called too many times. Called on 
  Unlocking Focus on wrong view

I am getting no window and not even "in front" in the console.

The focus thing is strange, too. The code is actually generated by
PaintCode (for 10.9+) and there are no problem on 10.10.

Any pointers? I am running out of ideas.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: time of the build

2015-04-29 Thread Torsten Curdt
Thanks for the code.

It's what I meant with "converting those into a timestamp at runtime isn't
ideal" though.

Having the explicit __DATE__ in the binary as string makes it a little bit
too easy to change.

I would like to use it for expiring beta releases.

cheers,
Torsten


On Wed, Apr 29, 2015 at 3:00 PM, David Durkee  wrote:

> I’m not concerned with the time, but I get the build date as an NSDate
> with this method:
>
> - (NSDate*) buildDate
> {
> NSString* dateStr = [NSString stringWithUTF8String: __DATE__];
> NSDateFormatter* dater = [[NSDateFormatter alloc] init];
> NSLocale *enUSPOSIXLocale = [[NSLocale alloc]
> initWithLocaleIdentifier:@"en_US_POSIX"];
>
> [dater setLocale:enUSPOSIXLocale];
> [dater setDateFormat:@"MMM dd "];
> NSDate* date = [dater dateFromString: dateStr];
> return date;
> }
>
> David
>
> > On Apr 29, 2015, at 6:39 AM, Torsten Curdt  wrote:
> >
> > I would like to embed the timestamp of the build into my executable.
> >
> > I know there is __DATE__ and __TIME__ but converting those into a
> timestamp
> > at runtime isn't ideal.
> >
> > So I guess I somehow need to make the output of date +%s available to the
> > preprocessor. But user defines allow only static values aren't they?
> >
> > I am not aware that a run script phase can export anything but files.
> >
> > How would you do this?
> >
> > Hope this is not too OT as this is more Xcode/build tools related.
> > Happy to ask elsewhere if it is.
> >
> > cheers,
> > Torsten
> > ___
> >
> > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> > https://lists.apple.com/mailman/options/cocoa-dev/david%40dwdurkee.com
> >
> > This email sent to da...@dwdurkee.com
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/tcurdt%40vafer.org
>
> This email sent to tcu...@vafer.org
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

time of the build

2015-04-29 Thread Torsten Curdt
I would like to embed the timestamp of the build into my executable.

I know there is __DATE__ and __TIME__ but converting those into a timestamp
at runtime isn't ideal.

So I guess I somehow need to make the output of date +%s available to the
preprocessor. But user defines allow only static values aren't they?

I am not aware that a run script phase can export anything but files.

How would you do this?

Hope this is not too OT as this is more Xcode/build tools related.
Happy to ask elsewhere if it is.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-10 Thread Torsten Curdt
I wasn't aware that this is OK to do from a signal handler. Is it really?

On Tue, Mar 10, 2015 at 10:22 AM, 
wrote:

> Again Unix to the rescue.
>
> http://stackoverflow.com/questions/19147386/system-call-fork-and-execv-function
>
>
> Sent from my iPhone
>
> On 2015/03/10, at 18:08, Torsten Curdt  wrote:
>
>
> However the user experience is rather barren.
>
> The app simply dies.
>
>
>
> As well as posting the report ReportCrash(8) also allows informs the user
>
> of termination and allows restart.
>
> I know that prompting users twice for reporting is inelegant and confusing
>
> but crashing with no UI feedback at all is a bit mystifying - where did my
>
> app go!
>
>
>
> True. It would be better to have a custom dialog - but from a signal
> handler?
>
>
> Throwing up any sort of UI in the callback will be unreliable due to the
>
> normal re-entrant code caveats - I think the Adium code does this anyway.
>
>
>
> Where did you find that?
>
> Well, I guess a crash is a crash. So maybe unreliable ist acceptable if it
> works most of the time. After all a crash *should* be an edge case that
> does not happen too often.
>
> Maybe this could be done from another process?
>
> cheers,
> Torsten
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> https://lists.apple.com/mailman/options/cocoa-dev/dangerwillrobinsondanger%40gmail.com
>
> This email sent to dangerwillrobinsondan...@gmail.com
>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-10 Thread Torsten Curdt
>
> However the user experience is rather barren.
> The app simply dies.


> As well as posting the report ReportCrash(8) also allows informs the user
> of termination and allows restart.
> I know that prompting users twice for reporting is inelegant and confusing
> but crashing with no UI feedback at all is a bit mystifying - where did my
> app go!


True. It would be better to have a custom dialog - but from a signal
handler?


Throwing up any sort of UI in the callback will be unreliable due to the
> normal re-entrant code caveats - I think the Adium code does this anyway.
>

Where did you find that?

Well, I guess a crash is a crash. So maybe unreliable ist acceptable if it
works most of the time. After all a crash *should* be an edge case that
does not happen too often.

Maybe this could be done from another process?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Torsten Curdt
This seems to work!

void exitCallback(siginfo_t *info, ucontext_t *uap, void *context)
{
exit(-1);
}

- (void) setupCrashReporting
{
PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];

...

PLCrashReporterCallbacks callbacks;
callbacks.version = 0;
callbacks.context = NULL;
callbacks.handleSignal = exitCallback;
[crashReporter setCrashCallbacks:&callbacks];

Yay!




On Mon, Mar 9, 2015 at 9:45 PM, Torsten Curdt  wrote:

> I guess it might be worth opening bug reports for the crash reporters to
>> use "exit" if they don't.
>>
>>
>> Or just find the exit point to PLCrashReporter’s signal handler, add an
>> “exit” there, and send a patch to the developers. I can’t imagine it’d be
>> much work.
>>
>
> Touché :)
>
> Actually it seems that PLCrashReporter already has a callback.
> I guess one could use that to then just exit. Will try!
>
> cheers,
> Torsten
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Torsten Curdt
>
> I guess it might be worth opening bug reports for the crash reporters to
> use "exit" if they don't.
>
>
> Or just find the exit point to PLCrashReporter’s signal handler, add an
> “exit” there, and send a patch to the developers. I can’t imagine it’d be
> much work.
>

Touché :)

Actually it seems that PLCrashReporter already has a callback.
I guess one could use that to then just exit. Will try!

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Torsten Curdt
>
> If you read the man page for abort() it says use exit() to avoid the
> ReportCrash daemon.
>

Ah, nice. Need to try that.


Adium does this after launching their crash report helper app.
>
> How do they get there?
> Simple.
> Unix signals handling.
> Right there in the really nice Adium code you linked to.
>

True - but if you have in process crash reporter like e.g. PLCR it suddenly
isn't as easy anymore.



> You could copy and paste verbatim almost.
>

As Giacomo said - I shouldn't because the beloved GPL. But it would be easy
enough to implement anyway.

The problem really is the signal handling is already occupied.

I guess it might be worth opening bug reports for the crash reporters to
use "exit" if they don't.



> That said, if you're doing this, you should look for a way to share it to
> Apple as well. There's always a possibility they need to know something too.
>

I rather get them myself and open rdars as I seem fit.
The Apple Crash Reporter feels more like a Black Hole.



> But importantly consider your users.


That is my main concern :)

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Torsten Curdt
I could not find the prefs app


https://developer.apple.com/library/mac/technotes/tn2004/tn2123.html#FIGCRASHREPORTERPREFS

but seems like it's just a fancy way of switching the global state.

  http://cocoadev.com/HowToAvoidSendToAppleWindow

has some further suggestions.

Apparently Adium works around this

  https://hg.adium.im/adium/file/024e5177ce06/Source/AIAdium.m
  https://hg.adium.im/adium/file/024e5177ce06/Source/AICrashController.m

but I am not sure how this would work together with PLCR (or other in
process crash reporters).

Just inspecting the info.plist on a crash - wouldn't that be a smart and
easy way to handle this.

*sigh*

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

disabling Apple Crash Reporter

2015-03-07 Thread Torsten Curdt
Is there a way to disabled the Apple crash reporter dialog?

I want to use PLCrashReporter and show my UI instead.
I don't want to confuse the user by having to fill out two crash reports.

So far I only found a ways to turn if off completely:

  sudo launchctl unload -w
/System/Library/LaunchDaemons/com.apple.locate.plist
  defaults write com.apple.CrashReporter DialogType none

And in the docs I found a reference to a CrashReporterPrefs.app but that
information seems to be outdated.

Is there a way to just disable it for my app?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

checking for app store receipts

2015-02-20 Thread Torsten Curdt
Let's say I have a Mac app store app but for intermediate releases and/or
support of trial version I would like to also have version that is
distributed from my own site. So besides the app store build I would have
another build (distributed by me) that needs to know whether there is a
valid app store receipt for the app store build or not.

What I found so far:

http://stackoverflow.com/questions/4261348/mac-app-store-receipt-validation-code
http://receigen.etiemble.com/

Any further recommendations, pointers or success stories?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

movableByWindowBackground

2014-11-04 Thread Torsten Curdt
I have a NSWindow that has movableByWindowBackground set. Now I want to add
a NSImageView but have the window be draggable also at the area covered by
the view.

My first though was to override hitTest: - but that didn't seem to work.

Any pointers?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: hueComponent not valid for the NSColor

2014-11-01 Thread Torsten Curdt
> It's a color space that only contains a white and alpha component. Hue
doesn't make sense in an all white space. It's like if we were talking
about a train that only goes between NYC and DC, and you asked "How long
does it take for that train to reach London?" You can't ask that question
because the train doesn't go there. It doesn't have that degree of freedom.
>
> Your second example has white in a RGB color space. That does have the
freedom to give you hue.

Thanks for very simplified explanation :)

This works:

NSColor *base = [[NSColor whiteColor]
colorUsingColorSpace:[NSColorSpace genericRGBColorSpace]];
NSColor *stroke = [NSColor colorWithCalibratedHue:base.hueComponent

 saturation:base.saturationComponent
   brightness:0.4
alpha:base.alphaComponent];


Guess my real question is:

Why is "whiteColor" not in RGB while "redColor" is?
Just because is doesn't have to?
Don't see it in the docs either.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

hueComponent not valid for the NSColor

2014-11-01 Thread Torsten Curdt
I am struggling to understand why this causes an exception

NSColor *base = [NSColor whiteColor];
NSColor *stroke = [NSColor colorWithCalibratedHue:base.hueComponent

 saturation:base.saturationComponent
   brightness:0.4
alpha:base.alphaComponent];

 "-hueComponent not valid for the NSColor NSCalibratedWhiteColorSpace 1 1;
need to first convert colorspace."

While the following colors work OK

- [NSColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]
- [NSColor redColor]

Can anyone offer some insights?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Can an use introspection to determine if its a production app from the App Store?

2014-10-31 Thread Torsten Curdt
I just hope that was meant with a wink. If not...

Why would the library itself need to be in swift?

https://developer.apple.com/library/ios/documentation/swift/conceptual/buildingcocoaapps/MixandMatch.html

Just use it from swift.


On Thu, Oct 30, 2014 at 7:38 PM, David Hoerl  wrote:

> Looks great, but I cannot read Objective C anymore - where is the Swift
> version???
>
> On 10/30/14, 2:28 PM, Torsten Curdt wrote:
>
>> You could also inspect the provisioning profile:
>>
>> https://github.com/tcurdt/TCMobileProvision
>>
>> cheers,
>> Torsten
>>
>> On Thu, Oct 30, 2014 at 6:44 PM, David Brittain > <mailto:websi...@paperetto.com>> wrote:
>>
>> The following seems to work from experimentation...
>>
>> For an application installed through TestFlight Beta the receipt file
>> is named StoreKit\sandboxReceipt vs the usual StoreKit\receipt. Using
>> [NSBundle appStoreReceiptURL] you can look for sandboxReceipt at the
>> end of the URL.
>>
>> NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
>> NSString *receiptURLString = [receiptURL path];
>> BOOL isRunningTestFlightBeta =  ([receiptURLString
>> rangeOfString:@"sandboxReceipt"].location != NSNotFound);
>>
>> sandboxReceipt is also the name of the receipt file when running
>> builds locally.
>>
>> On Thu, Oct 30, 2014 at 10:38 AM, David Hoerl > <mailto:dho...@mac.com>> wrote:
>>  > Can an iOS app examine some property to determine if its been
>> installed as a
>>  > development style app (ie Test Flight, or Xcode, etc), or was
>> installed via
>>  > the App Store.
>>  >
>>  > [I support a library where the app is suppose to pass a flag, but
>> clients
>>  > are making errors...]
>>  >
>>  > David
>>  > ___
>>  >
>>  > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com
>> <mailto:Cocoa-dev@lists.apple.com>)
>>  >
>>  > Please do not post admin requests or moderator comments to the
>> list.
>>  > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> <http://lists.apple.com>
>>  >
>>  > Help/Unsubscribe/Update your Subscription:
>>  >
>> https://lists.apple.com/mailman/options/cocoa-dev/
>> websites%40paperetto.com
>>  >
>>  > This email sent to websi...@paperetto.com
>> <mailto:websi...@paperetto.com>
>>
>>
>>
>> --
>> David Brittain
>> da...@paperetto.com <mailto:da...@paperetto.com>
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com
>> <mailto:Cocoa-dev@lists.apple.com>)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> <http://lists.apple.com>
>>
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/tcurdt%40vafer.org
>>
>> This email sent to tcu...@vafer.org <mailto:tcu...@vafer.org>
>>
>>
>>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Can an use introspection to determine if its a production app from the App Store?

2014-10-30 Thread Torsten Curdt
You could also inspect the provisioning profile:

https://github.com/tcurdt/TCMobileProvision

cheers,
Torsten

On Thu, Oct 30, 2014 at 6:44 PM, David Brittain 
wrote:

> The following seems to work from experimentation...
>
> For an application installed through TestFlight Beta the receipt file
> is named StoreKit\sandboxReceipt vs the usual StoreKit\receipt. Using
> [NSBundle appStoreReceiptURL] you can look for sandboxReceipt at the
> end of the URL.
>
> NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
> NSString *receiptURLString = [receiptURL path];
> BOOL isRunningTestFlightBeta =  ([receiptURLString
> rangeOfString:@"sandboxReceipt"].location != NSNotFound);
>
> sandboxReceipt is also the name of the receipt file when running builds
> locally.
>
> On Thu, Oct 30, 2014 at 10:38 AM, David Hoerl  wrote:
> > Can an iOS app examine some property to determine if its been installed
> as a
> > development style app (ie Test Flight, or Xcode, etc), or was installed
> via
> > the App Store.
> >
> > [I support a library where the app is suppose to pass a flag, but clients
> > are making errors...]
> >
> > David
> > ___
> >
> > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> >
> https://lists.apple.com/mailman/options/cocoa-dev/websites%40paperetto.com
> >
> > This email sent to websi...@paperetto.com
>
>
>
> --
> David Brittain
> da...@paperetto.com
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/tcurdt%40vafer.org
>
> This email sent to tcu...@vafer.org
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: loading NSWindowController nib from bundle

2014-10-27 Thread Torsten Curdt
>
> My first thought was that passing in "nil" as the owner would actually
> default to "self" I really want - but that does not seem to be the case.
>
>
> It’s documented as “cannot be nil”.
>

Yup - and it also barfs if it is :)
Still it was my first thought and expectation.


> On the next thought
>
>controller = [self alloc];
>controller = [controller initWithWindowNibPath:nibPath
> owner:controller];
>
> seems to work - but feels like I am missing something.
>
>
> This is not a good idea. You have no guarantee that the object returned by
> ‘[self alloc]’ is the same (or even the same class as) the object returned
> by ‘[controller init…]’.
>

I know - it smells horrible. Hence my post.



> I would try something like this:
>
> MyWC* myWC = [[My WC alloc] initWithWindow: nil];
> NSWindowController* wc = [[NSWindowController alloc]
> initWithWindowNibPath: nibPath owner: myWC];
> myWC.window = wc.window;
> wc.window = nil;
>
> and then investigate whether that memory-manages the NIB objects properly.
> (That is, the transfer of ownership of the window doesn’t release the nib
> contents accidentally.)
>

Hm. Interesting - I don't see yet how that would work with the outlets yet
though.



> If that doesn’t lead to a solution, you may, in this special situation, be
> forced to use a separate class (NOT a NSWindowController subclass) as the
> NIB owner, and the actual window controller as the window owner (meaning
> its “window” property points to the window) and window delegate. For this
> to work, the auxiliary object will need to contain the outlets that would
> have been in the window controller, and it will have to implement the top
> level object lifetime management that NSWindowController does for you
> (which is documented in the NIB loading documentation, IIRC).
>

Urgh. That's sound pretty horrible, too.


My next thought was to just add

- (id) initWithMyWindowNibPath:(NSString *)nibPath
{
return [super initWithWindowNibPath:nibPath owner:self];
}

to my controller.

Too pragmatic?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

loading NSWindowController nib from bundle

2014-10-27 Thread Torsten Curdt
I am a little confused on how to load NSWindowController from a bundle
other than the mainbundle.

While this code works just fine

controller = [[self alloc] initWithWindowNibName:@"TCAboutWindow"];

I now moved the the nib into it's own bundle inside the main bundle.
Since I could not figure out a better way I tried this:

NSString *bundlePath = [[NSBundle mainBundle]
pathForResource:@"ResourceBundle"
ofType:@"bundle"];

NSString *nibPath = [[[bundlePath
   stringByAppendingPathComponent:@"Contents"]
   stringByAppendingPathComponent:@"Resources"]
   stringByAppendingPathComponent:@"TCAboutWindow.nib"];

controller = [[self alloc] initWithWindowNibPath:nibPath
owner:self];

and now I quickly realised that (for the owner) "self" in this context is
not the "self" when calling

controller = [[self alloc] initWithWindowNibName:@"TCAboutWindow"];

Now I am confused as the controller has the outlets and should be the owner.
Yet I can only pass it in to the initialiser when it doesn't even exist yet.

My first thought was that passing in "nil" as the owner would actually
default to "self" I really want - but that does not seem to be the case.

On the next thought

controller = [self alloc];
controller = [controller initWithWindowNibPath:nibPath
owner:controller];

seems to work - but feels like I am missing something.

Am I?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Color closest to color

2014-06-17 Thread Torsten Curdt
RGB is not perceptually uniform, hence the Euclidean distance is not quite
right.
Wikipedia and Stackoverflow has more information on this:

http://en.wikipedia.org/wiki/Color_difference
http://stackoverflow.com/questions/9018016/how-to-compare-two-colors

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: UITableView's tableFooterView and autolayout

2014-06-11 Thread Torsten Curdt
Meh. Then I hope for a huge number of radars because this makes it
feel a little half baked - to put it nicely.
Feels like a strange oversight given how Apple is pushing autolayout.

Thanks for the responses guys.

cheers,
Torsten

On Wed, Jun 11, 2014 at 8:23 PM, Luke Hiesterman  wrote:
> You have to set the frame yourself (before assigning to the 
> tableView.tableFooterView) property. You can use autolayout and 
> systemSizeFittingSize to get the appropriate size, but you have to apply it 
> yourself.
>
> Luke
>
> On Jun 11, 2014, at 11:16 AM, Torsten Curdt  wrote:
>
>> My question really isn't about positioning.
>>
>> Given that the tableview scrolls vertically the width should give the
>> horizontal width constraint for the footer view. The height of the
>> footer should come from the intrinsic size of the footer view. At
>> least that's how I image it should work.
>>
>> Now the question is if that's possible or not. And if not - how people
>> are dealing with this.
>>
>> Thanks for your solution, Sebastian!
>>
>> ...but the question is whether this is possible without manually
>> adjusting the frame.
>>
>> cheers,
>> Torsten
>>
>>
>>
>> On Wed, Jun 11, 2014 at 6:21 PM, Sebastian Celis
>>  wrote:
>>> On Jun 11, 2014, at 9:41 AM, Torsten Curdt  wrote:
>>>
>>>> Thanks but there you are setting the frame yourself. The idea was to
>>>> use constraints. Usually you would pin them to the superview. But in
>>>> this case...
>>>
>>> My solution uses Auto Layout constraints to get the appropriate size for 
>>> the header view using systemLayoutSizeFittingSize. Given how UITableViews 
>>> work when coupled with Auto Layout I believe you do have to set the frame 
>>> yourself but you can determine what the frame should be using Auto Layout 
>>> constraints.
>>>
>>> You can not use Auto Layout to *position* the header or footer view, but 
>>> you can use Auto Layout to layout any views within that header or footer. 
>>> If I understand your original situation, you probably want to use a UIView 
>>> container for your label and then position that label within its container 
>>> using Auto Layout.
>>>
>>> - Sebastian
>>>
>>
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com
>>
>> This email sent to luket...@apple.com
>

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: UITableView's tableFooterView and autolayout

2014-06-11 Thread Torsten Curdt
My question really isn't about positioning.

Given that the tableview scrolls vertically the width should give the
horizontal width constraint for the footer view. The height of the
footer should come from the intrinsic size of the footer view. At
least that's how I image it should work.

Now the question is if that's possible or not. And if not - how people
are dealing with this.

Thanks for your solution, Sebastian!

...but the question is whether this is possible without manually
adjusting the frame.

cheers,
Torsten



On Wed, Jun 11, 2014 at 6:21 PM, Sebastian Celis
 wrote:
> On Jun 11, 2014, at 9:41 AM, Torsten Curdt  wrote:
>
>> Thanks but there you are setting the frame yourself. The idea was to
>> use constraints. Usually you would pin them to the superview. But in
>> this case...
>
> My solution uses Auto Layout constraints to get the appropriate size for the 
> header view using systemLayoutSizeFittingSize. Given how UITableViews work 
> when coupled with Auto Layout I believe you do have to set the frame yourself 
> but you can determine what the frame should be using Auto Layout constraints.
>
> You can not use Auto Layout to *position* the header or footer view, but you 
> can use Auto Layout to layout any views within that header or footer. If I 
> understand your original situation, you probably want to use a UIView 
> container for your label and then position that label within its container 
> using Auto Layout.
>
> - Sebastian
>

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: UITableView's tableFooterView and autolayout

2014-06-11 Thread Torsten Curdt
Thanks but there you are setting the frame yourself. The idea was to
use constraints. Usually you would pin them to the superview. But in
this case...

I tried assigning the footer view and then assigning the constraints
to the super view. It just did not yield the expected results.

cheers,
Torsten

On Wed, Jun 11, 2014 at 3:56 PM, Sebastian Celis
 wrote:
> Hi Torsten,
>
> On Jun 11, 2014, at 6:26 AM, Torsten Curdt  wrote:
>
> So what's the story with tableFooterView and tableHeaderView and
> autolayout? I am trying to put a label into a footer.
>
>
> I have had luck with code like the following:
>
> - (void)viewDidLoad
> {
> [super viewDidLoad];
>
> self.headerView = [[MyView alloc] initWithFrame:CGRectZero];
> }
>
> - (void)viewDidLayoutSubviews
> {
> [super viewDidLayoutSubviews];
>
> CGRect frame = CGRectZero;
> frame.size.width = self.tableView.bounds.size.width;
> frame.size.height = [self.headerView
> systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
> if (self.tableView.tableHeaderView != self.headerView ||
> !CGRectEqualToRect(frame, self.headerView.frame))
> {
> self.headerView.frame = frame;
> [self.headerView layoutIfNeeded];
> self.tableView.tableHeaderView = self.headerView;
> }
> }
>
> - Sebastian
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

UITableView's tableFooterView and autolayout

2014-06-11 Thread Torsten Curdt
So what's the story with tableFooterView and tableHeaderView and
autolayout? I am trying to put a label into a footer.

No problem if I give the label a frame but with the promise of
autolayout this should not be necessary - I thought. I cannot really
set any constraints referring to the super view in this case, but I
thought the intrinsic content size should be good enough to size the
footer view. Apparently it's not.

Could someone clear up how this is supposed to work these days?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: not debuggable?

2014-06-10 Thread Torsten Curdt
Indeed it's a *throw* breakpoint. The queueing is good point.
In the end I was so desperate that I restarted the iPhone - that fixed it.

Scary!

But thanks for your help.

On Tue, Jun 10, 2014 at 2:26 PM, Uli Kusterer
 wrote:
>
> On 10 Jun 2014, at 11:47, Torsten Curdt  wrote:
>
>> I got this iOS project where I access the calendar - and I am
>> completely baffled.
>>
>>[store requestAccessToEntityType:EKEntityTypeEvent
>> completion:^(BOOL granted, NSError *accessError) {
>>if (granted) {
>>
>>NSString *calendarIdentifier = [[NSUserDefaults
>> standardUserDefaults] valueForKey:kCalendarIdentifier];
>>
>>EKCalendar *calendar;
>>
>>NSLog(@"calendarIdentifier: %@", calendarIdentifier);
>>
>>if (calendarIdentifier) {
>>calendar = [store calendarWithIdentifier:calendarIdentifier];
>>}
>>
>>NSLog(@"calendar: %@", calendar);
>>
>>
>> When running on the device I only see
>>
>>  calendarIdentifier: ...
>>
>> The next line never shows!
>>
>>  calendar: ...
>>
>> I don't see how that is even possible.
>>
>> So I try the debugger. The debugger should catch all exceptions and I
>> set a breakpoint to step through. But when I step over
>> "calendarWithIdentifier:" it just continues(!) the app and also never
>> reaches the second log line!
>>
>> Whaaat!?
>>
>> Anyone a clue what could be going wrong here? ...or what else to try?
>
>  You've set a *throw* breakpoint, not a *catch* breakpoint, right? Because in 
> this case the block is probably queued somewhere and there's nobody ever 
> catching the exception. Have you tried wrapping the block's contents in an 
> @try? The exception throw breakpoint *should* catch it, but maybe that helps 
> things?
>
> Cheers,
> -- Uli Kusterer
> "The Witnesses of TeachText are everywhere..."
> http://www.zathras.de
>

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

not debuggable?

2014-06-10 Thread Torsten Curdt
I got this iOS project where I access the calendar - and I am
completely baffled.

[store requestAccessToEntityType:EKEntityTypeEvent
completion:^(BOOL granted, NSError *accessError) {
if (granted) {

NSString *calendarIdentifier = [[NSUserDefaults
standardUserDefaults] valueForKey:kCalendarIdentifier];

EKCalendar *calendar;

NSLog(@"calendarIdentifier: %@", calendarIdentifier);

if (calendarIdentifier) {
calendar = [store calendarWithIdentifier:calendarIdentifier];
}

NSLog(@"calendar: %@", calendar);


When running on the device I only see

  calendarIdentifier: ...

The next line never shows!

  calendar: ...

I don't see how that is even possible.

So I try the debugger. The debugger should catch all exceptions and I
set a breakpoint to step through. But when I step over
"calendarWithIdentifier:" it just continues(!) the app and also never
reaches the second log line!

Whaaat!?

Anyone a clue what could be going wrong here? ...or what else to try?


cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: universal app - with iPad disabled

2014-06-03 Thread Torsten Curdt
Thanks folks!

On Sun, Jun 1, 2014 at 2:08 AM, Roland King  wrote:
> It's right there on the deployment info tab of the app. 'Devices: 
> Universal/iPhone/iPad'
>
>
> On 1 Jun, 2014, at 4:11 am, Torsten Curdt  wrote:
>
>> I know it sounds strange at first - but...
>>
>> I am working on an universal app. I would like to release the iPhone
>> version first - before it's optimized for the iPad. It's already setup
>> as universal project though.
>>
>> Now I am wondering: Is there an easy way to turn that project into an
>> iPhone project for the release and in a few months time then release
>> it as universal?
>>
>> Where/how is universal defined? Do I maybe just have to remove
>> "UIMainStoryboardFile~ipad" from the Info.plist? Or is there more to
>> it?
>>
>> Any experiences with that?
>>
>> cheers,
>> Torsten
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
>>
>> This email sent to r...@rols.org
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

universal app - with iPad disabled

2014-05-31 Thread Torsten Curdt
I know it sounds strange at first - but...

I am working on an universal app. I would like to release the iPhone
version first - before it's optimized for the iPad. It's already setup
as universal project though.

Now I am wondering: Is there an easy way to turn that project into an
iPhone project for the release and in a few months time then release
it as universal?

Where/how is universal defined? Do I maybe just have to remove
"UIMainStoryboardFile~ipad" from the Info.plist? Or is there more to
it?

Any experiences with that?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: UICollectionViewCell and UIScrollView and autolayout

2014-05-26 Thread Torsten Curdt
Ah - so that was the `UICollectionViewFlowLayout` that did that (if
understand you correctly)?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: UICollectionViewCell and UIScrollView and autolayout

2014-05-26 Thread Torsten Curdt
I am not assigning a frame - but I am indeed assigning constraints to
the subviews of the UICollectionViewCell's content view:

https://github.com/tcurdt/paging-and-zooming/blob/master/Paging/TCPagingView.m#L17

That is not supported?

cheers,
Torsten

On Mon, May 26, 2014 at 5:59 PM, Luke Hiesterman  wrote:
> Why is autolayout assigning a frame to the cell? Are you putting autolayout
> constraints on your cell? If so, shouldn’t be. The collection view assigns
> the cell’s frame (according to the wishes of the assigned
> collectionViewLayout). Setting the frame yourself, either by calling
> -setFrame or something that will affect frame on your behalf, such as using
> autolayout constraints, or autoresizing masks on the cell is unsupported.
>
> Luke
>
> On May 26, 2014, at 8:00 AM, Torsten Curdt  wrote:
>
> autolayout has assigned a frame to the cell
>
>

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: UICollectionViewCell and UIScrollView and autolayout

2014-05-26 Thread Torsten Curdt
OK, so it seems I explicitly need to call

[cell setNeedsLayout];
[cell layoutIfNeeded];

after the cell is configured.

I didn't think the `layoutIfNeeded` was necessary. That's a bit of a surprise.

The centering of the `UIScrollView` is still a bit funky though.
Based on the `contentOffset` it works - except for the weird jumping on release.

The `contentInset` approach does not work until you zoom.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

UICollectionViewCell and UIScrollView and autolayout

2014-05-26 Thread Torsten Curdt
I've built a little demo project where I am struggling with autolayout.

  https://github.com/tcurdt/paging-and-zooming

I basically have a fullscreen collection view to page through some
scroll views that allow zooming into an image.

When the UICollectionViewCells are being configured

  
https://github.com/tcurdt/paging-and-zooming/blob/master/Paging/TCPagingView.m#L159

autolayout has assigned a frame to the cell. But somehow the
UIScrollView is still at CGRectZero ...and somehow I cannot convince
autolayout to assign the proper frame.

Oddly enough it still show the image though - I just cannot center the
scroll view.

My head hurts. If someone with some more autolayout experience could
share some wise word - that would be awesome.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

paging and zooming

2014-05-23 Thread Torsten Curdt
Wasn't there a new class introduced into UIKit that should further
simplify the famous PhotoScroller example?

I need to page through a couple of images and support pinch and zoom
(no tiling though).

Could do it the old way but somewhere in the back of my head it says
there is a new way.

Is there?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: debugging unrecognized selector

2014-05-16 Thread Torsten Curdt
> the debugger only stops in UIApplicationMain.
>
> That’s most likely because your “level of detail” slider (the horizontal
> slider below the call stack in the Debug pane) isn’t at the extreme right
> end.

OMG! There is slider!? That's a revelation. Thanks!


> The last 2 won’t help. NSString doesn’t have such a method, so the
> breakpoints will never trigger. (You’ve effectively set a breakpoint on a
> global symbol that doesn’t exist.)

Ah, OK I thought it wouldn't matter whether the selector exists for
the debugger to catch it.

Thanks, guys!

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

debugging unrecognized selector

2014-05-16 Thread Torsten Curdt
I am seeing a crash in an iOS app and while I can reproduce it I am
still struggling to find the location in my code because the debugger
only stops in UIApplicationMain. What I am seeing in the log is

2014-05-16 09:46:56.796 MyApp[30998:60b] -[__NSCFString CGColor]:
unrecognized selector sent to instance 0x10debb640

Checking the address with `po` I can see the string. But it still did
not help to find where this happens. I added the following
breakpoints:

* All Exceptions
* -[__NSCFString CGColor]
* -[NSString CGColor]

but the CGColor breakpoints are not catching this. Why not?
How would you track this down?


I hope this is not too OT. If it is please let me know where to ask instead.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Unbalanced calls to begin/end appearance transitions for UIViewController

2014-04-24 Thread Torsten Curdt
> Try it again without this addSubview call.

I totally missed that
"transitionFromViewController:toViewController:duration:options:animations:completion:"
also adds the view!

Thanks you so much! Problem solved.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Unbalanced calls to begin/end appearance transitions for UIViewController

2014-04-24 Thread Torsten Curdt
Based on the Apple documentation I came up with the following method
to switch between controllers in a containment controller.

But when there is an oldC I am getting "Unbalanced calls to begin/end
appearance transitions for <...>" on the console.

- (void) showController:(UIViewController*)newC
withView:(UIView*)contentView animated:(BOOL)animated
{
UIViewController *oldC = self.childViewControllers.firstObject;
if (oldC == newC) {
return;
}

[oldC willMoveToParentViewController:nil];

[self addChildViewController:newC];
newC.view.frame = (CGRect){ 0, 0, contentView.frame.size };
[contentView addSubview:newC.view];

if (animated && oldC != nil) {
oldC.view.alpha = 1.0f;
newC.view.alpha = 0.0f;
[self transitionFromViewController:oldC toViewController:newC
duration:0.25f options:0 animations:^{

oldC.view.alpha = 0.0f;
newC.view.alpha = 1.0f;

 } completion:^(BOOL finished) {
[oldC removeFromParentViewController];
[newC didMoveToParentViewController:self];
 }];
} else {
oldC.view.alpha = 0.0f;
newC.view.alpha = 1.0f;
[oldC removeFromParentViewController];
[newC didMoveToParentViewController:self];
}
}

This is how I call it:

- (IBAction) buttonSignIn:(id)sender
{
[self showController:self.signInViewController
withView:self.contentView animated:(sender != nil)];
}

- (IBAction) buttonSignUp:(id)sender
{
[self showController:self.signUpViewController
withView:self.contentView animated:(sender != nil)];
}

To track this down I am logging the appearance transitions

-(void)beginAppearanceTransition:(BOOL)isAppearing animated:(BOOL)animated
{
[super beginAppearanceTransition:isAppearing animated:animated];
NSLog(@"**begin %@", self);
}

-(void)endAppearanceTransition
{
[super endAppearanceTransition];
NSLog(@"**end** %@", self);
}

This is what the log looks like:

] **begin 
] **begin 
] Unbalanced calls to begin/end appearance transitions for
.
] **end** 
] **end** 

Now I am a little puzzled. What's the problem here?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: accessing values along NSIndexPath

2014-03-26 Thread Torsten Curdt
From the docs it sounds pretty standard:

https://developer.apple.com/library/mac/documentation/cocoa/Reference/Foundation/Classes/NSIndexPath_Class/Reference/Reference.html#//apple_ref/occ/cl/NSIndexPath

strange - but fair enough.

cheers,
Torsten

On Wed, Mar 26, 2014 at 10:26 PM, Jens Alfke  wrote:
>
> On Mar 26, 2014, at 1:14 PM, Torsten Curdt  wrote:
>
> There is really no other way?
>
>
> Yes, if you’ve got a custom data model, then you’ll need to write custom
> code to navigate it with an index-path.
> NSArrays-of-NSArrays aren’t really in common use in Cocoa, so they count as
> a custom data model IMHO.
>
> —Jens

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: accessing values along NSIndexPath

2014-03-26 Thread Torsten Curdt
Going through a NSTreeController feels like cracking a nut with a sledge-hammer.
Then I would rather roll my own.

There is really no other way?

On Wed, Mar 26, 2014 at 8:56 PM, Lee Ann Rucker  wrote:
> First you need a NSTreeController to manage your NSArray, then:
>
>NSTreeNode *topNode = [treeController arrangedObjects];
>return [topNode descendantNodeAtIndexPath:indexPath];
>
>
> On Mar 26, 2014, at 12:02 PM, Torsten Curdt wrote:
>
> The Apple docs state:
>
> "The NSIndexPath class represents the path to a specific node in a
> tree of nested array collections"
>
> I can't find how to use the index path to access the tree though.
> It should be something along the lines of:
>
>  NSIndexPath *indexPath = ...
>  NSArray *nestedArrays = ...
>  id obj = [nestedArrays objectByIndexPath:indexPath];
>
> but I just cannot seem to find the right selector for this.
>
> I could easily implement this myself - but there must be something
> like this already!? No?
>
> cheers,
> Torsten
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://urldefense.proofpoint.com/v1/url?u=https://lists.apple.com/mailman/options/cocoa-dev/lrucker%2540vmware.com&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=yJFJhaNnTZDfFSSz1U9TSNMmxGyib3KjZGuKfIhHLxA%3D%0A&m=CXRx5m4gvxOtLBk%2FKvoQ8oAikjCpYgRgvp64DRbHvuI%3D%0A&s=9326e7b9181f48fbf3ff31e51a62abdb32ca57642e025ca6cdf8e8e255bd8286
>
> This email sent to lruc...@vmware.com
>
>

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

accessing values along NSIndexPath

2014-03-26 Thread Torsten Curdt
The Apple docs state:

"The NSIndexPath class represents the path to a specific node in a
tree of nested array collections"

I can't find how to use the index path to access the tree though.
It should be something along the lines of:

  NSIndexPath *indexPath = ...
  NSArray *nestedArrays = ...
  id obj = [nestedArrays objectByIndexPath:indexPath];

but I just cannot seem to find the right selector for this.

I could easily implement this myself - but there must be something
like this already!? No?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: information about provisioning and code signing - in code

2014-03-06 Thread Torsten Curdt
To answer my own question with some code:

  https://github.com/tcurdt/TCMobileProvision

Let's you access the embedded provisioning profile at runtime.

cheers,
Torsten

On Thu, Feb 27, 2014 at 12:46 PM, Torsten Curdt  wrote:
> Hey there,
>
> I know on 10.6+ you can use "SecStaticCodeCreateWithPath" and friends
> to verify the app signature in code.
>
> Is there also a way on iOS to somehow access information about things
> like provisioning profile/certificate from within the app?
>
> Ideally I would like to get access to the provisioning profile's uuid
> from within the app.
>
> Any pointers?
>
> cheers,
> Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

information about provisioning and code signing - in code

2014-02-27 Thread Torsten Curdt
Hey there,

I know on 10.6+ you can use "SecStaticCodeCreateWithPath" and friends
to verify the app signature in code.

Is there also a way on iOS to somehow access information about things
like provisioning profile/certificate from within the app?

Ideally I would like to get access to the provisioning profile's uuid
from within the app.

Any pointers?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: UILabel's sizeToFit - only on re-used cells

2014-01-15 Thread Torsten Curdt
>
> The size of the cell you get from dequeueReusableCellWithIdentifier is
> meaningless until the cell gets added to the table view, which doesn’t
> happen until you return the cell from the delegate method you’re in.
>

Not sure I understand why the cell size matters though. All views/labels
have a size given through IB. With also the font size given - I find it a
bit odd that 'sizeToFit' does not work correctly in
'tableView:cellForRowAtIndexPath:'

So do you always just create the cell in tableView:cellForRowAtIndexPath:
and then to do filling and styling in
‘tableView:willDisplayCell:forRowAtIndexPath:' ?


> One solution is to manually resize the cell (you probably care only about
> the width?) before returning it. Another is to resize the label later,
> after the cell is added to the table. (IIRC, the delegate method
> ‘tableView:willDisplayCell:forRowAtIndexPath:; was where I did it.) Yet
> another is to use auto layout to resize the label.
>

Indeed that fixes it. Amazing.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

UILabel's sizeToFit - only on re-used cells

2014-01-14 Thread Torsten Curdt
I am seeing a weird behavior and I have hard time tracking down what's
going on. Any suggestion on how to pinpoint the problem would be great. I
am running out of ideas.

I have UITableView where I dequeue the cells.

MyCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyCell"];

I then setup the cell

cell.myLabel.text = @"test";
cell.myLabel.textColor = [UIColor blackColor];

and resize the label to use the proper space for the content

[cell.myLabel sizeToFit];

Unfortunately `sizeToFit` seems to work only for the re-used cells. So when
I scroll them off screen, the cells coming back on screen are looking fine.
The initial cells don't - they have the labels at their initial size given
in interface builder.

I tried by setting "numberOfLines" or setting a larger frame to shrink from
but I cannot seem to get this to work. It's almost like the first
"sizeToFit" call gets ignored.

Any idea what could be going on?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: repeating timer with "run now"

2013-08-22 Thread Torsten Curdt
> Why not just keeping a reference on your scheduled block and simply call 
> dispatch_async when you want to execute it immediately ?

It would not re-schedule the timer. So the block could potentially be
run twice without much of the desired delay in between.

The logic should be something along the lines of

  def run_now
invalidate timer (if there is one running)
run block
schedule timer to run block in x seconds
  end

Just to explain the desire behaviour.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

repeating timer with "run now"

2013-08-22 Thread Torsten Curdt
I have some piece of code that I want to run every x seconds but I
also want to be able to trigger a "run now" that will reset the
upcoming cycle.

I think I would know plenty of ways to implement this (ranging from
simple NSTimer to select() style signaling to threading with
conditions) but I am looking for the most elegant way - preferably
with GCD.

Scheduling a block is easy with GCD - but can you also notify that
block for immediate execution later on?

Just would love to hear opinions on how you would tackle this
admittedly easy problem the most elegant way.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: rate limiting calls

2013-05-28 Thread Torsten Curdt
> Hm - this does not seem to work and I cannot see why not.
>
> The cancel and perform selector calls are being called but updateValue
> is only performed when I release the slider handle.
> I don't quite get why.

Would still be eager to know why but a GCD implementation was super
simple and works.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: rate limiting calls

2013-05-28 Thread Torsten Curdt
kSliderDelay = 0.0

> -(void)setValue:(NSObject*)value
> {
> self.value = value;
>
> [NSObject
> cancelPreviousPerformRequestsWithTarget:self
> selector:@selector(updateValue)
> object:nil];
>
> [self performSelector:@selector(updateValue)
> withObject:nil];
> afterDelay:kSliderDelay];
> }
>
> -(void)update
> {
> // slow update from self.value
> }

Hm - this does not seem to work and I cannot see why not.

The cancel and perform selector calls are being called but updateValue
is only performed when I release the slider handle.
I don't quite get why.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: rate limiting calls

2013-05-28 Thread Torsten Curdt
Hey John,

thanks for the pointer. I used a similar pattern before but at that
time it was just a selector without parameter. AFAIU
cancelPreviousPerformRequestsWithTarget:selector:object will match the
object parameter to see what to cancel. (and nil is not a match-all).
Since here the parameter is changing it didn't feel like the right way
to go but...

On the other hand maybe I could just store away the value and the use
the same pattern for updates. Along the lines of

-(void)setValue:(NSObject*)value
{
self.value = value;

[NSObject
cancelPreviousPerformRequestsWithTarget:self
selector:@selector(updateValue)
object:nil];

[self performSelector:@selector(updateValue)
withObject:nil];
afterDelay:kSliderDelay];
}

-(void)update
{
// slow update from self.value
}

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: rate limiting calls

2013-05-28 Thread Torsten Curdt
> Quick question: how often are you calling setValue:? Every time it changes
> or is it inside an NSTimer/CADisplayLink?

Every time the user moves the slider.

> Can you give us more information on this particular flow?

If I execute the "setValue:" on each value change of the slider the UI
feels too slow.

What I currently have in mind is to just store the latest value. Then
enqueue "update" calls in an async queue and in the update blocks only
perform the update if the value is different from the previous/current
one.
Any easier or more elegant way you could think of?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


rate limiting calls

2013-05-28 Thread Torsten Curdt
I am getting a lot of calls to a selector "setValue:" from a slider
control - but setting this value takes an considerable amount of time.

In order to keep the UI responsive I need to rate limit the actual
calls or move the value setting into an async background queue.
While the queue sounds like the most easiest way around this, queuing
the calls isn't really what I need either as only the last recent
value in the queue is of interest.

Right now I am not sure how to tackle this best yet.
Any thoughts?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: ^Block statement considered harmful for callbacks?

2013-04-25 Thread Torsten Curdt
> MyWeakRef *weakRef = [MyWeakRef weakRefFromObject:self];
>
> ^() = {
>   Foo *wself = [weakRef originalObject];
>   // wself may be nil, that's cool because we only want to doStuff if 'self' 
> is still around.
>   [wself doStuff];
> }

How is that different from

  __typeof__(self) __weak wself = self;
  ^() = {
[wself doStuff];
  }

...or am I missing something from the beginning of the thread?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Understanding NSTask

2013-04-10 Thread Torsten Curdt
> Torsten Curdt!  Coincidentally, I've been studying your asynctask.m for the 
> last day, and just pushed to my github an updated (ARC, etc.) NSTask wrapper, 
> based on it…
>
> https://github.com/jerrykrinock/ClassesObjC/blob/master/SSYTasker.h

Nice :)

Glad the old code was useful and got updated.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Understanding NSTask

2013-04-08 Thread Torsten Curdt
Not sure how your code looks like but a common problem is that the
stdout and stderr buffer can run full if not done correctly.

Old code but something along the lines of this here should work

https://github.com/tcurdt/uif2iso4mac/blob/master/Sources/TaskCommand.m

cheers,
Torsten

On Mon, Apr 8, 2013 at 1:59 PM, Rui Henriques Pacheco
 wrote:
> Hi,
>
> I'm currently going through all available literature on Google on using 
> NSTask to open SSH tunnels. While I have running code I'm not sure I 
> understand everything that's happening.
>
> First, NSTask executes SSH as a subprocess. Then why is this blocking the 
> main thread?
>
> --
> Rui Henriques Pacheco
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/tcurdt%40vafer.org
>
> This email sent to tcu...@vafer.org
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: unwind custom segue and uinavigationcontroller

2013-03-22 Thread Torsten Curdt
> I know quite a lot about segue unwinding. See my book for lots of info:
>
> http://www.apeth.com/iOSBook/ch19.html#_unwind_segues

Wow - that's the first proper write up I've read. Thanks!

>>Now the is the question how do I tell the navigation controller to use
>>my custom segue when popping back?
>
> Oh. So your question is *not* actually about segue unwinding. That's 
> disappointing. :)
>
> Seriously, this is not a segue question or an unwind question.

Why not? Just because it's just one level?

> The back button is the back button; it goes back. That's what it does. It 
> only does one thing, because it belongs to the back item (the 
> UIViewController *under* the top view controller in the stack).

A custom segue is used for push - so also a custom segue should be used for pop.
I would think that's a common expectation.

> If you want a button in the UINavigationBar to do something other than "go 
> back", don't use a back button.

I should just go back. I don't want to change that.
It's just about the "how" - the animation.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


unwind custom segue and uinavigationcontroller

2013-03-21 Thread Torsten Curdt
I have a hard time understanding the segue unwinding.

I have a simple storyboard setup. UIViewController with
UINavigationController. On a table cell click a custom segue pushes a
new UIViewController onto the navigation stack. But then pressing the
"back" button in the navigation bar, it only uses the default pop
animation.

Now the is the question how do I tell the navigation controller to use
my custom segue when popping back? There are

  segueForUnwindingToViewController:fromViewController:identifier:
  canPerformUnwindSegueAction:fromViewController:withSender:

but it seems like those do not get called unless there is an action

  - (IBAction)unwind:(UIStoryboardSegue *)segue;

wired up to the exit. Unfortunately IB doesn't allow me to wire that
up to the back button.

Any suggestions?

I've already wasted so much time on this that I am almost tempted to
go down the route of subclassing UINavigationController, trying to
trigger a segue manually on a pop.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Sandboxing and calling Launchctl

2012-05-29 Thread Torsten Curdt
> SMLoginItemSetEnabled can be a solution.

Again "fabulous" documentation on that one.

I tried my best to get the usual "start on login" wrapped up in a helper

  https://github.com/tcurdt/TCLoginItemHelper

...but in the end just left it out of the app.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: LSSharedFileListInsertItemURL/SMLoginItemSetEnabled and sandbox

2012-01-13 Thread Torsten Curdt
>> Anyone aware of sample code for the suggested helper app that manages
>> the login items via SMLoginItemSetEnabled?

Not battle tested yet but seems to work...

https://github.com/tcurdt/TCLoginItemHelper

Still need to find a nice way to get bundle id into the subproject.
But that's more a Xcode integration question.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


LSSharedFileListInsertItemURL/SMLoginItemSetEnabled and sandbox

2012-01-12 Thread Torsten Curdt
I am a little confused about login items and the sandbox.

The documentation says:

"With App Sandbox, you cannot create a login item using functions in
the LSSharedFileList.h header file. For example, you cannot use the
function LSSharedFileListInsertItemURL."

Yet after enabling the sandbox it still seems to work just fine. Maybe
the sanbox is not active?

Is there a good way to check for the sandbox at runtime?

Anyone aware of sample code for the suggested helper app that manages
the login items via SMLoginItemSetEnabled?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: the first mouseDown message of NSWindow

2011-12-14 Thread Torsten Curdt
>> Any further suggestions?
>
> Works for me as described.  You can download my sample project for
> comparison at http://dl.dropbox.com/u/5847625/MouseDownTest.zip

Thanks for the test project - works fine here, too.

Now I need to figure our what's wrong in my (also simple) other project :-/

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: the first mouseDown message of NSWindow

2011-12-14 Thread Torsten Curdt
Awesome! Thanks guys.

Now I do indeed get the event when I click on the content view. One
problem still remains though - the subview of the content view is
covering big portions of the content view. When I click on the subview
I don't get the first mouseDown. Neither in the content view nor in
the subview. Both views have acceptsFirstMouse: return YES.

Any further suggestions?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


the first mouseDown message of NSWindow

2011-12-14 Thread Torsten Curdt
I have a custom window that where I receive mouseDown messages. Now
the first mouseDown is always lost because it just activates the
window.
Here is the relevant code:

  https://gist.github.com/0b3b010ad675a349ce72

So I was digging through the docs but I don't see a way around this.

  
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html

But I've seen this working in other applications so I must be missing something.
Anyone that could give me some pointers?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


dragging to desktop

2011-12-01 Thread Torsten Curdt
I have a NSImageView and the user should be able to drag from it onto
the Finder which will then create a file. While I found this in the
archives

  
http://www.cocoabuilder.com/archive/cocoa/43556-drag-and-drop-onto-the-desktop.html

the docs and some other posts on the internetz suggest to use a "HFS
Promise Drag" instead

  
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DragandDrop/Tasks/DraggingFiles.html#//apple_ref/doc/uid/20001288-CEGJFDFG
  
http://speirs.org/blog/2009/12/5/hfs-promise-drags-from-ikimagebrowserview.html

So on a mouse down I am now calling

[self dragPromisedFilesOfTypes:[NSArray arrayWithObject:@"pdf"]
  fromRect:imageLocation
source:self
 slideBack:YES
 event:theEvent];

which initiates the drag session. When I drop it onto the Finder
namesOfPromisedFilesDroppedAtDestination: gets called.

Now while I could create the file in
namesOfPromisedFilesDroppedAtDestination: I am not sure whether that
is the correct place. The docs state "After a drag operation is
dropped, the dragging destination receives a performDragOperation:
message." but I don't see that method getting called at all.

Where is the correct place to create the files for the drop destination?
And will this also work when sandbox'ed?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: About iVars declaration and property

2011-11-15 Thread Torsten Curdt
> There’s no requirement that there be such an ivar, only a method named
> -window that returns an NSWindow*. The implementation of that method is
> arbitrary. For example it might just look like
> - (NSWindow*) window { return [_parent window];}

But then again the compiler would know about these implementations.

> Separating interface from implementation is a good thing and a keystone of
> OOP.

No one is questioning that :)

Anyway, not sure this discussion is really useful for the list anymore.
Happy to discuss further off list if someone is interested.

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: About iVars declaration and property

2011-11-15 Thread Torsten Curdt
> No it can't. @property only says "I have methods named -foo and -setFoo:". It 
> implies absolutely nothing about storage.

How does

 @property (nonatomic, assign) IBOutlet NSWindow *window;

not have the information that there would need to be an ivar

 NSWindow *window;

on 32-bit?

>> FWIW I check on the llvm IRC channel and the response was "I wouldn't
>> be surprised if there are annoying edge cases, but offhand I don't see
>> any reason it couldn't be done."
>
> If it could've been done, they would have done it. The fragile base class 
> problem is a well-understood aspect of language design, and the compiler team 
> is full of smart people.

FWIW the guy was from Apple. Quoting more "as far as I know the
decision to tie omitted ivars to non-fragile ivars was more one of
available engineering time and source compatibility than one of
technical possibility"

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


  1   2   3   4   >