Re: Debugging -setNeedsDisplayInRect:

2012-08-06 Thread Nick Zitzmann

On Jul 27, 2012, at 10:36 AM, Curt Clifton  wrote:

> On Jul 27, 2012, at 8:55 AM, Nick Zitzmann  wrote:
> 
>> But I need to be able to see **all** invocations of the method from **all** 
>> NSViews to catch the culprit, because I have a rather complicated view 
>> hierarchy, including some views for which I don't have the source, and I 
>> don't know exactly which view is doing this. In order to do that, I need to 
>> set a conditional breakpoint, and this would be easy if an NSRect could be 
>> stored in a register, but how do I set a conditional breakpoint when the 
>> variable I want to investigate is on the stack? And where would I find each 
>> of the CGFloats on the stack?
> 
> For debugging, you might consider swizzling NSView's -setNeedsDisplayInRect: 
> to do the conditional logging that Markus suggested.


I usually don't like swizzling; it feels like black magic to me. But since it 
was just for debugging, this time I put on my blue robe and pointy yellow 
wizard hat anyway, and found and fixed the problem. Thanks.

Nick Zitzmann



___

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: 10.8 copiesOnScroll, -setNeedsDisplayInRect: ignored during scrolling

2012-08-06 Thread Kyle Sluder
On Mon, Aug 6, 2012, at 05:34 PM, Dave Keck wrote:
> > But Mike is still right; you're probably better served by using 
> > -performSelectorOnMainThread::: rather than waking the run loop up yourself.
> 
> I tend to disagree -- invoking CFRunLoopPerformBlock() and
> CFRunLoopWakeUp() is likely more performant since they're at the CF
> level (which -performSelectorOnMainThread eventually calls into), and
> a block-based API is more convenient. Furthermore,
> -performSelectorOnMainThread: wakes up the target run loop anyway by
> invoking CFRunLoopWakeUp().

You're thunking across a thread boundary; whatever performance
improvement you're imagining (unless you've already measured your
performance?) is certainly overshadowed by thread synchronization.

> 
> > Given that it's a private mode, I'm not sure you really want your code 
> > executing during the scroll event coalescing mode.
> 
> Agreed -- I wasn't using nor advocating NSScrollEventCoallescing.
> (Also note that calling CFRunLoopWakeUp() on the main thread while
> it's running in the NSScrollEventCoallescing mode won't cause it to
> execute the block passed to CFRunLoopPerformBlock(...,
> kCFRunLoopDefaultMode, ...) until the run loop is again running in the
> default mode.)

This is true; I overlooked this.

--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: 10.8 copiesOnScroll, -setNeedsDisplayInRect: ignored during scrolling

2012-08-06 Thread Dave Keck
> But Mike is still right; you're probably better served by using 
> -performSelectorOnMainThread::: rather than waking the run loop up yourself.

I tend to disagree -- invoking CFRunLoopPerformBlock() and
CFRunLoopWakeUp() is likely more performant since they're at the CF
level (which -performSelectorOnMainThread eventually calls into), and
a block-based API is more convenient. Furthermore,
-performSelectorOnMainThread: wakes up the target run loop anyway by
invoking CFRunLoopWakeUp().

> Given that it's a private mode, I'm not sure you really want your code 
> executing during the scroll event coalescing mode.

Agreed -- I wasn't using nor advocating NSScrollEventCoallescing.
(Also note that calling CFRunLoopWakeUp() on the main thread while
it's running in the NSScrollEventCoallescing mode won't cause it to
execute the block passed to CFRunLoopPerformBlock(...,
kCFRunLoopDefaultMode, ...) until the run loop is again running in the
default mode.)
___

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: Problem using UIGestureRecognizer

2012-08-06 Thread Quincey Morris
On Aug 6, 2012, at 16:11 , Laurent Daudelin  wrote:

> I found the problem after poking some more in Google. It is apparently a bug 
> in UIKit. To fix it, I created a strong property in my controller connected 
> to the UIGestureRecognizer and now, no more crash! So, the gesture 
> recognizer, if nobody retains it, will be released without telling anyone, 
> causing a random crash.

