No TCP connection established after ARP request

2010-12-21 Thread Remco Poelstra

Hi,


I hope this is not too much off topic, but my iPhone app tries to
establish a TCP connection over Wifi.
I noticed that sometimes (about 30% of the attempts), a connection is
refused. I do see an ARP request, but there is no TCP SYN packet
following after the answer. Is this a bug in iOS? How can I make sure
that the ARP request is not needed? Or can I automatically resend the
TCP SYN packet?
Thanks in advance for any ideas.

Kind regards,

Remco Poelstra


___

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


UKKQueue and CVS

2010-12-21 Thread Martin Hewitson
Dear list,

I have implemented an editor where I use UKKQueue to handle changes to the file 
by other apps. The problem is that I don't get a notification if the file is 
committed to a CVS repository (or an SVN repository, for that matter). Looking 
at the file on disk, CVS does change the file because it updates the $Id:$ tag. 
 If I change the file on disk with, for example, vi, then I get the 
notification. So why not when CVS makes the change? What's more, if I save the 
file in the editor then the contents of the file on disk are not updated. It 
seems like CVS has moved my file somewhere else but the OS knows about that. 

For the UKKQueue experts, I initialise my path watcher like this:

UKKQueue *queue = [UKKQueue sharedFileWatcher];
[queue addPathToQueue: [aDoc pathOnDisk]
  notifyingAbout: UKKQueueNotifyAboutWrite];

I suspect that I'm not understanding something fundamental about how the OS is 
handling files and/or how CVS interacts with that. 

Any insights gratefully received,

Martin



Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer 
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: martin.hewit...@aei.mpg.de
WWW: http://www.aei.mpg.de/~hewitson






___

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


Text display consistency

2010-12-21 Thread Kenneth Baxter

Hi, I have an application that needs to display text on both Mac OS X and on 
iOS. I'm sticking to core technologies for my drawing and drawing all my stuff 
into cgcontexts for maximum portability.

I sometimes need the user to edit the text, so am planning to add a subview 
(NSTextView / UITextView) when the user needs to edit the text.

What is the best way to minimize the customization for the two versions of the 
application, and ensure that when I put the text view over the top, that it is 
exactly the same size and shape (kerning/wrapping etc) when drawn in the text 
view and when drawn directly in the cg context?

Any gotcha's I should know about?

TIA

Ken.
___

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


Text rendering/editing on OSX iOS

2010-12-21 Thread Kenneth Baxter

Hi, I have an application which I plan to roll out on both iOS and MacOS X, and 
it needs to display text in various places on a series of views. I am doing all 
the drawing using the Core technologies (CGContext drawing) to make the maximum 
reuse of code. I've done most of the graphical stuff and am just moving on to 
the text.

Sometimes the user needs to edit the text, so I am planning to add a subview 
(NSTextView / UITextView) while they are editing, but I need to be sure that 
it's going to be exactly the same rendering size, position, wrapping etc. 
between the text views and the core drawing.

Is there anything special I need to look out for to ensure that it's the same? 
Is this the best way for me to achieve my goal of maximum reuse and seamless 
switching between the drawn text and the text view for editing?

TIA

Ken.
___

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

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

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

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


Re: Text rendering/editing on OSX iOS

2010-12-21 Thread Ricky Sharp

On Dec 21, 2010, at 7:04 AM, Kenneth Baxter wrote:

 Hi, I have an application which I plan to roll out on both iOS and MacOS X, 
 and it needs to display text in various places on a series of views. I am 
 doing all the drawing using the Core technologies (CGContext drawing) to make 
 the maximum reuse of code. I've done most of the graphical stuff and am just 
 moving on to the text.

You should probably re-evaluate your approach.  While it may be absolutely 
necessary in your case to step down to a low level, you may find it better to 
use higher-level platform-specific code.

For my main application, the only code that is truly shared are model objects 
and to some extent, certain types of support controllers.  All view code and 
the majority of controller code is completely different.  And, for iOS, it's 
often the case where controllers and/or views are further different between 
iPad vs. iPhone/iPod touch.

Another huge difference in my app is that the Mac OS X code leverages massive 
amounts of bindings.  That simply doesn't exist in iOS.  Thankfully, the 
relevant bindings code in my models (e.g. keyPathsForValuesAffectingFoo) are  
easily ifdef'd out when compiling on iOS.

 Sometimes the user needs to edit the text, so I am planning to add a subview 
 (NSTextView / UITextView) while they are editing, but I need to be sure that 
 it's going to be exactly the same rendering size, position, wrapping etc. 
 between the text views and the core drawing.
 
 Is there anything special I need to look out for to ensure that it's the 
 same? Is this the best way for me to achieve my goal of maximum reuse and 
 seamless switching between the drawn text and the text view for editing?


I'm not sure what you mean by it's the same.  Do you mean pixel for pixel 
accuracy between Mac OS X and iOS?  I don't thing that may be possible (at 
least at a high level) as there may be different rendering techniques.  Default 
fonts between the systems are different and perhaps there's also subtle 
anti-aliasing differences, etc. Also, iPhone 4 introduced the Retina display, 
so output on such screens will provide much higher-quality output.

