Re: Category errata in Objective-C

2019-03-29 Thread Cody Garvin
Just for clarification, an empty name in the parens is referred to as an 
extension and not a nameless category. An extension has extra abilities such as 
adding properties. Just being explicit for those that may not know. 

Please excuse mobile typos

> On Mar 29, 2019, at 5:55 PM, Jens Alfke  wrote:
> 
> 
> 
>> On Mar 29, 2019, at 2:51 PM, Alex Zavatone  wrote:
>> 
>> Also, I seem to remember the esteemed Jens stating that as soon as a 
>> category class is in your project, it applies to all objects instantiated 
>> from the base class and we only had to do an import if we wanted to use the 
>> category methods in the debugger.  Please correct me if I am wrong here.
> 
> No, you have to #import the header if you want to use the category methods in 
> a source file.
> 
> At _compile_ time, when you call one of those methods the compiler needs to 
> have seen a prior declaration of that method or it'll flag an error. Thus, 
> you need to have #included the header file declaring the category. (The 
> compiler _could_ go ahead and decide you know what's right, and just compile 
> a call to that method anyway; back in the old days it used to, but that 
> turned out to lead to lots of stupid runtime crashes caused by mistyped 
> method names.)
> 
> At _runtime_, the category patches the class implementation when your app 
> starts, so its methods are available everywhere.
> 
> —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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: Avoiding link conflicts with a static library

2018-04-05 Thread Cody Garvin
We send them one that is lipod then give them a build phase script that strips 
the opposite architecture out. A bit easier than switching frameworks that 
could potentially have different versions and avoid separate targets to add the 
different architecture library to. Let me know if you’d like our script. 

Please excuse mobile typos

> On Apr 5, 2018, at 12:04 PM, Alex Zavatone  wrote:
> 
> 
>> On Apr 5, 2018, at 1:37 PM, Redler Eyal  wrote:
>> 
>> 
>>> On 5 Apr 2018, at 17:29, Alex Zavatone  wrote:
>>> 
>>> 
 On Apr 5, 2018, at 4:19 AM, Redler Eyal  wrote:
 