It's weird that "gestureRecognizers" shows up in IB at all. There's actually a 
syntax for this (IBOutletCollection), but I'd never heard of it until you 
brought up the subject and I did some searching.

Given that "gestureRecognizers" is not declared with this syntax, its 
appearance in IB seems like a bug -- it doesn't appear to be intended for as an 
outlet. (But what do I know about it -- maybe it is.)

Also, "gestureRecognizers" is declared "copy", which might have something to do 
with why the memory management gets messed up when nib loading tries to treat 
it as an outlet.


___

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: Problem using UIGestureRecognizer

2012-08-06 Thread Graham Cox

On 07/08/2012, at 9:11 AM, Laurent Daudelin  wrote:

> So, the gesture recognizer, if nobody retains it, will be released without 
> telling anyone, causing a random crash.


Doesn't that apply to any object? That's normal.

--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/archive%40mail-archive.com

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


Re: +underPageBackgroundColor

2012-08-06 Thread Graham Cox

On 07/08/2012, at 9:12 AM, Lee Ann Rucker  wrote:

> You could use an NSColorList, or take a cue from NSImage and have an [NSColor 
> colorNamed:]


I have both of these; the 'named' methods are really just an additional 
convenience. I'm not actually making use of them at present, so I've just added 
a conditional compilation flag around them for now.

--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/archive%40mail-archive.com

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


Re: +underPageBackgroundColor

2012-08-06 Thread Lee Ann Rucker

On Aug 6, 2012, at 3:38 PM, Graham Cox wrote:

> 
> On 07/08/2012, at 2:38 AM, Kevin Perry  wrote:
> 
>> A stab in the dark: Have you tried running with OBJC_PRINT_REPLACED_METHODS 
>> set? There's a small chance that you have code in your app or a library that 
>> you're linking that replaces via category a method implementation internal 
>> to AppKit that +underPageBackgroundColor relies on.
> 
> 
> Bingo! You nailed it
> 
> I have a category on NSColor that defines all the "named" SVG colours, and 
> there's one called 'linenColor'. In 10.8, there appears to be a private 
> method called +linenColor which is invoked by +underPageBackgroundColor, so 
> it calls my SVG method and I get my sRGB "chino" colour. Removing that method 
> it now works as expected.
> 
> Thanks!
> 
> I just need to figure a safer way to add my SVG named methods They aren't 
> really used for supporting SVG because mostly SVG colours are looked up by 
> parsing the name and using that to do a key-value lookup in a table.

You could use an NSColorList, or take a cue from NSImage and have an [NSColor 
colorNamed:]
___

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: Problem using UIGestureRecognizer

2012-08-06 Thread Laurent Daudelin
I found the problem after poking some more in Google. It is apparently a bug in 
UIKit. To fix it, I created a strong property in my controller connected to the 
UIGestureRecognizer and now, no more crash! So, the gesture recognizer, if 
nobody retains it, will be released without telling anyone, causing a random 
crash.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.com

On Aug 6, 2012, at 15:06, Quincey Morris  
wrote:

> On Aug 6, 2012, at 14:54 , Laurent Daudelin  wrote:
> 
>> Forgot to mention that I also tried to connect the gestureRecognizers outlet 
>> of the UIImageView to the gesture recognizer, making sure the one from the 
>> scrollview had been removed with same result….
> 
> a. The backtrace you posted doesn't provide any evidence of gesture 
> recognizers being involved with the crash. Looks more like a memory 
> management problem related to network activity.
> 
> b. The 'gestureRecognizers' property isn't an outlet. Connecting it to 
> something in IB seems like a bad idea. (It doesn't seem completely 
> impossible, though, that this is the actual source of your memory management 
> 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/archive%40mail-archive.com

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

Re: gesture

2012-08-06 Thread Quincey Morris
On Aug 6, 2012, at 15:36 , Flavio Donadio  wrote:

> Luca,
> 
> The direction is where the swipe ends. UISwipeGestureRecognizerDirectionRight 
> is for left-to-right.
> 
> Cheers,
> Flavio
> 
> On 06/08/2012, at 16:00, cocoa-dev-requ...@lists.apple.com wrote:
> 
>> Hi All.
>> Probably my problem is very stupid with a very immediate answer, but I'm 
>> very new using storyboard.
>> 
>> I've have 2 pages. in the first page I've the following code:
>> 
>> @property(strong, nonatomic) IBOutlet UISwipeGestureRecognizer 
>> *swipeGestureNext;
>> 
>> 1)  swipeGestureNext = [[UISwipeGestureRecognizer alloc] initWithTarget:self 
>> action:nil];
>> 2)  [swipeGestureNext setDirection:UISwipeGestureRecognizerDirectionLeft];
>> 3)  [[self view] addGestureRecognizer:swipeGestureNext];
>> 
>> Then I've used a "Swipe Gesture Recognizer" (connected with 
>> swipeGestureNext) and I've connected it, in the storyboard, with the second 
>> page.