Behaviors in the UI between both systems are also very different, so attempting 
to share code to manage behaviors will prove to be problematic.
___
Ricky A. Sharp mailto:rsh...@instantinteractive.com
Instant Interactive(tm)   http://www.instantinteractive.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Improving drawing of UIView with many many Subviews

2010-12-21 Thread Gustavo Adolfo Pizano
Hello all.

I have a problem, Im encoding many subviews of class CustomUIView,
each of it  draws a CGImageRef, now, the encoding part its great,
fast.  Also decoding,

It decodes great each sub class. but then when I add the custom view
to the parent view the nightmare starts.

this is my method that unarchive the subviews and then add each one to
the parent view:


-(void)unarchiveItemsInScene:(NSKeyedUnarchiver *)unarchiver{

NSDictionary * itemsDic = [[unarchiver
decodeObjectForKey:@BCItemsInSceneKey] retain];
[self setBc_background:[unarchiver
decodeObjectForKey:@BCSceneBackgroundKey]];
[bc_bgImageview setNeedsDisplay];
[unarchiver finishDecoding];
//Adding the elements to the scene
//Organizing the keys so the order will be constant
NSArray * keys =[self bubbleSortDictionaryByKeys:itemsDic];
for (NSString * actualKey in keys) {
BCItemView * item = [itemsDic valueForKey:actualKey];
item.bc_parentScene = self;
[bc_itemsView addSubview:item];
}
[itemsDic release];
bc_sceneHasChanges = NO;
[self setNeedsDisplay];

}


and this is the drawrect method of the BCItemView

// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code.

CGContextRef context = UIGraphicsGetCurrentContext();   
CGContextSaveGState(context);
CGContextTranslateCTM(context, 0, CGImageGetHeight(bc_itemImage));
CGContextScaleCTM(context, 1.0, -1.0);
CGContextDrawImage(context, self.bounds, bc_itemImage);
CGContextRestoreGState(context);

}

Running Time profiler, its telling me that the 100% of time its spend
on the CGContextDrawImage method.

So the symptoms are :  I encode the superview's BCItemsView ( which
can be mane many or not) if they aren't many subviews the loading
process is done fast. BUT they are many, the app decodes fast, and I
see the a progress indicator showing the values as expected, but
suddenly everything seems to freeze and it takes a long time like 15
-20 seconds until the whole Parent view displays all its superviews.

is there anything I can do in order to improve the drawing
performance, or at least be able to keep progressing the indicator to
show the user that something is running? because this last thing I
tried but the progress indicator just disappears.. or doesn't' move at
all.

Thank you very much for any help.

Regards
Gustavo
___

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

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

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

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


Re: Text rendering/editing on OSX iOS

2010-12-21 Thread Kenneth Baxter

Thanks Ricky, this is a very drawing-heavy application, so I think it's 
probably worth a little pain to get it mostly drawing cross platform, and then 
wrap the platform specific UI around that. I'm mostly there with that approach.

Being the same refers to the size, position, rendering between core graphics 
and the text view on a specific operating system/device - it does not need to be pixel 
perfect the same between a Mac and an iPad

Regards

Ken

PS apologies to everyone for the double posting before - Firefox 4 beta + 
Me.com = crash and message not showing up as sent even though it was.


On 22 Dec, 2010,at 12:29 AM, Ricky Sharp rsh...@mac.com wrote:



I'm not sure what you mean by it's the same. Do you mean pixel for pixel 
accuracy between Mac OS X and iOS? I don't thing that may be possible (at least at a high 
level) as there may be different rendering techniques. Default fonts between the systems 
are different and perhaps there's also subtle anti-aliasing differences, etc. Also, 
iPhone 4 introduced the Retina display, so output on such screens will provide much 
higher-quality output.


___

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

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

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

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


Re: No TCP connection established after ARP request

2010-12-21 Thread Fritz Anderson
On 21 Dec 2010, at 3:53 AM, Remco Poelstra wrote:

 I hope this is not too much off topic, but my iPhone app tries to
 establish a TCP connection over Wifi.

You may have better luck on the macnetworkprog list. Despite the historical 
name, it covers Darwin networking on all platforms.

— F

___

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

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

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

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


Re: Performance: Drawing hundreds of short text strings

2010-12-21 Thread tra...@postfl.com
Hi Mike,

Seconding Sherm and Joar, this will be the easiest way to get started. Down the 
line, if that doesn't work, have a look at Core Text.

Also, I have been developing an application for drawing with text. I draw a few 
hundred individual letters at a time, then commit them to a graphics context so 
that the next time the whole view is drawn, one context is drawn rather than 1 
context + n letters.

T