>> 
>>> 2. (More importantly) It makes the client's binary larger since it will 
>>> have to include our full library, including simulator code. (correct me 
>>> if I'm wrong)
>> 
>> No, you should ask your client to remove the simulator slice before 
>> submitting to the App Store.
> 
> This is controlled in the build settings for release builds.  Compiled 
> Simulator code is not packaged and should not be packaged in a release 
> build.
 
 My understanding is that the dynamic lib is copied as a resource and not 
 processed automatically that way.
 
>>> 
>>> 
>>> But when it is built, it is built as Release or Debug, unless you have 
>>> added other build configurations.  When Archive is selected, that uses 
>>> Release.
>>> 
>>> Why would a Simulator i386 architecture be used in a release build?  You 
>>> can check the configuration and see if that architecture is even there in 
>>> the build config.
>> 
>> Because we are building an SDK - for other developers that need to be able 
>> to run their app, with our SDK, in the simulator.
>> 
> 
> I have done this twice.  If you need to distribute a version of the framework 
> witth simulator code in it, then you will need another build configuration 
> that does include this.  Duplicate a build config and add i386.  If you need 
> to strip debug symbols or add debug symbols, then duplicate another build 
> configuration and add or remove those settings.
> 
> Create as many build configurations as needed by duplicating and modifying 
> what is needed.  Clearly document this for your customer.  Build them what 
> they need and send them all the frameworks to link to.  Yes, it’s hard.  
> 
> - Alex Zavatone
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: Avoiding link conflicts with a static library

2018-04-04 Thread Cody Garvin
With the symbols, I believe you only need to convert the public symbols. Not 
sure how much of an undertaking it is with that library. You can also do this 
with other c flags using the -D=

The x86 and arm binaries will need to be stripped during archive time for your 
client, leaving only the proper architecture for them to submit. We ran into an 
issue with our sdk including the x86 portion during signing. By stripping that 
out using lipo it reduces the size back to normal sizes. 

Hope this helps. 

Please excuse mobile typos

On Apr 4, 2018, at 12:23 PM, Redler Eyal  wrote:

>>> 
>>> We're developing an SDK for iOS, the SDK is delivered in a 
>>> statically-linked framework. Our library uses openCV and we link OpenCV 
>>> into the delivered framework binary.
>>> 
>>> This SDK was deployed successfully with some clients but we're having an 
>>> issue with one client whose application also links indirectly (via card-io) 
>>> with openCV. The version of openCV they're using is different then then one 
>>> we use and as a result of this conflict, the application crashes upon use 
>>> of our SDK.
>>> 
>>> We are aware that the following are possible solutions to the problem:
>>> a. Switch to use the same version of OpenCV as our client.
>>> b. Build our framework as a dynamic library (where we a supposed to be able 
>>> to hide openCV inside)
>>> Both of these options are not optimal for us and we trying to see if we 
>>> have any other option.
>> 
>> You could rename the symbols in your copy of OpenCV so that they don’t match 
>> the standard ones. One way to do that is with the preprocessor (use #defines 
>> to change the names of the OpenCV functions you use), which potentially 
>> avoids altering the OpenCV sources themselves (you can use a prefix header 
>> to get your #defines into the OpenCV build process if necessary).
>> 
> We thought about this option too but we figured it would require changing all 
> the symbols in the library and not just the ones we use because the functions 
> were using may be calling other functions which could also have the same name 
> in the new and old versions of the library. (Correct me if I'm wrong)
> 
> Eyal
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: Program Crash

2015-01-30 Thread Cody Garvin
Heh probably shouldn't vent here if you don't expect any comments. Definitely 
not the place to start off topic convo. 

Regardless, zero issues over here with Safari as well. 

Report the crash to Apple with the data dump from the console. You could have a 
hard to find issue cropping up. It could also be a sign of hardware going bad 
or something corrupt software wise. 

Have you tried a clean install?

Please excuse mobile typos

> On Jan 30, 2015, at 8:31 AM, Raglan T. Tiger  wrote:
> 
> 
>> On Jan 30, 2015, at 9:04 AM, Ronald Hofmann  wrote:
>> 
>> I asume you are using some extensions or/and Flash which are resposinble for 
>> that.
> 
> I know this sis off topic but it is just frustrating and I choose to vent.
> 
> No flash, no extensions.
> 
> Enough, no more comments.
> 
> -rags
> 
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: How do I get a black status bar?

2014-08-12 Thread Cody Garvin
You could always throw an opaque UIView behind it. I did that same effect with 
a UIToolbar in iOS 7 for a blurred effect. <

- Cody

> On Aug 12, 2014, at 4:34 PM, Rick Mann  wrote:
> 
> Thanks for reminding me of that. I knew this was the case, but I'm fighting a 
> designer who wants the black background. He threw the Facebook iPad app at 
> me, showing that it puts up a black status bar when the side drawer is opened.
> 
> I'll just point him at this link. The app looks pretty good as-is, so I don't 
> think that's necessary.
> 
> On Aug 12, 2014, at 16:24 , Kyle Sluder  > wrote:
> 
>> On Tue, Aug 12, 2014, at 06:19 PM, Rick Mann wrote:
>>> I'd like to get a black-background, white-text status bar across my app.
>> 
>> There is no such thing in iOS 7.
>> 
>> 
>> 
>> --Kyle Sluder
>> ___
>> 
>> 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/rmann%40latencyzero.com 
>> 
>> 
>> This email sent to rm...@latencyzero.com 
> 
> 
> -- 
> Rick Mann
> rm...@latencyzero.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/cody%40servalsoft.com 
> 
> 
> This email sent to c...@servalsoft.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: NSView in 10.10

2014-07-24 Thread Cody Garvin
They did this as a migration to Swift I believe. 

It has to do with migrating to properties from getters / setters. If you look 
at the header, the property is now just flipped, and readonly. However, you can 
still override the getter method on the property itself and return YES. 

- Cody

> On Jul 24, 2014, at 4:39 PM, Graham Cox  wrote:
> 
> Looking at the lastest documentation for Yosemite, is indicates that -[NSView 
> isFlipped] is deprecated. That seems rather major. Does that mean we can't 
> have flipped views in future? Otr is something replacing this?
> 
> --Graham
> 
> 
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: NSCursor tracking areas

2014-07-24 Thread Cody Garvin

> On Jul 24, 2014, at 1:51 PM, Markus Spoettl  wrote:
> 
> On 24/07/14 15:37, Cody Garvin wrote:
>> I then use cusrorUpdate:(NSEvent *)theEvent to change the cursor by iterating
>> over theEvent’s converted point to the view and matching it with a drag point
>> (I do this because in the future the object itself will use another cursor
>> for dragging it around. Then use [[NSCursor pointingHandCursor] set].
> 
> It's not clear to me if you have 4 tracking areas that cover only the 
> drag-handles, or if the tracking area(s) cover more than the handle. If they 
> cover the handles, they should "just work" using -cursorUpdate:. You may need 
> an additional tracking area covering your entire view to reset the cursor 
> when the cursor leaves a handle area. There may also be tricky interactions 
> when dragging a handle, since you will have to update the tracking areas to 
> match your handle locations.
> 
> What I usually do in situations with multiple different interactive areas in 
> a single view is use one big tracking area covering the entire view and 
> handle cursor changes in -cursorUpdate: AND -mouseMoved: when and if the 
> cursor enters or leaves appropriate areas within my view. No problem handling 
> both, I imagine setting a cursor in -mouseEntered: will not be a problem 
> either.
> 
> Also you do NOT need to take care of updating the cursor when it leaves your 
> view, OSX will do that (actually the view that is being entered might).
> 
> Regards
> Markus
> -- 
> __
> Markus Spoettl


Thanks for the reply Markus

Currently there is 4 NSTrackingAreas, one over each drag handle. I had one for 
the main object itself since it can be moved, but removed that in attempts to 
debug the issue. Resetting hasn’t been an issue, it seems just getting it to 
trigger has been the issue. The drag handles are 12pt x 12pt. Went bigger to 
see if that would help. 

This is on a static object that hasn’t yet been moved or resized. Seems to be 
very random, works about 2-3 times out of 4 attempts. 

I think I’ll try your’s and Edward’s suggestion on attempt mouseEntered / 
mouseMoved with a single tracking area. I feel I copied an example from Apple’s 
docs almost verbatim and was still getting iffy results. Again, I am building 
on 10.10 for 10.10, so maybe there is something there. It seems like a very 
straight forward attempt. 

I’ll reply with results, most likely tomorrow because I’m working on another 
feature right now.

Thanks so much for everyone’s help today

- Cody
___

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: NSCursor tracking areas

2014-07-24 Thread Cody Garvin

> On Jul 24, 2014, at 7:40 AM, Ken Thomases  wrote:
> 
> On Jul 24, 2014, at 8:37 AM, Cody Garvin  wrote:
> 
>> I use updateTrackingAreas to remove all the tracking areas, then adding new 
>> ones (same rects as the drag points) with the options: 
>> NSTrackingActiveInActiveApp | NSTrackingCursorUpdate | NSTrackingAssumeInside
> 
> Why are you including NSTrackingAssumeInside?  The docs discourage its use 
> and it doesn't seem to correspond to what you want.  Basically, it will 
> sometimes suppress the call to -cursorUpdate:.
> 
> Regards,
> Ken
> 


It wasn’t working well without it, read on cocoa builder that it may help jump 
start the tracking. Adding or removing makes no difference.

Regards

- Cody
___

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: NSCursor tracking areas

2014-07-24 Thread Cody Garvin

> 
> ah, well, i had a similar problem, but the opposite. have you tried doing the 
> set in mouseEntered?
> 

I have not tried mouseEntered yet. If I go that route, should I dispose of 
cursorUpdate?

- Cody
___

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: NSCursor tracking areas

2014-07-24 Thread Cody Garvin
> 
> is it set (enter), reset (exit), or both that sometimes do not work as 
> intended?
> 

Setting it, resetting seems to always work.
___

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: NSCursor tracking areas

2014-07-24 Thread Cody Garvin
Tried to send this yesterday with code, but I guess it was too big.

This is on Xcode 6 Beta 4 / OS X 10.10. The app is built for 10.10, so perhaps 
a bug.

I’m getting some randomness with updating the cursor. Sometimes works as 
intended, sometimes not. 

I have four hotspots on the corners of selected objects that can be resized. In 
these 4 areas the cursor is supposed to change to a “draggable cursor”, and 
reset when it exits that area. As well, the entire object is draggable, so I 
wanted an open hand cursor to indicate that when over the main objects. 

It seems NSCursor and the way it works has changed over the years. Perhaps my 
methods are out of date. 

I use updateTrackingAreas to remove all the tracking areas, then adding new 
ones (same rects as the drag points) with the options: 
NSTrackingActiveInActiveApp | NSTrackingCursorUpdate | NSTrackingAssumeInside

I then use cusrorUpdate:(NSEvent *)theEvent to change the cursor by iterating 
over theEvent’s converted point to the view and matching it with a drag point 
(I do this because in the future the object itself will use another cursor for 
dragging it around. Then use [[NSCursor pointingHandCursor] set].

Is this not the preferred way? Is overlapping the main area with the drag areas 
causing issues? 

Thanks

- Cody

___

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: How to perform delayed calls using NSOperationQueue?

2014-07-21 Thread Cody Garvin
I'd love to be wrong. Hopefully I am. 

Please excuse mobile typos

> On Jul 21, 2014, at 6:03 PM, Jens Alfke  wrote:
> 
> 
>> On Jul 21, 2014, at 5:54 PM, Cody Garvin  wrote:
>> 
>> I ended up writing a queue manager that took NSOperations along with times, 
>> preflight block check and postflight block (setting other things up, 
>> massaging, etc).
> 
> Really, we have to reinvent NSTimer ourselves? Especially after Apple 
> optimized the real NSTimer to group calls together, to save battery power by 
> not waking the CPU as often?
> 
> —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: How to perform delayed calls using NSOperationQueue?

2014-07-21 Thread Cody Garvin
I know it’s not NSOperationQueue but GCD has dispatch_after. 

I ended up writing a queue manager that took NSOperations along with times, 
preflight block check and postflight block (setting other things up, massaging, 
etc).

I don’t thinkw NSOperationQueue has an equivalent. Could be wrong

- Cody

> On Jul 21, 2014, at 5:42 PM, Jens Alfke  wrote:
> 
> I’m starting to port a pretty complex source base from using NSURLConnection 
> to using NSURLSession. (Primarily because this is the only way to get around 
> the only-four-sockets-per-host limitation.) I thought it was going to be 
> straightforward, until I saw that NSURLSession only supports scheduling 
> delegate calls on an NSOperationQueue, not an NSRunLoop. So that means I now 
> also have to convert a number of runloop dependencies in the same code, which 
> I don’t understand how to do.
> 
> Case in point: I have a couple of things that require the use of delayed 
> performs to schedule timing. What’s the equivalent of 
> -performSelector:withObject:afterDelay: (or of NSTimer) for code that’s 
> running under the control of an NSOperationQueue? I know this call won’t work 
> on a queue (because the thread it’s on probably won’t have a runloop), but 
> I’ve looked at the API docs and headers and don’t see anything comparable. 
> Dispatch queues have dispatch_after, and I’d much rather use GCD than 
> NSOperationQueue anyway*, but NSURLSession is forcing my hand.
> 
> —Jens
> 
> *  (I know there’s now an underlyingQueue property on NSOperationQueue, but 
> that’s only in iOS 8 and I can’t rely on that yet.)
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: rotate UI subview (CFAffline Transform)

2014-07-18 Thread Cody Garvin
Transforms are meant to be tiered / layered. In other words, if you do another 
transform via a pan or rotation, it’s going to reset. If your view was already 
scaled (matrix has been edited), doing a Make transform (ex: 
CGAffineTransformMakeRotation) would reset it. Transforms manipulate the 
layer(s). Your view isn’t aware the layer has been tampered with.

If it isn’t another transform that is resetting the layer, then you need to 
reapply your transform. You can can easily get your current transformation via:

CGAffineTransform transformation = theRotatedView.transform;
CGFloat amountRotated = atan2f(transformation.b, transformation.a); // b and a 
are the values manipulated for matrix math. 

A debugging method that you can use is: NSStringFromCGAffineTransform(), will 
help output your current transform. I’m sure you’ll see the matrix numbers 
reset.

Regards

- Cody

It would help to see the code that makes the pan gesture. 
> On Jul 18, 2014, at 4:51 AM, 2551 <2551p...@gmail.com> wrote:
> 
> I have a problem which I can't find anyone else asking after hours of 
> searches through stackexchange and the like. 
> 
> In a UIView, I'm rotating a subview with a Gesture recognizer that calls this 
> selector:
> 
> - (IBAction)rotateShape:(UIRotationGestureRecognizer *)gesture {
>gesture.view.transform = CGAffineTransformMakeRotation(gesture.rotation);
> }
> 
> The rotation performs as expected and all is right with the world. However, 
> as soon as I attempt to touch or move the rotated subview again (it also has 
> a pan gesture), it reverts to its original orientation. 
> 
> It seems the original transform values are still being retained and held by 
> the object or by the drawing context (I'm still not quite comfortable with 
> all the graphics theory; indeed, this is my first attempt at trying to unlock 
> its mysteries). What else do I need to do to ensure the new rotated, 
> orientation "sticks" so that I can move the shape without it reverting to the 
> original orientation?
> 
> Thanks for any help.
> 
> 
> Phil
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: Yosemite API discussions

2014-07-08 Thread Cody Garvin
Apple seriously relaxed the NDA this year. I’m fairly certain we can talk about 
quite a bit more than we’re used to. 

- Cody

> On Jul 8, 2014, at 3:11 AM, Markus Spoettl  wrote:
> 
> Hi,
> 
>  since the OSX-beta devforum is virtually dead from a developer perspective, 
> the only legal way to ask questions is using the black hole that is 
> bugreporter. Lacking better alternatives, I reported several things (mostly 
> related to new NSWindow features), even got feedback on one (though that took 
> a week and the feedback was something like "Is this really a problem for 
> you?").
> 
> Hardly a healthy conversion. Without proper feedback from peers or Apple how 
> is this supposed to work? Not every detail is covered in the WWDC videos. Is 
> there a better place where NDA-covered discussion is allowed *and* alive? I 
> find it really really frustrating that this is being made so difficult.
> 
> Regards
> Markus
> -- 
> __
> Markus Spoettl
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: ARC Retain Cycles

2014-04-20 Thread Cody Garvin
Hi Dave!

First, check to make sure zombies are disabled. I made the mistake of trying to 
track down leaks via instruments, and totally forgot they were enabled: wild 
goose chase.

Second, while using instruments use the “mark heap” tool. Get your app up and 
running. Mark the heap. Then start your image downloads, while that is 
transpiring, mark the heap again. This will help narrow down the code that 
could possibly be causing this.

Third, keep in mind that blocks keep strong references to self (especially 
callbacks). I’d look for any self reference inside blocks, weakify, then 
strongify in the block if necessary.

__weak typeof(self) weakSelf = self;
void (^someWeirdBlock)(void) = 
^{
typeof(self) strongSelf = weakSelf; // Helps keep a reference around, 
but doesn’t hold onto forever
};

Hope this helps

- Cody

On Apr 20, 2014, at 11:52 AM, Dave  wrote:

> Hi,
> 
> I have a inheriated an Application that I converted to use ARC. When I run it 
> now, I see that memory is being allocated and not released. At least, when I 
> run the App with the debugger view active, I see the memory growing and 
> growing when I do some intensive Image Downloads as a test for the network 
> layer (I’ve not run it under the Profiler yet).
> 
> Since this is ARC, I’m guessing that the Leak is caused by some kind of 
> retain cycle that is holding onto the image data after the network layer is 
> finished with it.
> 
> My question is, what is the best/easiest way to detect these issues under 
> ARC? I’ve had quite a lot of experience doing this with non-ARC projects, but 
> never had this problem before using ARC. Under non-arc, if push came to 
> shove, I’d override retain/release etc. and add logging which usually showed 
> up the problem quickly. Of course I can’t do that anymore now I’ve converted 
> it to ARC.
> 
> The Network Layer has a lot of prooperties that have the retain attribute 
> (I’ve not changed them to strong), I’m sure it’s something to do with either 
> a retain cycle, but there’s so much code it’s hard to see the wood from the 
> trees.
> 
> Thanks in advance for any suggestions or help.
> 
> All the Best
> Dave
> 
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: UIButton over sliding UIImageView disappears until slide complete

2014-01-19 Thread Cody Garvin
Yah code would really be helpful. Are you doing implicit layer animations on 
the UIImageViews themselves? Or are you using Core Animation directly?



On Jan 19, 2014, at 12:28 PM, Eric E Dolecki  wrote:

> Same parent view. 
> 
> Eric
> 
>> On Jan 19, 2014, at 2:02 PM, Cody Garvin  wrote:
>> 
>> Are they in the same patent view? 
>> 
>> Please excuse mobile typos
>> 
>>> On Jan 19, 2014, at 8:19 AM, Matt Neuburg  wrote:
>>> 
>>> On Wed, 15 Jan 2014 15:46:19 -0500, "Eric E. Dolecki"  
>>> said:
>>>> I have a UIButton above a series of UIImageViews. At times, the
>>>> UIImageViews will slide under the button - and they disappear until the
>>>> animation (UIView) is complete.
>>>> 
>>>> How can I prevent this and have the button remain in view at all times?
>>> 
>>> Can you post on github a small project that will allow the issue to be 
>>> reproduced? Thx - m.
>>> 
>>> --
>>> matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/
>>> Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do
>>> iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do
>>> RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
>>> 
>>> ___
>>> 
>>> 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/cody%40servalsoft.com
>>> 
>>> This email sent to c...@servalsoft.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: Crash on iOS when encoding an NSAttributedString

2014-01-19 Thread Cody Garvin
sounds like an attribute can't encode itself. I know CGColorRef doesn't know 
how to encode itself, which is what CoreText uses to render. If try and pull 
the string out and serial size the attributes separately, or find a way to 
serialize CGColorRef. Sorry I'm not much help. 

Please excuse mobile typos

> On Jan 19, 2014, at 10:54 AM, Markus Spoettl  wrote:
> 
> Hello,
> 
>  I got a crash log from a user that's mildly puzzling. It happens somewhere 
> deep down CoreText it seems, while encoding an NSAttributedString (whose 
> content I don't know). Any ideas how it can some to this?
> 
> My app has a standard UITextView that feeds the model property that is 
> encoded here. There is no processing of the attributed string going on in the 
> App. The UITextView is created dynamically (not loaded from a NIB), it is 
> embedded in a custom UITableViewCell (just in case that influences the way it 
> constructs attributed strings it spits out).
> 
> Google turns up some crashes with a similar top end of the call stack, but 
> those happen while drawing the attributed string. Does iOS draw a 
> NSAttributedString in order to object-encode it?
> 
> The code that eventually ends up crashing is
> 
> - (void)encodeWithCoder:(NSCoder *)encoder
> {
>  
>  [encoder encodeObject:notes forKey:@"notes"];
>  
> }
> 
> Does this ring a bell for anyone?
> 
> Regards
> Markus
> 
> Hardware Model:  iPhone6,2
> Process: MyApp [3818]
> Path: 
> /var/mobile/Applications/9C395437-7BC5-47A8-B4BE-C659F61F5628/MyApp.app/MyApp
> Identifier:  com.bla.MyApp
> Version: 162 (1.0)
> Code Type:   ARM-64 (Native)
> Parent Process:  launchd [1]
> 
> Date/Time:   2014-01-19 06:44:51.347 +
> OS Version:  iOS 7.0.4 (11B554a)
> Report Version:  104
> 
> Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
> Exception Subtype: KERN_INVALID_ADDRESS at 0x7300786966657250
> Triggered by Thread:  0
> 
> Thread 0 Crashed:
> 0   ???   0x7300786966657250 0 + 8286755708446536272
> 1   CoreText  0x00018c689bd8 
> TBaseFont::CalculateFontMetrics(bool) const + 100
> 2   CoreText  0x00018c699930 
> TComponentFont::CalculateFontMetrics(bool) const + 52
> 3   CoreText  0x00018c689a2c TBaseFont::InitFontMetrics() const + 
> 64
> 4   CoreText  0x00018c70bec8 TBaseFont::GetStrikeMetrics(double, 
> CGAffineTransform const*, bool) const + 96
> 5   CoreText  0x00018c689774 TFont::InitStrikeMetrics() const + 64
> 6   CoreText  0x00018c689704 CTFontGetAscent + 120
> 7   GraphicsServices  0x0001917ffc14 GSFontEnsureExtraData + 256
> 8   GraphicsServices  0x000191802940 GSFontGetExtraData + 52
> 9   UIFoundation  0x000194c3ee00 -[UIFont isIBTextStyleFont] + 12
> 10  UIFoundation  0x000194c3e904 -[UIFont encodeWithCoder:] + 112
> 11  Foundation0x00018c9dc210 _encodeObject + 1244
> 12  Foundation0x00018c9dd74c -[NSKeyedArchiver 
> _encodeArrayOfObjects:forKey:] + 468
> 13  Foundation0x00018c9dd374 -[NSDictionary(NSDictionary) 
> encodeWithCoder:] + 1024
> 14  Foundation0x00018c9dc210 _encodeObject + 1244
> 15  Foundation0x00018c9e9a80 -[NSAttributedString 
> encodeWithCoder:] + 252
> 16  Foundation0x00018c9dc210 _encodeObject + 1244
> 17  MyApp 0x00010014bb64 -[Activity encodeWithCoder:] 
> (SRC.m:2319)
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: UIButton over sliding UIImageView disappears until slide complete

2014-01-19 Thread Cody Garvin
Are they in the same patent view? 

Please excuse mobile typos

> On Jan 19, 2014, at 8:19 AM, Matt Neuburg  wrote:
> 
> On Wed, 15 Jan 2014 15:46:19 -0500, "Eric E. Dolecki"  
> said:
>> I have a UIButton above a series of UIImageViews. At times, the
>> UIImageViews will slide under the button - and they disappear until the
>> animation (UIView) is complete.
>> 
>> How can I prevent this and have the button remain in view at all times?
> 
> Can you post on github a small project that will allow the issue to be 
> reproduced? Thx - m.
> 
> --
> matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/
> Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do
> iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do
> RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: Mavericks CA Layer Issue

2013-12-22 Thread Cody Garvin
Did you make sure masksToBounds is set to NO?

Please excuse mobile typos

> On Nov 22, 2013, at 2:28 AM, Banisetty Avinash  
> wrote:
> 
> Hi All
> 
> With latest Mac OS 10.9, I am facing an issue with layers. The issue is 
> sublayers(CALayer) are not allowed to expand beyond the bounds of parent 
> layer(CALayer), which is all working fine for rest of the OS Versions. We are 
> using the 10.5 sdks and deployment target as 10.5 for our application. The 
> truncations mentioned in the attachment is not happening for rest all OS 
> versions. We haven't wrote any version specific coding or not changed any 
> thing recently. So can you please help me to find out whether is there any 
> work around.
> 
> Issue: poker cards are added as sublayer to the player seat avatar on the 
> game table. Player seat have some transparent part and that is the limit up 
> to which cards are getting shown and beyond that limit everything is getting 
> truncated. Adding more transparent layer may add to our woes as there may be 
> variable number of cards and also increasing the transparent part would make 
> us to recalculate all layers beside the poker cards.
> 
> Thanks
> Ivy Dev
> This email and any attachments are confidential, and may be legally 
> privileged and protected by copyright. If you are not the intended recipient 
> dissemination or copying of this email is prohibited. If you have received 
> this in error, please notify the sender by replying by email and then delete 
> the email completely from your system. Any views or opinions are solely those 
> of the sender. This communication is not intended to form a binding contract 
> unless expressly indicated to the contrary and properly authorised. Any 
> actions taken on the basis of this email are at the recipient's own risk.
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: CALayer's delegate prevents implicit animation?

2013-12-18 Thread Cody Garvin
Yah you can't make the parent view of the layer the delegate. Nasty things can 
happen. One of my interview questions I ask :)

Please excuse mobile typos

> On Dec 18, 2013, at 11:50 AM, Seth Willits  wrote:
> 
> 
> Oooo… Yeah, it's an NSView which I imagine is the problem. 
> Documenting this behavior would be very useful.
> 
> My entire app is one view, with zillions of layers in it, so I have the view 
> as the master coordinator for everything. Since it knows about various views 
> and their layout relationships, I set it as the delegate for a few layers 
> because of the access it already has to needed info. 
> 
> It's easy enough to work around this case though.
> 
> 
> --
> Seth Willits
> 
> 
> 
>> On Dec 18, 2013, at 11:13 AM, David Duncan  wrote:
>> 
>> What is the identify of your delegate?
>> 
>>> On Dec 18, 2013, at 10:51 AM, Seth Willits  wrote:
>>> 
>>> Short version:
>>> 
>>> In 10.9 only: My CALayer's delegate doesn't implement **any** delegate 
>>> methods, but because a delegate is set, the layer's position will not 
>>> implicitly animate. If I don't set it, it works fine.
> 
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: Toggle framework in Cocoa

2013-12-10 Thread Cody Garvin
I believe google has something called google tag manager that could be useful. 
You can remotely enable or disable features in your app. 

I do believe the scenario you're describing is the right time for a remote 
branch that could be rolled into master when the feature is completed. 
Otherwise, sounds like using settings of some form is your best bet. 

- Cody

Please excuse mobile typos

> On Dec 10, 2013, at 6:04 AM, Appa Rao Mulpuri  
> wrote:
> 
> Imagine we have release cycle for every two weeks, but need to build a
> feature that's going to take three months to complete. How do you use
> Continuous Integration to keep everyone working on the mainline without
> revealing a half-implemented feature on your releases?
> 
> 
> To solve the issue:
> 
> We have a configuration file that defines a bunch of toggles for various
> features you have pending. The running application then uses these toggles
> in order to decide whether or not to show the new feature.
> 
> 
> Mode info@
> http://martinfowler.com/bliki/FeatureBranch.html
> http://en.wikipedia.org/wiki/Feature_toggle
> 
> 
> 
> 
> 
>> On 12/10/13 7:10 PM, "Uli Kusterer"  wrote:
>> 
>> On 10 Dec 2013, at 14:31, Appa Rao Mulpuri 
>> wrote:
>>> Do we have toggle framework in Cocoa?  I searched in the internet and
>>> found http://www.togglz.org/, which is written in Java. I am curious, we
>>> have equivalent in Cocoa as well.
>> 
>> 
>> What does it do?
>> 
>> -- Uli Kusterer
>> "The Witnesses of TeachText are everywhere..."
> 
> This email and any attachments are confidential, and may be legally 
> privileged and protected by copyright. If you are not the intended recipient 
> dissemination or copying of this email is prohibited. If you have received 
> this in error, please notify the sender by replying by email and then delete 
> the email completely from your system. Any views or opinions are solely those 
> of the sender. This communication is not intended to form a binding contract 
> unless expressly indicated to the contrary and properly authorised. Any 
> actions taken on the basis of this email are at the recipient's own risk.
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: Confusion about Image I/O export?

2013-09-02 Thread Cody Garvin
Finder lags in updating image sizes. Is it updating an image or creating a new 
one? 

Please excuse mobile typos

On Sep 2, 2013, at 6:09 AM, Graham Cox  wrote:

> I'm confused, or am I?
> 
> I'm using Image I/O to export a bitmap in PNG format. I can set the desired 
> image resolution, which of course causes the bitmap to change size. e.g. a 
> 128 x 128 image, with 144dpi, yields a 256 x 256 bitmap.
> 
> I export this, setting the X and Y pixels per meter to the equivalent of 
> 144dpi. For good measure, I also set kCGImagePropertyDPIWidth and 
> kCGImagePropertyDPIHeight to 144. The image exports fine, except that in 
> Finder and in Preview, the image size is reported as 256 x 256, 144dpi. I'm 
> expecting to see the image size 128 x 128 (Preview does report this size if I 
> set the units to points). Or am I?
> 
> I think the main confusion comes from Finder reporting the image size in the 
> icon view as 256 x 256. Why does Finder show the pixel dimensions when as an 
> image this is not its size?
> 
> --Graham
> 
> 
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: UIScrollView to UIImage

2013-07-21 Thread Cody Garvin
Hi Trygve, sorry for the misinformation earlier. 

I wanted to follow up and let you know this is indeed working for me. Forgot to 
follow up Friday, so sending today.

A few things.

A) Are you adding the QuartzCore framework to your project (I don't believe 
you'd be able to compile if you weren't), so I think you're good there.

B) Make sure your layer / view isn't nil. Are you using an outlet? Make sure 
your outlet is connected. 

- Cody


Cody Garvin | Developer
Servalsoft LLC

On Jul 17, 2013, at 6:56 PM, Trygve Inda  wrote:

> I am trying to take a "snapshot" of my UIScrollView and store it in a
> UIImage:
> 
> UIGraphicsBeginImageContext(scrollView.bounds.size);
> [scrollView.layer renderInContext:UIGraphicsGetCurrentContext()];
> UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
> UIGraphicsEndImageContext();
> 
> 
> This works for the most views, but when I try it with the UIScrollView, I
> just get a black image (but [image size] is correct).
> 
> Any ideas?
> 
> Trygve
> 
> 
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: UIScrollView to UIImage

2013-07-19 Thread Cody Garvin
You're right Kyle. I quickly tried it, saw it worked and moved on. 

I'll try it again another way and report back

Please excuse mobile typos

On Jul 18, 2013, at 1:37 PM, Kyle Sluder  wrote:

> On Thu, Jul 18, 2013, at 01:18 PM, Cody Garvin wrote:
>> The UIScrollView adds these subviews to what's called a contentView. This
>> is why you have to change a content size to adjust your scrolling, vs
>> changing the frame of the UIScrollView. You're grabbing the wrong layer.
> 
> When learning about Auto Layout on iOS, I spent a lot of time exploring
> the internals of UIScrollView. My investigations led me to conclude that
> there is no such thing as a content view as you describe it. You can see
> this for yourself if you call -recursiveDescription on your scroll view
> (or any of its ancestors).
> 
> It looks to me like the initial design of UIScrollView—that is, before
> the iOS 2.0 SDK ever shipped—was similar to that of NSScrollView on the
> Mac. This is why the documentation makes references to "content views."
> 
> At some point before iOS 2.0, this design was changed, and the area
> scrolled by the scroll view no longer maps to an actual UIView object.
> This is why UITableView and friends are _subclasses_ of UIScrollView,
> rather than _subviews_.
> 
> The _contentView ivar, and the private -contentView method, now seem to
> exist for the purpose of supporting
> -touchesShouldBegin:withEvent:inContentView: and friends. There is no
> secret "content view" in the view hierarchy.
> 
> Again, this understanding is derived from poking at UIScrollView's
> internals. It is not definitive, and quite likely not (entirely)
> correct. But it jibes with my understand of UIScrollView much better
> than the "anonymous contentView" theory.
> 
>> You can grab the correct view / layer: [[scrollView contentView] layer];
> 
> There is no public -contentView method on UIScrollView, so attempting to
> call it is likely to get your app rejected by the App Store. Please do
> not use this method.
> 
> --Kyle Sluder

___

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: UIScrollView to UIImage

2013-07-18 Thread Cody Garvin
Hi Trygve,

The UIScrollView adds these subviews to what's called a contentView. This is 
why you have to change a content size to adjust your scrolling, vs changing the 
frame of the UIScrollView. You're grabbing the wrong layer.

You can grab the correct view / layer: [[scrollView contentView] layer];

Hope that helps

- Cody

On Jul 17, 2013, at 8:21 PM, Trygve Inda  wrote:

>> Does it do that even if the scroll view isn't scrolled at all but is at the
>> very top? 
>> 
>> On 18 Jul, 2013, at 9:56, Trygve Inda  wrote:
>> 
>>> I am trying to take a "snapshot" of my UIScrollView and store it in a
>>> UIImage:
>>> 
>>> UIGraphicsBeginImageContext(scrollView.bounds.size);
>>> [scrollView.layer renderInContext:UIGraphicsGetCurrentContext()];
>>> UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
>>> UIGraphicsEndImageContext();
>>> 
>>> 
>>> This works for the most views, but when I try it with the UIScrollView, I
>>> just get a black image (but [image size] is correct).
>>> 
>>> Any ideas?
>>> 
>>> Trygve
>>> 
> 
> Yes. It is a right to left full screen scroll view with 3 views in it. I can
> get an image of any of the views with the above code, but not the scroll
> view itself (which may show more than one view)
> 
> 
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: UIView drawRect will update whole bounds

2013-05-15 Thread Cody Garvin
Not that this answers your question, but as graham eluded to, there aren't a 
lot if choices. I'd look into showing a progress indicator or look into tiling. 
GL

Please excuse mobile typos

On May 15, 2013, at 6:44 PM, Graham Cox  wrote:

> 
> On 16/05/2013, at 11:29 AM, li shunnian  wrote:
> 
>> I implement drawRect of a subclass of UIView. I found view will update whole 
>> bounds when I switch from another app to myapp. Because I draw a cgimage on 
>> the view's bounds, it cost lots of time. Are there some properties of view 
>> or layer to make the update rect not to be whole bounds?
> 
>> My app is a painter, the image is used for back buffering. When dragging, I 
>> calculate the points between the previous point and now point, and draw a 
>> small image on the back buffer image. Then update the back buffer image to 
>> the view.
> 
> 
> I can't see you have any choice - at times the view will need to refresh its 
> whole bounds, and if that means drawing the whole image, you will have to do 
> that, or else end up with blank areas which I'm sure you don't want. If the 
> view is within a scroller, then it should only ever refresh the visible 
> portion.
> 
> If it's slow, perhaps you ought to investigate why. Are you scaling or 
> transforming the image? How do you do the drawing? Show code.
> 
> --Graham
> 
> 
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: After Photoshop closes a doc

2013-04-14 Thread Cody Garvin
You'd most likely need to create a photoshop plugin to get such a notification. 

Please excuse mobile typos

On Apr 14, 2013, at 3:34 PM, Leonardo  wrote:

> Hi, I would like my app executes a given task when Photoshop closes its
> current document. May I get a notification about that on my app?
> 
> 
> Regards
> -- Leonardo
> 
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: IB - NSTableView Single Column Header Issue

2012-12-27 Thread Cody Garvin
Hi Keary,

Yah, I wasn't sure how to describe it :)

Either way, I think I figured it out, and there is a bit more to it. 

First of all, yah if you resize the table less than where that bar is, then 
resize it back to where you want it, it goes away. 

The second step is to click on the Table Column and make sure resize is set to 
"Autoresizes with Table"

The third step is to click on the Size Inspector for the Table Column and make 
sure the maximum is set to something outrageous… 10?

The fourth step is to disable horizontal scrolling (optional, not really 
necessary).

Finally, what was really throwing me off, after doing all of this, I have my 
scroll bars to always show. So there was always about a 18-20px deadspace 
section above my vertical scroll bar. Once I changed my configuration to "Show 
Scroll bars: When Scrolling", everything was solved.

Thanks for the feedback!

- Cody

On Dec 27, 2012, at 4:29 PM, Keary Suska  wrote:

> On Dec 27, 2012, at 5:11 PM, Cody Garvin wrote:
> 
>> I've figured this one out before, but can't seem to get this to work after a 
>> few hours of trying.
>> 
>> Problem: Can not get single header column to match single column in 
>> NSTableView
>> 
>> Steps to reproduce:
>> 1) Open Xcode
>> 2) Create Cocoa Application
>> 3) Open MainMenu.xib
>> 4) Click on Window
>> 5) Drag a NSTableView to the xib
>> 6) Make table 1 column (Notice how the second empty header sticks around, 
>> one way around this is to resize it, but the bar is still there)
>> 
>> How do you get rid of the empty header column? If you resize it, it just 
>> moves the resize column bar about 2px away from the right side, but still 
>> becomes a problem when scrollbars appear.
>> 
>> Any ideas?
> 
> It's not actually an empty header, it is just "dead" space drawn because the 
> column width is smaller than the table width. Also with default options, if 
> you shorten the table width until it is smaller than the column width, and 
> then enlarge it to the desired width you will see that the column width will 
> keep to the table width and voila.
> 
> HTH,
> 
> Keary Suska
> Esoteritech, Inc.
> "Demystifying technology for your home or business"
> 