There's a deeper problem in the above code. 'swipeGestureNext' is declared as 
an outlet, and Luca says there's an object connected to it in IB. In that case, 
the property's 'swipeGestureNext' ivar should not be set in code, and 
especially not to a new instance of the gesture recognizer.

There are 2 gesture recognizers dueling for possession of the outlet here, and 
one of them is going to lose.


___

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: Problem using UIGestureRecognizer

2012-08-06 Thread Laurent Daudelin
Yeah, that's the problem, the backtrace doesn't show any code related to my 
gesture recognizers. But as soon as I delete it from my storyboard, the problem 
vanishes. I've done it 3 times now so I'm pretty sure the gesture recognizers 
is somehow causing a random crash.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.com

On Aug 6, 2012, at 15:54, Laurent Daudelin  wrote:

> Hell Quincey.
> 
> So, how are you supposed to use those IB UIGestureRecognizers in IB? I 
> haven't seen any example that shows how to use them. Even the ScrollSuite 
> sample "TapToZoom" doesn't use them but build them programmatically. I mean, 
> I don't mind coding them but I thought I'd rather use them right there, from 
> the IB palette.
> 
> -Laurent.
> -- 
> Laurent Daudelin
> AIM/iChat/Skype:LaurentDaudelin   
> http://www.nemesys-soft.com/
> Logiciels Nemesys Software
> laur...@nemesys-soft.com
> 
> On Aug 6, 2012, at 15:06, Quincey Morris 
>  wrote:
> 
>> On Aug 6, 2012, at 14:54 , Laurent Daudelin  wrote:
>> 
>>> Forgot to mention that I also tried to connect the gestureRecognizers 
>>> outlet of the UIImageView to the gesture recognizer, making sure the one 
>>> from the scrollview had been removed with same result….
>> 
>> a. The backtrace you posted doesn't provide any evidence of gesture 
>> recognizers being involved with the crash. Looks more like a memory 
>> management problem related to network activity.
>> 
>> b. The 'gestureRecognizers' property isn't an outlet. Connecting it to 
>> something in IB seems like a bad idea. (It doesn't seem completely 
>> impossible, though, that this is the actual source of your memory management 
>> 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/archive%40mail-archive.com

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

Re: Problem using UIGestureRecognizer

2012-08-06 Thread Laurent Daudelin
Hell Quincey.

So, how are you supposed to use those IB UIGestureRecognizers in IB? I haven't 
seen any example that shows how to use them. Even the ScrollSuite sample 
"TapToZoom" doesn't use them but build them programmatically. I mean, I don't 
mind coding them but I thought I'd rather use them right there, from the IB 
palette.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.com

On Aug 6, 2012, at 15:06, Quincey Morris  
wrote:

> On Aug 6, 2012, at 14:54 , Laurent Daudelin  wrote:
> 
>> Forgot to mention that I also tried to connect the gestureRecognizers outlet 
>> of the UIImageView to the gesture recognizer, making sure the one from the 
>> scrollview had been removed with same result….
> 
> a. The backtrace you posted doesn't provide any evidence of gesture 
> recognizers being involved with the crash. Looks more like a memory 
> management problem related to network activity.
> 
> b. The 'gestureRecognizers' property isn't an outlet. Connecting it to 
> something in IB seems like a bad idea. (It doesn't seem completely 
> impossible, though, that this is the actual source of your memory management 
> 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/archive%40mail-archive.com

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

Re: +underPageBackgroundColor

2012-08-06 Thread Graham Cox

On 07/08/2012, at 2:38 AM, Kevin Perry  wrote:

> A stab in the dark: Have you tried running with OBJC_PRINT_REPLACED_METHODS 
> set? There's a small chance that you have code in your app or a library that 
> you're linking that replaces via category a method implementation internal to 
> AppKit that +underPageBackgroundColor relies on.


Bingo! You nailed it

I have a category on NSColor that defines all the "named" SVG colours, and 
there's one called 'linenColor'. In 10.8, there appears to be a private method 
called +linenColor which is invoked by +underPageBackgroundColor, so it calls 
my SVG method and I get my sRGB "chino" colour. Removing that method it now 
works as expected.

Thanks!

I just need to figure a safer way to add my SVG named methods They aren't 
really used for supporting SVG because mostly SVG colours are looked up by 
parsing the name and using that to do a key-value lookup in a table.

--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/archive%40mail-archive.com

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


Re: gesture

2012-08-06 Thread Flavio Donadio
Luca,


The direction is where the swipe ends. UISwipeGestureRecognizerDirectionRight 
is for left-to-right.


Cheers,
Flavio

On 06/08/2012, at 16:00, cocoa-dev-requ...@lists.apple.com wrote:

> Hi All.
> Probably my problem is very stupid with a very immediate answer, but I'm very 
> new using storyboard.
> 
> I've have 2 pages. in the first page I've the following code:
> 
> @property(strong, nonatomic) IBOutlet UISwipeGestureRecognizer 
> *swipeGestureNext;
> 
> 1)  swipeGestureNext = [[UISwipeGestureRecognizer alloc] initWithTarget:self 
> action:nil];
> 2)  [swipeGestureNext setDirection:UISwipeGestureRecognizerDirectionLeft];
> 3)  [[self view] addGestureRecognizer:swipeGestureNext];
> 
> Then I've used a "Swipe Gesture Recognizer" (connected with swipeGestureNext) 
> and I've connected it, in the storyboard, with the second page.
> 
> My problem is that the only direction recognised is from right to left.
> 
> Where is my mistake?
> 
> Thanks for any answer.
> 
> Luca.