On 2010-12-21, at 12:04 AM, Sherm Pendley wrote:

 On Mon, Dec 20, 2010 at 11:53 PM, Joar Wingfors j...@joar.com wrote:
 
 On 20 dec 2010, at 01.22, Mark Coniglio wrote:
 
 My application needs to draw hundreds of short text strings into an NSView. 
 After reviewing the Cocoa documentation on drawing text, I am left unsure 
 as to how to do this with the highest level of efficiency.
 
 Don't optimize in the dark! Implement something in the most straight forward 
 way you can imagine, and then measure the performance. If you find that it 
 doesn't perform well enough, use your measurements to guide you to a better 
 implementation. I don't think that we have enough information yet to provide 
 really good suggestions.
 
 Seconded. The NSString convenience methods are the easiest, most
 straightforward way, so I'd try those first. If and only if they
 didn't perform well enough, then I'd start looking for a
 better-performing alternative.
 
 sherm--
 
 -- 
 Cocoa programming in Perl:
 http://camelbones.sourceforge.net
 ___
 
 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/travis%40postfl.com
 
 This email sent to tra...@postfl.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Recovering from a merge conflict

2010-12-21 Thread Fritz Anderson
On 21 Dec 2010, at 8:36 AM, Paulo Andrade wrote:

 int tries = 10;
 while ( tries-- ) {
   // compute this batch
 
  [moc save:error];
  if (error != nil  [error code] == NSManagedObjectMergeError) {

This may not be your main problem, but you should never inspect a returned 
error object unless the method that returned it reports a failure:

if (! [moc save: error]  [error code] == NSManagedObjectMergeError) {
...

Such methods are free to set the error object at their start, in case they 
fail, but the error is correct only if the method does fail.

— F

___

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

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

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

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


Re: access multiple NSTextFields as an array?

2010-12-21 Thread Leonardo
You can quickly iterate (and read) the array that way

for(NSTextField* aField in fieldsArray){
[aField  doSomething];
}

So you don't need to count the items and iterate.

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Performance: Drawing hundreds of short text strings

2010-12-21 Thread Leonardo
You could create an array of objects grouping the parameters of your strings
For example:

typedef struct
{
NSAttributedString*text; // it already contains color and font
NSPoint position;
} MyObj;

Or you can even create your own class MyObj
The you create the array containing a bunch of these objects MyObj

NSMutableArray  *mStrings = [[NSMutableArray array] retain];

for(i = 0; i  totStrings; i++){
create the object MyObj
set string, color and positions
add to the array
[mStrings addObject:anObj];
}

Then on the drawRect: method of your NSView you iterate through the array
mStrings and draw the strings with their parameters.

- (void)drawRect:(NSRect)rect
{
[super drawRect:rect];

for(anObj in mStrings ){
[anObj.text drawAtPoint:anObj.position];
}
}


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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Waiting for UIWebView with Dispatch Semaphores

2010-12-21 Thread Jeff Kelley
I’m trying to create a synchronous method on iOS (4.2.1) to create a
thumbnail image for a PowerPoint file. To accomplish this, I want to
load the file into a web view, then wait for it to load, then render
its context into a new graphics context and save it to an image.
Here’s what I have so far:

http://pastie.org/1395434

I’ve tried adding the web view as a subview of the UIWindow to force
it to render, but that didn’t seem to matter. The problem is line 26:
waiting for the semaphore to be signaled blocks the thread, and the
web view won’t load. None of the delegate methods will ever be called
while I’m blocking.

Is there a way to synchronously wait for the web view? All
combinations of splitting things off on separate threads fall apart
when I try to wait for the image to be created.

Thanks in advance for any suggestions.


Jeff Kelley
___

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

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

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

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


Re: Improving drawing of UIView with many many Subviews

2010-12-21 Thread David Duncan
Why not just use a UIImageView instead of implementing a custom UIView subclass 
to do this? If this is all you are doing a UIImageView is very often the 
superior choice.

On Dec 21, 2010, at 6:46 AM, Gustavo Adolfo Pizano wrote:

 and this is the drawrect method of the BCItemView
 
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
// Drawing code.
   
   CGContextRef context = UIGraphicsGetCurrentContext();   
   CGContextSaveGState(context);
   CGContextTranslateCTM(context, 0, CGImageGetHeight(bc_itemImage));
   CGContextScaleCTM(context, 1.0, -1.0);
   CGContextDrawImage(context, self.bounds, bc_itemImage);
   CGContextRestoreGState(context);
 
 }

--
David Duncan

___

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

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

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

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


Re: Waiting for UIWebView with Dispatch Semaphores

2010-12-21 Thread David Duncan
On Dec 21, 2010, at 8:52 AM, Jeff Kelley wrote:

 Is there a way to synchronously wait for the web view? All
 combinations of splitting things off on separate threads fall apart
 when I try to wait for the image to be created.


Why do this synchronously at all? The web view already gives you a 
notification, use that to generate your thumbnail and signal the caller.

Also consider that if the rendering takes a significant time, blocking the main 
thread *will* cause your application to be killed by the watchdog timer. 
Basically trying to do this synchronously is not only a waste of time, but a 
dead end that will fail for anything but the simplest of scenes.
--
David Duncan

___

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

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

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

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


Re: Waiting for UIWebView with Dispatch Semaphores

2010-12-21 Thread Jeff Kelley
On Tue, Dec 21, 2010 at 11:59 AM, David Duncan david.dun...@apple.com wrote:

 Why do this synchronously at all? The web view already gives you a 
 notification, use that to generate your thumbnail and signal the caller.

What I’m trying to do is create a thumbnail for a PowerPoint that,
when clicked, opens a web view with the PowerPoint inside. I’d like it
to be synchronous so that I can create thumbnails on demand if they
aren’t already created. I’ll probably move forward with something that
creates a full-size image asynchronously on downloading the
PowerPoint, then dynamically resize that image to make my thumbnail,
but this feels like something that *should* be possible.

 Also consider that if the rendering takes a significant time, blocking the 
 main thread *will* cause your application to be killed by the watchdog timer. 
 Basically trying to do this synchronously is not only a waste of time, but a 
 dead end that will fail for anything but the simplest of scenes.

The alternative, then, would be to find a way to render a PPT on a
background thread, which UIWebView doesn’t seem suited for. Thanks for
your comments.


Jeff Kelley
___

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

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

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

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


Re: Improving drawing of UIView with many many Subviews

2010-12-21 Thread Gustavo Pizano
Aha,,, I thought using UIView instead would be better, but I guess I was 
wrong.. 
I will then make the modifications then and see.. 


Thanks for the help I will keep you informed..

G. 
On Dec 21, 2010, at 5:57 PM, David Duncan wrote:

 Why not just use a UIImageView instead of implementing a custom UIView 
 subclass to do this? If this is all you are doing a UIImageView is very often 
 the superior choice.
 
 On Dec 21, 2010, at 6:46 AM, Gustavo Adolfo Pizano wrote:
 
 and this is the drawrect method of the BCItemView
 
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
   // Drawing code.
  
  CGContextRef context = UIGraphicsGetCurrentContext();   
  CGContextSaveGState(context);
  CGContextTranslateCTM(context, 0, CGImageGetHeight(bc_itemImage));
  CGContextScaleCTM(context, 1.0, -1.0);
  CGContextDrawImage(context, self.bounds, bc_itemImage);
  CGContextRestoreGState(context);
 
 }
 
 --
 David Duncan
 

___

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

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

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

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


Re: Recovering from a merge conflict

2010-12-21 Thread Paulo Andrade

On Dec 21, 2010, at 3:08 PM, Fritz Anderson wrote:

 On 21 Dec 2010, at 8:36 AM, Paulo Andrade wrote:
 
 int tries = 10;
 while ( tries-- ) {
  // compute this batch
 
 [moc save:error];
 if (error != nil  [error code] == NSManagedObjectMergeError) {
 
 This may not be your main problem, but you should never inspect a returned 
 error object unless the method that returned it reports a failure:
 
 if (! [moc save: error]  [error code] == NSManagedObjectMergeError) {
   ...
 
 Such methods are free to set the error object at their start, in case they 
 fail, but the error is correct only if the method does fail.
 
   — F
 

Thanks for noticing that, actually did not know about that. Is that written 
anywhere on Apple's docs?

It's not that consistent either, take executeFetchRequest:error: for example. 
But yes, I understand that I should first use the method error reporting if it 
exists before delving in the NSError object.

Anyway, back to the original question.. 
anyone?___

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


App submission

2010-12-21 Thread Dan Hopwood
Hi,

Apologies if this question is inappropriate for this mailing list - if
someone is able to point me in the direction of where I need to ask or has
any information themselves I would be very grateful.

I am trying to find out how app submission is affected over the Christmas
period. I would like an app I am developing to be on the store by a certain
date and so wondered when the submission deadline would be to achieve this.
Also I didn't know whether it is possible to request the app be added on
a specific day?

Many thanks,

Dan
___

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

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

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

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


Re: App submission

2010-12-21 Thread Chris Williams
Shut down from Thurs the 23rd through Tues the 28th.


From: Dan Hopwood d...@biasdevelopment.com
Date: Tue, 21 Dec 2010 12:39:22 -0500
Subject: App submission

I am trying to find out how app submission is affected over the Christmas
period.
___

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

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

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

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


Re: Performance: Drawing hundreds of short text strings

2010-12-21 Thread Aki Inoue
Yes, we optimized NSStringDrawing API since the documentation discouraging its 
use was first written.

In fact, for some of short simple string rendering, it's the fastest on the 
platform (use -drawWithRect:... variants for the maximum efficiency if 
possible).

So, as already mentioned, use the cleanest approach and tune if necessary.

Note CoreText is a core layout engine, a building block for higher-level text 
engines such as AppKit.  It doesn't necessarily perform better than 
higher-level engines which are caching by utilizing contextual info available.

Aki

On 2010/12/21, at 7:02, tra...@postfl.com wrote:

 Hi Mike,
 
 Seconding Sherm and Joar, this will be the easiest way to get started. Down 
 the line, if that doesn't work, have a look at Core Text.
 
 Also, I have been developing an application for drawing with text. I draw a 
 few hundred individual letters at a time, then commit them to a graphics 
 context so that the next time the whole view is drawn, one context is drawn 
 rather than 1 context + n letters.
 
 T
 
 
 On 2010-12-21, at 12:04 AM, Sherm Pendley wrote:
 
 On Mon, Dec 20, 2010 at 11:53 PM, Joar Wingfors j...@joar.com wrote:
 
 On 20 dec 2010, at 01.22, Mark Coniglio wrote:
 
 My application needs to draw hundreds of short text strings into an 
 NSView. After reviewing the Cocoa documentation on drawing text, I am left 
 unsure as to how to do this with the highest level of efficiency.
 
 Don't optimize in the dark! Implement something in the most straight 
 forward way you can imagine, and then measure the performance. If you find 
 that it doesn't perform well enough, use your measurements to guide you to 
 a better implementation. I don't think that we have enough information yet 
 to provide really good suggestions.
 
 Seconded. The NSString convenience methods are the easiest, most
 straightforward way, so I'd try those first. If and only if they
 didn't perform well enough, then I'd start looking for a
 better-performing alternative.
 
 sherm--
 
 -- 
 Cocoa programming in Perl:
 http://camelbones.sourceforge.net
 ___
 
 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/travis%40postfl.com
 
 This email sent to tra...@postfl.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:
 http://lists.apple.com/mailman/options/cocoa-dev/aki%40apple.com
 
 This email sent to a...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Improving drawing of UIView with many many Subviews

2010-12-21 Thread Gustavo Pizano
David hello.

I just wanted to update you.

So I did the modification to subclass UIImageView instead, and just added the 
userInteractionsEnable to YES, modify my NSCoding protocols methods  + I add a 
category for th eUIImage (NSCoding) methods, and all seemd to work perfectly, 
saving time its little bit slower because it encodes the image of the 
UImageView,  but now loading times its faster.

Thanks

Gustavo



On Dec 21, 2010, at 5:57 PM, David Duncan wrote:

 Why not just use a UIImageView instead of implementing a custom UIView 
 subclass to do this? If this is all you are doing a UIImageView is very often 
 the superior choice.
 
 On Dec 21, 2010, at 6:46 AM, Gustavo Adolfo Pizano wrote:
 
 and this is the drawrect method of the BCItemView
 
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
   // Drawing code.
  
  CGContextRef context = UIGraphicsGetCurrentContext();   
  CGContextSaveGState(context);
  CGContextTranslateCTM(context, 0, CGImageGetHeight(bc_itemImage));
  CGContextScaleCTM(context, 1.0, -1.0);
  CGContextDrawImage(context, self.bounds, bc_itemImage);
  CGContextRestoreGState(context);
 
 }
 
 --
 David Duncan
 

___

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

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

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

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


Re: Performance: Drawing hundreds of short text strings

2010-12-21 Thread Kyle Sluder
On Dec 21, 2010, at 11:04 AM, Aki Inoue a...@apple.com wrote:

 Note CoreText is a core layout engine, a building block for higher-level text 
 engines such as AppKit.  It doesn't necessarily perform better than 
 higher-level engines which are caching by utilizing contextual info available.

Is there a definitive guide anywhere that documents the features 
NSLayoutManager has that Core Text lacks?

Thanks,
--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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Creating an NSImage of a View and its Contents

2010-12-21 Thread Stephen Blinkhorn

Hi all,

I'm trying to capture a view and its contents as an NSImage which I  
can subsequently draw in the view.  The idea is that I'm trying to  
'freeze' the view's content (custom sliders, buttons, menus etc) and  
present this image in the view.


I'm getting mixed results when attempting to render to a CFLayerRef  
e.g.:


NSRect viewRect = [self bounds];

[self lockFocus];
NSBitmapImageRep* rep = [[NSBitmapImageRep alloc]  
initWithFocusedViewRect:viewRect];

[self unlockFocus];

NSImage* image = [[NSImage alloc] initWithSize:viewRect.size];
[image addRepresentation:rep];
[image drawAtPoint:NSZeroPoint fromRect:viewRect  
operation:NSCompositeSourceOver fraction:1.0];


[image release];
[rep release];


Nothing appears to be drawn in the layer.  Is there a better approach  
that I'm missing?


Thanks,
Stephen
___

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

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

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

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


Re: Creating an NSImage of a View and its Contents

2010-12-21 Thread Corbin Dunn
Hi Stephen,
This was done in the AnimatedTableView demo app available on the dev site. 
Check it out and let me know if you need pointing to the particular part of 
code that does it.

corbin

On Dec 21, 2010, at 12:11 PM, Stephen Blinkhorn wrote:

 Hi all,
 
 I'm trying to capture a view and its contents as an NSImage which I can 
 subsequently draw in the view.  The idea is that I'm trying to 'freeze' the 
 view's content (custom sliders, buttons, menus etc) and present this image in 
 the view.
 
 I'm getting mixed results when attempting to render to a CFLayerRef e.g.:
 
 NSRect viewRect = [self bounds];
 
 [self lockFocus];
 NSBitmapImageRep* rep = [[NSBitmapImageRep alloc] 
 initWithFocusedViewRect:viewRect];
 [self unlockFocus];
   
 NSImage* image = [[NSImage alloc] initWithSize:viewRect.size];
 [image addRepresentation:rep];
 [image drawAtPoint:NSZeroPoint fromRect:viewRect 
 operation:NSCompositeSourceOver fraction:1.0];
   
 [image release];
 [rep release];
 
 
 Nothing appears to be drawn in the layer.  Is there a better approach that 
 I'm missing?
 
 Thanks,
 Stephen
 ___
 
 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/corbind%40apple.com
 
 This email sent to corb...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Creating an NSImage of a View and its Contents

2010-12-21 Thread Corbin Dunn
I'll just copy the code here for you:

  NSRect visibleRect = [_oldContentView visibleRect];
NSBitmapImageRep *imageRep = [_oldContentView 
bitmapImageRepForCachingDisplayInRect:visibleRect];
[_oldContentView cacheDisplayInRect:visibleRect toBitmapImageRep:imageRep];



http://developer.apple.com/library/mac/#samplecode/AnimatedTableView/Listings/ATPopupWindow_m.html


corbin


On Dec 21, 2010, at 1:08 PM, Corbin Dunn wrote:

 Hi Stephen,
 This was done in the AnimatedTableView demo app available on the dev site. 
 Check it out and let me know if you need pointing to the particular part of 
 code that does it.
 
 corbin
 
 On Dec 21, 2010, at 12:11 PM, Stephen Blinkhorn wrote:
 
 Hi all,
 
 I'm trying to capture a view and its contents as an NSImage which I can 
 subsequently draw in the view.  The idea is that I'm trying to 'freeze' the 
 view's content (custom sliders, buttons, menus etc) and present this image 
 in the view.
 
 I'm getting mixed results when attempting to render to a CFLayerRef e.g.:
 
 NSRect viewRect = [self bounds];
 
 [self lockFocus];
 NSBitmapImageRep* rep = [[NSBitmapImageRep alloc] 
 initWithFocusedViewRect:viewRect];
 [self unlockFocus];
  
 NSImage* image = [[NSImage alloc] initWithSize:viewRect.size];
 [image addRepresentation:rep];
 [image drawAtPoint:NSZeroPoint fromRect:viewRect 
 operation:NSCompositeSourceOver fraction:1.0];
  
 [image release];
 [rep release];
 
 
 Nothing appears to be drawn in the layer.  Is there a better approach that 
 I'm missing?
 
 Thanks,
 Stephen
 ___
 
 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/corbind%40apple.com
 
 This email sent to corb...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Creating an NSImage of a View and its Contents

2010-12-21 Thread Stephen Blinkhorn

On 21 Dec 2010, at 15:10, Corbin Dunn wrote:


I'll just copy the code here for you:

  NSRect visibleRect = [_oldContentView visibleRect];
NSBitmapImageRep *imageRep = [_oldContentView  
bitmapImageRepForCachingDisplayInRect:visibleRect];
[_oldContentView cacheDisplayInRect:visibleRect  
toBitmapImageRep:imageRep];


Thanks Corbin, will try this technique out now.
Stephen







http://developer.apple.com/library/mac/#samplecode/AnimatedTableView/ 
Listings/ATPopupWindow_m.html



corbin


On Dec 21, 2010, at 1:08 PM, Corbin Dunn wrote:


Hi Stephen,
This was done in the AnimatedTableView demo app available on the  
dev site. Check it out and let me know if you need pointing to the  
particular part of code that does it.


corbin

On Dec 21, 2010, at 12:11 PM, Stephen Blinkhorn wrote:


Hi all,

I'm trying to capture a view and its contents as an NSImage which  
I can subsequently draw in the view.  The idea is that I'm trying  
to 'freeze' the view's content (custom sliders, buttons, menus  
etc) and present this image in the view.


I'm getting mixed results when attempting to render to a  
CFLayerRef e.g.:


NSRect viewRect = [self bounds];

[self lockFocus];
NSBitmapImageRep* rep = [[NSBitmapImageRep alloc]  
initWithFocusedViewRect:viewRect];

[self unlockFocus];

NSImage* image = [[NSImage alloc] initWithSize:viewRect.size];
[image addRepresentation:rep];
[image drawAtPoint:NSZeroPoint fromRect:viewRect  
operation:NSCompositeSourceOver fraction:1.0];


[image release];
[rep release];


Nothing appears to be drawn in the layer.  Is there a better  
approach that I'm missing?


Thanks,
Stephen
___

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/corbind%40apple.com

This email sent to corb...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Vertical Asian Text in Cocoa

2010-12-21 Thread Abdul Sowayan
Hi folks,
 
As I understood it several years ago, there was no native support in Cocoa
for rendering vertical Japanese text.  Note that certain punctuation and
compound characters are supposed to render differently when drawing in the
vertical orientation than they normally would when drawing left-to-right
(which is how the font normally specifies how the character is rendered)Š
Has anything changed on this front?  Is there any support in Quartz for
this?

Any feedback would be greatly appreciated.

Thanks,
Abdul


___

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


CALayer and pixel alignment

2010-12-21 Thread Gideon King
I am drawing some CALayers, and use code like what I have below so I can draw 
exactly on pixels.

When I draw it in my CALayer drawing code, it's not always pixel aligned. It's 
certainly better than if I had done no rounding, but still it is not correct. 
Is there something I'm not doing right? Why I think it may be CALayer based is 
because when I draw a whole bunch of these squares on layers, on some layers 
they are all aligned, and on other layers they are not - they are all affected 
at the same time. I do not have any scale transforms anywhere - only 
translations.



CGContextSaveGState(gcontext);
CGRect rect = CGRectMake(55.0f, -2.5f, 5.0f, 5.0f);
CGRect deviceRect = CGContextConvertRectToDeviceSpace(gcontext, rect);

NSDecimalNumberHandler *handler = [NSDecimalNumberHandler 
decimalNumberHandlerWithRoundingMode:NSRoundPlain scale:0 raiseOnExactness:NO 
raiseOnOverflow:NO raiseOnUnderflow:NO raiseOnDivideByZero:NO];

deviceRect.origin.x = [[(NSDecimalNumber *)[NSDecimalNumber 
numberWithFloat:deviceRect.origin.x + 0.5f] 
decimalNumberByRoundingAccordingToBehavior:handler] floatValue] - 0.5f;
deviceRect.origin.y = [[(NSDecimalNumber *)[NSDecimalNumber 
numberWithFloat:deviceRect.origin.y + 0.5f] 
decimalNumberByRoundingAccordingToBehavior:handler] floatValue] - 0.5f;
deviceRect.size.width = [[(NSDecimalNumber *)[NSDecimalNumber 
numberWithFloat:deviceRect.size.width] 
decimalNumberByRoundingAccordingToBehavior:handler] floatValue];
deviceRect.size.height = [[(NSDecimalNumber *)[NSDecimalNumber 
numberWithFloat:deviceRect.size.height] 
decimalNumberByRoundingAccordingToBehavior:handler] floatValue];

CGRect drawingRect = CGContextConvertRectToUserSpace(gcontext, deviceRect);

CGContextSetRGBStrokeColor(gcontext, 0.0f, 0.0f, 0.0f, 1.0f);
CGContextSetRGBFillColor(gcontext, 1.0f, 1.0f, 1.0f, 1.0f);

CGContextAddRect(gcontext, drawingRect);
CGContextDrawPath(gcontext, kCGPathFillStroke);

CGContextRestoreGState(gcontext);



Regards

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


UIWebview: scrolling vs anchors - followup

2010-12-21 Thread Donald Hall

On December 20 I wrote:

-
 I have a UIWebview in my app that I want to use to load an HTML 
document containing anchors so that I can jump around the document by 
tapping on the links to the various anchors. (e.g. a link at the 
bottom of the page to jump to the top of the page)


I have the links and anchors working fine, except that for example 
when I am at the bottom of the page and tap on the link to jump to 
the top of the page, then scroll down from the top to the bottom, 
then tap the link to go to the top again, nothing happens. It's as if 
the webview thinks it is still at the top of the page.


Is there any way to get the webview to realize that the top of the 
page is no longer visible after scrolling? I tested this on my Mac 
with Safari, and scrolling does not affect the action of the link and 
anchor there.


Thanks for any help. I have spent several hours searching with no luck.

Don
-
I thought I should add a bit more information following some further 
investigation. I hope it might help someone else out in the future.


My idea was to include a simple help document with my app. By using 
HTML I could have a table of contents at the top, and a user could 
select a topic by tapping on it to go to an anchor further down the 
page. At the end of the topic would be another link to return to the 
top of the page. My investigations here show that if the user scrolls 
to the top instead of using the link, then the original link to the 
topic would no longer work.


It appears that once an anchor is jumped to you cannot jump to that 
anchor again until you jump to a different anchor. This resets 
something. Any href link to the anchor highlights normally, but 
nothing happens. No web view delegate methods are called, as they are 
the first time the link is clicked on. Here is my test file:


!DOCTYPE html
html lang=en
a name=top/a
a href=#bottom rel=selfGo to bottom./abr
a href=#bottom rel=selfGo to bottom./abr
Line 1br
Line 2br
... enough lines to extend below the screen.
Line 3br
a name=bottom/aThis is it.br
a href=#top rel=selfGo to top./a/html

If I click on the first Go to bottom. link I jump to the bottom as 
expected. If I scroll back up to the top and click on either Go to 
bottom. link nothing happens. If I then scroll back to the bottom 
and click on Go to top I jump to the top, and either of the Go to 
bottom links works to get me to the bottom again.


Unless anyone can tell me I have missed something, I think I will 
file a bug report on this.


Thanks,

Don

--
Donald S. Hall, Ph.D.
Apps  More Software Design, Inc.
d...@appsandmore.com
http://www.appsandmore.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Strange error solved by turning off Non-contiguous Layout

2010-12-21 Thread Brad Stone
I have an NSTextView that has about 1,900 characters in it.  Just regular text. 
 If I edit the text and save my app hangs at  [[self managedObjectContext] 
commitEditing];  I found setting nonContinuousLayout to NO in the NSTextView 
prevents the hang but that's not really solving the problem.

Here's what's strange.  If I expand the window so the all the text shows 
without the scroll bar it doesn't hang.  If I edit the same text but scroll 
down the get it I get a hang.  If I set nonContiguousLayout to NO it doesn't 
hang in either scenario.

What advice can anyone give as to how I can address this problem?

Thanks, Brad___

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


Exception Location

2010-12-21 Thread Richard Somers
The following exception message that is being sent by the frameworks: - 
[NSCFArray objectAtIndex:]: index (x) beyond bounds (y)


The method 'objectAtIndex:' is called in many location within the code  
base but the console message gives no indication where the error  
occurred.


The error is actually occurring on users test machine that does not  
have Xcode installed.


Is it possible somehow to get the console message to indicated where  
in the code the error is occurring?


--Richard Somers

___

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


hacked email account

2010-12-21 Thread Maryanna Rogers
Hi

I am writing to you because you are the most contacted addresses from
this account.  I have rarely used this account and just realized that
someone has hacked into it multiple times and is using my name in
public forums.  Please contact me at maryannarog...@yahoo.com if you
have any information regarding the person who you have contacted here.

Thank you for your assistance

Maryanna
___

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

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

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

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


Re: Strange error solved by turning off Non-contiguous Layout

2010-12-21 Thread Ken Thomases
On Dec 21, 2010, at 10:08 PM, Brad Stone wrote:

 I have an NSTextView that has about 1,900 characters in it.  Just regular 
 text.  If I edit the text and save my app hangs at  [[self 
 managedObjectContext] commitEditing];  I found setting nonContinuousLayout to 
 NO in the NSTextView prevents the hang but that's not really solving the 
 problem.
 
 Here's what's strange.  If I expand the window so the all the text shows 
 without the scroll bar it doesn't hang.  If I edit the same text but scroll 
 down the get it I get a hang.  If I set nonContiguousLayout to NO it doesn't 
 hang in either scenario.
 
 What advice can anyone give as to how I can address this problem?

One useful tool is a sample of the process to see where each of its threads is 
spending its time.  This can help identify causes of deadlocks, which is what 
it seems like you have.

There are several process-sampling tools in Mac OS X: the sample command, the 
Sample Process command in Activity Monitor, the Time Profile (All Thread 
States) tools of Shark or Instruments.  For sharing on a mailing list, the text 
files produced by the sample command are probably simplest.

Regards,
Ken

___

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

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

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

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


Re: Exception Location

2010-12-21 Thread Ken Thomases
On Dec 21, 2010, at 11:25 PM, Richard Somers wrote:

 The following exception message that is being sent by the frameworks: 
 -[NSCFArray objectAtIndex:]: index (x) beyond bounds (y)
 
 The method 'objectAtIndex:' is called in many location within the code base 
 but the console message gives no indication where the error occurred.
 
 The error is actually occurring on users test machine that does not have 
 Xcode installed.
 
 Is it possible somehow to get the console message to indicated where in the 
 code the error is occurring?

If you can deliver the user a different build of your app, you can use 
NSExceptionHandler to log more detailed information about the exception.  See 
that class's documentation, including the conceptual guide, for more 
information.

Another approach is to use DTrace.  All thrown/raised exceptions from 
Objective-C go through the objc_exception_throw function.  So, a DTrace 
one-liner like the following would print a stack trace for them:

sudo dtrace -n 'pid$target::objc_exception_throw:entry {ustack();}' -p pid of 
app process

(Note that this may trace exceptions in addition to the one you're seeing 
logged, if something is using exceptions internally.)

Regards,
Ken

___

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

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

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

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


Re: CALayer and pixel alignment

2010-12-21 Thread Seth Willits
On Dec 21, 2010, at 4:09 PM, Gideon King wrote:

 When I draw it in my CALayer drawing code, it's not always pixel aligned.

You need to make sure the layer is aligned correctly too. The anchor point by 
default is {0.5, 0.5}. If you place an oddly-sized layer on X.0 coordinate, 
it'll be unaligned. Same with an even sized layer on a X.5 coordinate. 


--
Seth Willits



___

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

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

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

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


Re: CALayer and pixel alignment

2010-12-21 Thread Gideon King
Yeah, that crossed my mind too, and I thought I had tried that, but I have just 
gone back through my code and found that there was a parent layer where I 
hadn't set it to an integral frame. I fixed that, and it's now working 
perfectly - looks so much better! Thanks for triggering me to look again.

Regards

Gideon

On 22/12/2010, at 4:25 PM, Seth Willits wrote:

 On Dec 21, 2010, at 4:09 PM, Gideon King wrote:
 
 When I draw it in my CALayer drawing code, it's not always pixel aligned.
 
 You need to make sure the layer is aligned correctly too. The anchor point by 
 default is {0.5, 0.5}. If you place an oddly-sized layer on X.0 coordinate, 
 it'll be unaligned. Same with an even sized layer on a X.5 coordinate. 
 

___

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