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

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

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

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 quest

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

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

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

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

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

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

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

Re: ITMS-90171 libswiftRemoteMirror.dylib

2016-09-25 Thread Torsten Curdt
hough. On Sun, Sep 25, 2016 at 12:07 PM, Torsten Curdt <tcu...@vafer.org> 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 inform

Re: ITMS-90171 libswiftRemoteMirror.dylib

2016-09-25 Thread Torsten Curdt
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

Re: ITMS-90171 libswiftRemoteMirror.dylib

2016-09-25 Thread Torsten Curdt
ects-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 2

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.

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

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

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

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

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

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 <tcu...@vafer.org> wrote: > > > Ideally I would present a modal controller > > > Is there a solution where you segue from t

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

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 {

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,

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

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 <tcu...@vafer.org> wrote: > I am finding conflicting information on this on the interwebs - and > nothing in the docs. > > Is the WKWebView sharing cookies with

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

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:

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)) {

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

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

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 >

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,

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

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 sqwarq...@icloud.com wrote: On 10.9 I am seeing unlockFocus called too many times. Can't help with the why, but

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

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

Re: time of the build

2015-04-29 Thread Torsten Curdt
]; 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

Re: disabling Apple Crash Reporter

2015-03-10 Thread Torsten Curdt
/10, at 18:08, Torsten Curdt tcu...@vafer.org 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

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

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

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

Re: disabling Apple Crash Reporter

2015-03-09 Thread Torsten Curdt
; callbacks.context = NULL; callbacks.handleSignal = exitCallback; [crashReporter setCrashCallbacks:callbacks]; Yay! On Mon, Mar 9, 2015 at 9:45 PM, Torsten Curdt tcu...@vafer.org wrote: I guess it might be worth opening bug reports for the crash reporters to use exit if they don't. Or just

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

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

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

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

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

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

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

2014-10-31 Thread Torsten Curdt
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

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 websi...@paperetto.com wrote: The following seems to work from experimentation... For an application installed through TestFlight Beta

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

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

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

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

Re: UITableView's tableFooterView and autolayout

2014-06-11 Thread Torsten Curdt
, Torsten On Wed, Jun 11, 2014 at 3:56 PM, Sebastian Celis li...@sebastiancelis.com wrote: Hi Torsten, On Jun 11, 2014, at 6:26 AM, Torsten Curdt tcu...@vafer.org wrote: So what's the story with tableFooterView and tableHeaderView and autolayout? I am trying to put a label into a footer. I have

Re: UITableView's tableFooterView and autolayout

2014-06-11 Thread Torsten Curdt
...@sebastiancelis.com wrote: On Jun 11, 2014, at 9:41 AM, Torsten Curdt tcu...@vafer.org 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

Re: UITableView's tableFooterView and autolayout

2014-06-11 Thread Torsten Curdt
...@apple.com 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 tcu...@vafer.org

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]

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 witness.of.teacht...@gmx.net wrote: On 10 Jun 2014, at 11:47, Torsten Curdt

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 r...@rols.org 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 tcu...@vafer.org wrote: I know it sounds strange at first - but... I am

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

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

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

Re: UICollectionViewCell and UIScrollView and autolayout

2014-05-26 Thread Torsten Curdt
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 tcu...@vafer.org wrote: autolayout has assigned a frame to the cell

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

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

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

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

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

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

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

Re: accessing values along NSIndexPath

2014-03-26 Thread Torsten Curdt
, 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

Re: accessing values along NSIndexPath

2014-03-26 Thread Torsten Curdt
...@mooseyard.com wrote: On Mar 26, 2014, at 1:14 PM, Torsten Curdt tcu...@vafer.org 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

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 tcu...@vafer.org wrote: Hey there, I know on 10.6+ you can use

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

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

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

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

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

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

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

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

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];

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.

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;

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

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,

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?

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

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

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

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

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.

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

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,

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

Re: About iVars declaration and property

2011-11-15 Thread Torsten Curdt
If you’re 64-bit only (or if you require Lion or better), there’s no real reason to explicitly declare the ivars these days. As others have pointed out, this is not true. There are practical differences between declaring and not declaring the ivar explicitly. I almost never declare the ivar

Re: About iVars declaration and property

2011-11-15 Thread Torsten Curdt
In four words: Fragile Base Class Problem. The problem is that a subclass (in 32 bit OS X) needs to know the size of the superclass so it know how to lay out its ivars.  If there is no explicit ivars, there is no way for the compiler to know the size (since when it is compiling the

Re: About iVars declaration and property

2011-11-15 Thread Torsten Curdt
Think of it like the compiler generates the ivars from the property definitions. So the ivar would be indeed explicit ivars - just not defined as such in the classic way. Doesn't matter. The subclass still needs to know the size of its superclass so that it generate the proper ivar offsets.

  1   2   3   4   >