___

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: Problem using UIGestureRecognizer

2012-08-06 Thread Quincey Morris
On Aug 6, 2012, at 14:54 , Laurent Daudelin  wrote:

> Forgot to mention that I also tried to connect the gestureRecognizers outlet 
> of the UIImageView to the gesture recognizer, making sure the one from the 
> scrollview had been removed with same result….

a. The backtrace you posted doesn't provide any evidence of gesture recognizers 
being involved with the crash. Looks more like a memory management problem 
related to network activity.

b. The 'gestureRecognizers' property isn't an outlet. Connecting it to 
something in IB seems like a bad idea. (It doesn't seem completely impossible, 
though, that this is the actual source of your memory management 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/archive%40mail-archive.com

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

Re: Problem using UIGestureRecognizer

2012-08-06 Thread Laurent Daudelin
Forgot to mention that I also tried to connect the gestureRecognizers outlet of 
the UIImageView to the gesture recognizer, making sure the one from the 
scrollview had been removed with same result….

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.com

On Aug 6, 2012, at 14:38, Laurent Daudelin  wrote:

> Hello.
> 
> I found a few examples of creating UIGestureRecognizer programmatically but 
> since they're in IB now, I thought why not using them there. So, I have an 
> Xcode 4.4 iOS 5.1 project using ARC with a UITableViewCell that contains a 
> UIScrollView, among other things, which scrollview contains an UIImageView. I 
> want the user to be able to zoom the image view, obviously. So, I dragged an 
> instance of UIGestureRecognizer into my controller's segue (scene?). I then 
> connected its action to an action method in my view controller. I then 
> dragged a connection from the scrollview to the gesture recognizer and 
> connected it to the gestureRecognizers of the scrollview. Everything seems to 
> be OK. But when I launch my app in the simulator, as soon as the view is to 
> appear, it crashes more or less randomly with:
> 
> * thread #1: tid = 0x1c03, 0x0124509b libobjc.A.dylib`objc_msgSend + 15, stop 
> reason = EXC_BAD_ACCESS (code=1, address=0x5f6e6511)
>frame #0: 0x0124509b libobjc.A.dylib`objc_msgSend + 15
>frame #1: 0x01448435 CoreFoundation`CFRelease + 117
>frame #2: 0x01ebb968 CFNetwork`XConnectionEventQueue XClientEventParams>::~XConnectionEventQueue() + 126
>frame #3: 0x01f908e9 
> CFNetwork`URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo  XClientEventParams>*, long) + 1351
>frame #4: 0x01eba298 CFNetwork`URLConnectionClient::processEvents() + 174
>frame #5: 0x01f9016b CFNetwork`non-virtual thunk to 
> URLConnectionInstanceData::multiplexerClientPerform() + 21
>frame #6: 0x01eba137 CFNetwork`MultiplexerSource::perform() + 259
>frame #7: 0x0151097f 
> CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
>frame #8: 0x01473b73 CoreFoundation`__CFRunLoopDoSources0 + 243
>frame #9: 0x01473454 CoreFoundation`__CFRunLoopRun + 1012
>frame #10: 0x01472db4 CoreFoundation`CFRunLoopRunSpecific + 212
>frame #11: 0x01472ccb CoreFoundation`CFRunLoopRunInMode + 123
>frame #12: 0x02341879 GraphicsServices`GSEventRunModal + 207
>frame #13: 0x0234193e GraphicsServices`GSEventRun + 114
>frame #14: 0x003a2a9b UIKit`UIApplicationMain + 1175
>frame #15: 0x282d Erodr`main + 141 at main.m:16
> 
> The gesture recognizers is configured with 1 tap, 1 touch, state enabled, 
> events canceled in View, delayed begin and delayed end.
> 
> What am I missing?
> 
> -Laurent.


___

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

Problem using UIGestureRecognizer

2012-08-06 Thread Laurent Daudelin
Hello.

I found a few examples of creating UIGestureRecognizer programmatically but 
since they're in IB now, I thought why not using them there. So, I have an 
Xcode 4.4 iOS 5.1 project using ARC with a UITableViewCell that contains a 
UIScrollView, among other things, which scrollview contains an UIImageView. I 
want the user to be able to zoom the image view, obviously. So, I dragged an 
instance of UIGestureRecognizer into my controller's segue (scene?). I then 
connected its action to an action method in my view controller. I then dragged 
a connection from the scrollview to the gesture recognizer and connected it to 
the gestureRecognizers of the scrollview. Everything seems to be OK. But when I 
launch my app in the simulator, as soon as the view is to appear, it crashes 
more or less randomly with:

* thread #1: tid = 0x1c03, 0x0124509b libobjc.A.dylib`objc_msgSend + 15, stop 
reason = EXC_BAD_ACCESS (code=1, address=0x5f6e6511)
frame #0: 0x0124509b libobjc.A.dylib`objc_msgSend + 15
frame #1: 0x01448435 CoreFoundation`CFRelease + 117
frame #2: 0x01ebb968 CFNetwork`XConnectionEventQueue::~XConnectionEventQueue() + 126
frame #3: 0x01f908e9 
CFNetwork`URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo*, long) + 1351
frame #4: 0x01eba298 CFNetwork`URLConnectionClient::processEvents() + 174
frame #5: 0x01f9016b CFNetwork`non-virtual thunk to 
URLConnectionInstanceData::multiplexerClientPerform() + 21
frame #6: 0x01eba137 CFNetwork`MultiplexerSource::perform() + 259
frame #7: 0x0151097f 
CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
frame #8: 0x01473b73 CoreFoundation`__CFRunLoopDoSources0 + 243
frame #9: 0x01473454 CoreFoundation`__CFRunLoopRun + 1012
frame #10: 0x01472db4 CoreFoundation`CFRunLoopRunSpecific + 212
frame #11: 0x01472ccb CoreFoundation`CFRunLoopRunInMode + 123
frame #12: 0x02341879 GraphicsServices`GSEventRunModal + 207
frame #13: 0x0234193e GraphicsServices`GSEventRun + 114
frame #14: 0x003a2a9b UIKit`UIApplicationMain + 1175
frame #15: 0x282d Erodr`main + 141 at main.m:16

The gesture recognizers is configured with 1 tap, 1 touch, state enabled, 
events canceled in View, delayed begin and delayed end.

What am I missing?

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.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: setting font

2012-08-06 Thread Fritz Anderson
On 6 Aug 2012, at 3:05 AM, Luca Ciciriello  wrote:

> I'm trying to set a specific font in my UITextView.
> 
> The font is Chalkboard SE Regular and my code is 
> 
> [[self textView] setFont:[UIFont fontWithName:@"Chalkboard se regular" 
> size:39.0f]];
> 
> but nothing appear un my UITextView.
> 
> Where is my mistake?

It's the wrong name; it should be ChalkboardSE-Regular. I'm not sure there is 
much of a rule that maps between font names and their human-readable families. 
This useful site:  lists all available fonts in iOS. The 
names in the first column of the table are the ones you should use.

— F

-- 
Fritz Anderson -- Xcode 4 Unleashed: Now in stores! -- 



___

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

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

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

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

Re: setting font

2012-08-06 Thread Luca Ciciriello
Thanks, You are right. My problem was in the name of the font 
(@"ChalkboardSE-Regular")

Luca.


On Aug 6, 2012, at 7:30 PM, Jens Alfke  wrote:

> 
> On Aug 6, 2012, at 1:05 AM, Luca Ciciriello  
> wrote:
> 
>> [[self textView] setFont:[UIFont fontWithName:@"Chalkboard se regular" 
>> size:39.0f]];
> 
> Make sure that UIFont call isn't returning nil. In my experience, APIs that 
> look up fonts by name are very picky about the name (for instance, you 
> lowercased "SE" and didn't capitalize "Regular"). Moreover, the internal name 
> may not match the displayed name.
> 
> —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: setting font

2012-08-06 Thread Jens Alfke

On Aug 6, 2012, at 1:05 AM, Luca Ciciriello  wrote:

> [[self textView] setFont:[UIFont fontWithName:@"Chalkboard se regular" 
> size:39.0f]];

Make sure that UIFont call isn't returning nil. In my experience, APIs that 
look up fonts by name are very picky about the name (for instance, you 
lowercased "SE" and didn't capitalize "Regular"). Moreover, the internal name 
may not match the displayed name.

—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

gesture

2012-08-06 Thread Luca Ciciriello
Hi All.
Probably my problem is very stupid with a very immediate answer, but I'm very 
new using storyboard.

I've have 2 pages. in the first page I've the following code:

@property(strong, nonatomic) IBOutlet UISwipeGestureRecognizer 
*swipeGestureNext;

1)  swipeGestureNext = [[UISwipeGestureRecognizer alloc] initWithTarget:self 
action:nil];
2)  [swipeGestureNext setDirection:UISwipeGestureRecognizerDirectionLeft];
3)  [[self view] addGestureRecognizer:swipeGestureNext];