___

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: Syncing w/o iCloud

2012-12-21 Thread Cody Garvin
Pretty sure Jens meant Simperium ;)

(https://simperium.com)

- Cody
On Dec 20, 2012, at 10:35 PM, Jens Alfke  wrote:

> 
> On Dec 20, 2012, at 6:47 PM, Brad Stone  wrote:
> 
>> I have an app in OS X that shares files with an app in iOS.  Because of 
>> security restrictions some information cannot be shared with iCloud.  I'd 
>> like to do it over a wire.  What are my alternatives?
> 
> In my day job at Couchbase, I’m developing one called TouchDB 
>  which is, in a nutshell, an embedded equivalent of 
> CouchDB, a popular NoSQL database with really good sync capabilities. You can 
> store data locally in TouchDB and then sync either to a CouchDB server you 
> run, or a hosted server, or even to another instance of TouchDB.
> 
> It’s being used by several shipping iOS apps already, with more in 
> development, and there’s an Android version in the works. (The iOS version 
> also runs fine on OS X.)
> 
> Another iOS sync library is Symperium (http://symperium.com).
> 
> —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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: Syncing w/o iCloud

2012-12-20 Thread Cody Garvin
Can always do bonjour. Or create your own serverside service. 



On Dec 20, 2012, at 6:47 PM, Brad Stone  wrote:

> I have an app in OS X that shares files with an app in iOS.  Because of 
> security restrictions some information cannot be shared with iCloud.  I'd 
> like to do it over a wire.  What are my alternatives?  If someone could point 
> me in the right direction I'd appreciate it.
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: iTunes 11 miniPlayer bug

2012-11-29 Thread Cody Garvin
Probably should submit an actual bug report vs here. 



On Nov 29, 2012, at 12:32 PM, "Eric E. Dolecki"  wrote:

> *12779305*
> .
> 
> If I open up the miniPlayer, play some music, I will see song title, etc.
> and when I roll over the player, I get transport controls. If I click
> anywhere in the player I then lose mouse out, and the transport controls
> ALWAYS display from that point on - I never see the metadata again. I quit
> iTunes and restart it - I get metaData again. I click anywhere in the
> miniPlayer and it loses ability to mouseOut again - leaving the transports
> up.
> 
> This needs fixed as it's a big usability problem.
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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: WWDC

2012-04-25 Thread Cody Garvin
I was able to get a ticket. On the west coast. I happened to just get done with 
my workout and saw the email. My email was dated at 6:30am pst. 



On Apr 25, 2012, at 10:32 AM, Nathan Sims  
wrote:

> The WWDC 2012 announcement email was dated April 25, 2012 7:04:42 AM PDT. 
> *No one* I know of was able to obtain a ticket.
> Maybe they need a raffle or some such?
> 
> 
> On Apr 25, 2012, at 10:19 AM, Rick Mann wrote:
> 
>> Is WWDC really sold out already? I just got the notification email...
>> 
>> -- 
>> Rick
>> 
> 
> ___
> 
> 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/cody%40servalsoft.com
> 
> This email sent to c...@servalsoft.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


Obtaining all points on a line segment

2010-11-22 Thread Cody Garvin
Hi all,

I searched back through 2005 in the Cocoa Mailing List and didn't see any 
requests for this.

We need all the points on a line / arc / path on the screen. We need to do hit 
detection on stroked line, so we must know if the point is valid or not. 

I thought using CGPathContainsPoint would work, but it must be done on a closed 
path or it returns true on all points in the test area. 

I also tried NSBezierPath containsPath: and , but it returned the exact same 
things as the CGPath functions. 

Another idea I have, though not sure if it will work, is converting the drawing 
to NSBitmapImageRep and using colorAtX:y to test for a specific color to test 
for a point.

The downside of this approach is you must test all the points in a bounding 
box, and could get quite large if our line segment is complicated.

I'm surprised I haven't found a convenience method to return all the points in 
an outline.

Any help would be greatly appreciated.

- Cody___

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