Then I've used a "Swipe Gesture Recognizer" (connected with swipeGestureNext) 
and I've connected it, in the storyboard, with the second page.

My problem is that the only direction recognised is from right to left.

Where is my mistake?

Thanks for any answer.

Luca.


___

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: +underPageBackgroundColor

2012-08-06 Thread Kevin Perry
A stab in the dark: Have you tried running with OBJC_PRINT_REPLACED_METHODS 
set? There's a small chance that you have code in your app or a library that 
you're linking that replaces via category a method implementation internal to 
AppKit that +underPageBackgroundColor relies on.

Also, it might be interesting to turn on MallocStackLoggingNoCompact and 
finding out the backtrace of the creation of that NSColor object.

-KP

On Aug 5, 2012, at 11:06 PM, Graham Cox  wrote:

> I've tried just drawing this colour to a plain view, and I get no texture, 
> just a pale "chino" sort of colour. Looking at what I get from this method in 
> the debugger:
> 
> (NSColor *) $1 = 0x00010983f850 NSCustomColorSpace sRGB IEC61966-2.1 
> colorspace 0.980392 0.941176 0.901961 1
> 
> 
> This seems to be the colour I'm seeing. I would not really expect it to be in 
> the sRGB colorspace, but the real giveaway is this - if I ask this colour for 
> its -patternImage, it throws an exception, just as the documentation says it 
> will IF IT HAS NO PATTERN IMAGE. Something's gone wrong delivering this 
> colour to my app from the internals of Cocoa. But what?
> 
> 
> 2012-08-06 16:02:17.068 Artboard[22765:303] *** -patternImage not valid for 
> the NSColor NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0.980392 0.941176 
> 0.901961 1; need to first convert colorspace.
> 2012-08-06 16:02:17.071 Artboard[22765:303] (
>   0   CoreFoundation  0x7fff882e9716 
> __exceptionPreprocess + 198
>   1   libobjc.A.dylib 0x7fff8bfb5470 
> objc_exception_throw + 43
>   2   CoreFoundation  0x7fff882e94ec 
> +[NSException raise:format:] + 204
>   3   AppKit  0x7fff81b09948 -[NSColor 
> patternImage] + 66
> 
> 
> My code:
> 
>   NSColor* bkg = [NSColor underPageBackgroundColor];
>   NSImage* patImg = [bkg patternImage];
> 
> 
> 
> --Graham
> 
> 
> 
> 
> 
> 
> 
> On 04/08/2012, at 6:51 PM, Marcus Karlsson  wrote:
> 
> 
>> I'm getting the pattern when I use it with -setBackgroundColor: on a
>> scrollview. What do you get if you try it on an empty scrollview,
>> perhaps in a new project just in case there's something else that
>> prevents it from drawing?
>> 
>> Marcus
>> 
> 
> 
> ___
> 
> 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/kperry%40apple.com
> 
> This email sent to kpe...@apple.com


___

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

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

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

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


Re: Mountain Lion problems with orderFrontColorPanel:

2012-08-06 Thread Uli Kusterer
On Aug 3, 2012, at 6:21 AM, Graham Cox  wrote:
> On 03/08/2012, at 2:14 PM, Andreas Mayer  wrote:
>> Am 03.08.2012 um 03:41 schrieb Graham Cox :
>> 
>>> Has anyone else experienced issues with the Color Panel not showing in 
>>> Mountain Lion?
>> 
>> Working fine here.
> 
> Working fine here too... that's the problem, it's just some users who are 
> experiencing this, and we haven't got any useful data yet to pin it down 
> (sadly, users typically whinge at you to fix a problem but don't send 
> anything you can work with, like a crash report or logging output).
> 
> Since it seems to be affecting a wide variety of users (though still a small 
> minority) there ought to be some reason for it, which is why I wondered if 
> anyone else had seen this.

Custom color picker plug-in gone rogue maybe? System Profiler would be helpful 
for something like that.

Failing that, anything slightly unusual you do with window ordering (window 
levels?) placement or the likes? Maybe something's subtly changed there and the 
colour picker opens, but behind another window, or offscreen?

I think there are also haxies that let you change the level at which a 
particular window is shown that could be made to cause this. Wasn't that a 
feature of WindowShade?

Just my €0.02.
-- Uli
___

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: 10.8 copiesOnScroll, -setNeedsDisplayInRect: ignored during scrolling

2012-08-06 Thread Kyle Sluder
On Aug 6, 2012, at 2:44 AM, Dave Keck  wrote:

>> Right, so what you actually want to do is change how you’re messaging the 
>> main thread. Use something like 
>> -performSelectorOnMainThread:withObject:waitUntilDone:modes: so you can 
>> specify NSDefaultRunLoopMode and NSScrollEventCoallescing.
> 
> NSScrollEventCoallescing is a private run loop mode so I'd avoid using
> it since the Cocoa machinery is completely within its rights to assume
> that no outside sources/timers/observers fire in that mode. (Just
> wanted to mention it since I've been bitten by related issues before.)

But Mike is still right; you're probably better served by using 
-performSelectorOnMainThread::: rather than waking the run loop up yourself.

Given that it's a private mode, I'm not sure you really want your code 
executing during the scroll event coalescing mode. Of course since it's private 
we don't know exactly what's going on during this mode. My best guess is that 
-[NSEvent trackSwipeEventWithOptions:…] runs this mode periodically for short, 
defined periods of time to catch cases where the user flicks the trackpad and 
then puts their finger back down to stop momentum scrolling or change its 
direction.

Regardless of what it's doing, the more I think about it the more I think Apple 
should document this mode. Since scroll event coalescing is related to the main 
dispatch queue not being drained, scrolling's use of the run loop seems like 
something that really needs to be documented in full.

Perhaps file an enhancement request and a doc bug?

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

Debugging a spotlight importer problem

2012-08-06 Thread Gideon King
I have a spotlight importer that works just fine when I run mdimport from the 
command line, but it fails with a sig11 when it runs automatically. 

I've tested it on two machines under 10.7 and 10.8, with the same results.

Can anyone give any tips on how to debug this situation?

Thanks

Gideon









___

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


Customizing the PKG deploy UI workflow Screens

2012-08-06 Thread Sachin Porwal
Hi All,

Presently I am working on authoring a PKG bundle for our application.
When a default PKG is deployed in UI workflow, the various default
screens are shown, even if I configure the PKG in PackageMaker for
minimal interaction (Welcome, Install location, summary screen,...).
My application is hard-bound to install to a specific location. Can I
reduce the number of screens in the Workflow to just one. Also I would
like to customize the screen layout/controls as per my needs. Is there
a way to achieve this?

Thanks for your help in advance. Much appreciated.

Thanks,
Sachin
___

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: 10.8 copiesOnScroll, -setNeedsDisplayInRect: ignored during scrolling

2012-08-06 Thread Dave Keck
> Right, so what you actually want to do is change how you’re messaging the 
> main thread. Use something like 
> -performSelectorOnMainThread:withObject:waitUntilDone:modes: so you can 
> specify NSDefaultRunLoopMode and NSScrollEventCoallescing.

NSScrollEventCoallescing is a private run loop mode so I'd avoid using
it since the Cocoa machinery is completely within its rights to assume
that no outside sources/timers/observers fire in that mode. (Just
wanted to mention it since I've been bitten by related issues before.)

___

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: 10.8 copiesOnScroll, -setNeedsDisplayInRect: ignored during scrolling

2012-08-06 Thread Mike Abdullah

On 5 Aug 2012, at 03:00, Dave Keck wrote:

>> I'm unsure of the wisdom of this approach. Presumably the scroll view is 
>> intentionally blocking the runloop, and thus assuming that the runloop will 
>> not fire its event sources until after the scrolling is complete. By waking 
>> up the runloop, you're violating that assumption and could be causing work 
>> the scrollview has enqueued to be performed sooner than expected.
> 
> During a single scrolling maneuver in 10.8.0, the run loop toggles
> many times between NSDefaultRunLoopMode and NSScrollEventCoallescing.
> I suppose I could check whether the main run loop is in the default
> mode before waking it up, but the overheard of that likely defeats the
> purpose, especially considering the inherent race condition. In the
> end, waking the main thread up at the wrong time (while it's in
> NSScrollEventCoallescing) probably wastes a mach_msg_send, a
> mach_msg_receive, and 20 instructions as the scrolling machinery sees
> that there's no new event and goes back to sleep or times-out and
> returns to the NSApplication loop.

Right, so what you actually want to do is change how you’re messaging the main 
thread. Use something like 
-performSelectorOnMainThread:withObject:waitUntilDone:modes: so you can specify 
NSDefaultRunLoopMode and NSScrollEventCoallescing.
___

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

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

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

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

setting font

2012-08-06 Thread Luca Ciciriello
Hi All.
I'm trying to set a specific font in my UITextView.

The font is Chalkboard SE Regular and my code is 

[[self textView] setFont:[UIFont fontWithName:@"Chalkboard se regular" 
size:39.0f]];

but nothing appear un my UITextView.

Where is my mistake?

Luca.
___

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