Re: Localization under Catalina

2020-05-27 Thread Alexander Reichstadt via Cocoa-dev
I'm familiar with auto-layout actually with other projects. I thought it was 
needed for the "new" way of localising because you need to resize captions to 
fit longer strings (in the case of German for example). I'll definitively look 
into it.
Is there a facility in Xcode to extract the current translated strings from the 
nib files? Is that handled as part of the automatic conversion?

Eyal


> On 27 May 2020, at 22:50, Rob Petrovec  wrote:
> 
> Auto layout (not auto-resizing) is independent of localization.  You don’t 
> need to switch to auto layout to support Base localization.  So you can 
> convert your nibs over to Base Localization with a couple clicks in Xcode, 
> and then you just need .strings and .stringdict files in your .lprojs instead 
> of a TON of duplicate .nibs that constantly need updating.  If you make a 
> change in the base nib all the localizations will pick it up.
> 
> With that said, Auto Layout is leaps & bounds better than the old 
> autoresizing mask stuff.  Make sure you read & understand the auto layout 
> documentation before starting of course.  But once you do convert over you 
> will wish you had done it earlier.  It is SO much better.  Plus it 
> handles positioning views automagically between Left-To-Right localizations 
> like English and Right-To-Left localizations like Hebrew.
> 
> —Rob
> 
> 
>> On May 27, 2020, at 1:26 PM, Eyal Redler via Cocoa-dev 
>>  wrote:
>> 
>> AppleGlot used to work fine for me but I agree, I should move to Base.lproj 
>> etc. But now I need to ship a new version of the app and I can't really 
>> afford to spend the time converting everything to auto-resizing.
>> I foolishly upgraded to Catalina only this week, and this put me in a very 
>> delicate situation.
>> 
>> Eyal
>> 
>>> On 27 May 2020, at 22:14, Martin Wierschin  wrote:
>>> 
>>> I remember AppleGlot. I also remember how terrible it was, at least way 
>>> back when it was first around. In the intervening years I preferred 
>>> loc-suite. As Georg said, it's a very good tool. But all that's obsolete 
>>> now.
>>> 
>>> You ultimately should convert your nibs to Base.lproj. The current Xcode 
>>> localization process is way better than the bad old days where you had to 
>>> keep endless translated nibs in sync. The conversion job is a good amount 
>>> of busy work, and autolayout may give you pain initially, but ultimately 
>>> using Base.lproj + autolayout + translated .strings files is much cleaner.
>>> 
>>> ~Martin Wierschin
>>> Nisus Software / Developer
>>> Solana Beach ☀️ California
>>> 
>> 
>> ___
>> 
>> 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/petrock%40mac.com
>> 
>> This email sent to petr...@mac.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/lxr%40me.com 


This email sent to l...@me.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


Text drop into other text apps

2014-11-02 Thread Alexander Reichstadt

Hi,

I'd like to write @test to the pasteboard in response to a tableview drag to 
end up in another app's textfield.

I see that all my methods are called accordingly, but when I release the mouse 
button, nothing is inserted nor does the cursor react by reflecting the 
insertion point if the mouse button was released.
What else is needed to do this?

Also, from the documentation on pasteboardPropertyListForType one would expect to return 
a property list. Property lists consist of keys and values in my understanding, but a 
string is just an unordered chain of characters. What would the keyes be, actually the 
one key, to which to assign the string @test then?

Thx


- (idNSPasteboardWriting)tableView:(NSTableView *)tableView
              pasteboardWriterForRow:(NSInteger)row
{
    return self;
}

- (NSArray *)writableTypesForPasteboard:(NSPasteboard *)pasteboard
{
    return @[@public.text];
}

- (id)pasteboardPropertyListForType:(NSString *)type
{
    NSLog(@%@,type);
    
    NSData *conData = [@test dataUsingEncoding:NSUTF8StringEncoding];

 
    return conData;
}

___

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: Text drop into other text apps

2014-11-02 Thread Alexander Reichstadt
Hi
 On 02 Nov 2014, at 19:11, Ken Thomases k...@codeweavers.com wrote:
 
 On Nov 2, 2014, at 12:43 PM, Alexander Reichstadt l...@icloud.com wrote:
 
 As to why your drop is not being accepted, have you called 
 -setDraggingSourceOperationMask:forLocal: on the table view to set an 
 operation mask for the non-local case (passing NO for the second parameter)?  
 You would probably want NSDragOperationCopy | NSDragOperationGeneric.
 
Yes, but the reference was nil at the time it was set. It works now.

Thx
Alex


___

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

SpriteKit Joints on Mac OS X

2014-04-28 Thread Alexander Reichstadt
Hi,

On Mac OS X using SKPhysicsJointPin gives me some problems:

- (void)pjoinBodyA:(NSString *)nameA andB:(NSString *)nameB
{
SKSpriteNode *bodyA = [self childNodeWithName:nameA];
SKSpriteNode *bodyB = [self childNodeWithName:nameB];

if (bodyA.position.xbodyB.position.x){
bodyB = [self childNodeWithName:nameA];
bodyA = [self childNodeWithName:nameB];
}
CGPoint ap = CGPointMake(bodyB.frame.origin.x-1, bodyB.frame.origin.y);
NSLog(@JOINING AB AT %@,NSStringFromPoint(ap));
SKPhysicsJointPin *j = [SKPhysicsJointPin jointWithBodyA:bodyA.physicsBody 
bodyB:bodyB.physicsBody anchor:ap];

[self.physicsWorld addJoint:j];
   
}

Now, if I create three bodies, coloring them and drawing paths on them with 
gravity turned on in my physics world, I can see them standing on the floor 
next to each other, exactly as added at the exact positions. As soon as I add a 
pin joint (or actually any kind of joint) they overlap looking like one single 
square.

When I then move one of the squares, it's not that the other joined squares 
remain in a static distance to the moved square and dangles along the pin-joint 
point, but instead it behaves like connected through some weird springy thing. 
If the first object gets moved more quickly, they both get totally lost in some 
erratic motion all over the screen.

I also tried to have them being joined only after positioning them exactly 
where they should be in the pjoin method, but that makes no difference.

I found this nice tutorial with all its code inside, but that does not work 
neither:

http://hub.ae/blog/2014/03/26/soft-body-physics-jellyusing-spritekit/

You can copy paste that code, adjust it to Mac OS X and the alleged jellyblob 
is just a bunch of dots and lines on the floor.

Take the same code and copy-paste it into the iOS Spritekit template and it 
works flawlessly exactly as described.

On Mac OS X and as for the other joints, they neither do what is described in 
their reference sections. The best results I achieved with a rope joint between 
two bodies, but make that more than two, it falls apart. Before wasting further 
time, are joints on Mac OS X SpriteKit a known issue at this time?

Thanks
Alex
___

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: SpriteKit Joints on Mac OS X

2014-04-28 Thread Alexander Reichstadt
Thanks. I logged a bug.

Alex

Am 29.04.2014 um 03:04 schrieb Graham Cox graham@bigpond.com:

 
 On 28 Apr 2014, at 6:53 pm, Alexander Reichstadt l...@mac.com wrote:
 
 Before wasting further time, are joints on Mac OS X SpriteKit a known issue 
 at this time?
 
 
 I don't know, but if it is it would explain the difficulties I had making 
 these work as well. I created a series of about twenty links, end to end 
 with a pin joint, which should act like a flexible chain. It doesn't - it 
 just gives bizarre and useless results. I didn't try it on iOS, thinking I 
 must have misinterpreted the documentation or had too high expectations of 
 the physics engine, but it might be worth a revisit.
 
 --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

Memoryleak in SpriteKit?

2014-04-09 Thread Alexander Reichstadt
Hi,

in trying to find the source of a memory leak I think to have in my project, I 
ended up creating a plain SpriteKit project from template and did the following:

- (IBAction)test:(id)sender
{
if (self.skView.scene.children.count0){
[self.skView.scene removeAllChildren];
} else {
for (int i=0;i2000;i++){
[self.skView.scene addChild:[SKNode node]];
}
}
}

This code is bound to a menu item method test. When looking at memory in Xcode 
I would expect for it before adding any children to be identical to after 
removing all children. But memory steadily increases. Is there something wrong 
with my assumption or is there a leak in SpriteKit?

Thx
___

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: Random crashes

2014-04-02 Thread Alexander Reichstadt
Thanks to all for your responses. A scene got presented and removed later on. 
The app delegate had a currentScene property, and after I had activated all 
debug features I saw that my scene class was being sent some message it didn't 
respond to, but in fact was actually not even supposed to do so. The instance 
being accessed was no longer available causing the crash.

Thx

Am 02.04.2014 um 11:12 schrieb Uli Kusterer witness.of.teacht...@gmx.net:

 On 01 Apr 2014, at 23:19, Alexander Reichstadt l...@mac.com wrote:
 Is there a way to find the root cause of such a crash?
 
 Vague idea: Set breakpoints on anything that can terminate an application 
 (e.g. exit() and abort()) and if one is triggered, see if the stack backtrace 
 gives any hints on what might be going wrong?
 
 Cheers,
 -- Uli Kusterer
 “The Witnesses of TeachText are everywhere...”
 http://zathras.de
 


___

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

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

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

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

Random crashes

2014-04-01 Thread Alexander Reichstadt
Hi,

in a project using the default Spritekit template all works fine until one 
leaves the app and switches to another process, which results in random crashes 
without a backtrace. After having switched to another process and returning to 
the running  or also paused game, it's only a question of time when it will 
crash.

It always seems to involve the main window. The trace is not very helpful as it 
crashes outside the app's own code. The last calls that I can see in the 
debugger are sometimes [NSApplication updateWindows], other times it's 
[NSWindow becomeKeyWindow].

Googling this issue was not very helpful. Suggestions varied from putting the 
entire app in a try-block, subclassing NSApplication for testing purposes, up 
to including creating the entire project from scratch and copy pasting line by 
line.good luck with that. Except for that last option I tried the other two 
to no avail. Is there a way to find the root cause of such a crash?

Thx



___

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

textView, writeCell to clipboard, how to read from clipboard

2012-07-16 Thread Alexander Reichstadt
Hi,

in NSTextView there is a method to handling writing textattachmentcells to the 
clipboard. I implemented the following and it seems to work:

- (NSArray *)textView:(NSTextView *)aTextView 
writablePasteboardTypesForCell:(id NSTextAttachmentCell)cell
  atIndex:(NSUInteger)charIndex;
{
return [NSArray arrayWithObject:kDataCellTypeUTI];
}

- (BOOL)textView:(NSTextView *)aTextView
   writeCell:(id NSTextAttachmentCell)cell
 atIndex:(NSUInteger)charIndex
toPasteboard:(NSPasteboard *)pboard type:(NSString *)type;
{
if (type == kDataCellTypeUTI)
[pboard writeObjects:[NSArray arrayWithObject:cell]];

return YES;
}


Both get overridden and my custom textattachmentcell ends up on the pasteboard. 
But when pasting it and even though it does get pasted as a cell, the custom 
properties are the default values and not the ones from the copy on the 
pasteboard. initWithPasteboardPropertyList is never called nor initWithCoder, 
only the standard init method. The cell subclass subscribes to 
NSPastboardReading and -Writing protocol and implements all methods thereof. IS 
there anything else that needs to be done, or are textattachmentcells an 
exception to the pasteboard in some way?

AR
___

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


NSTextAttachment

2012-07-16 Thread Alexander Reichstadt
Is there any way to have an NSTextView to hold text and custom data-widgets 
that are unrelated to filewrappers? I don't want NSTextAttachmentCell I think, 
because without a file it doesn't work, without tricking around it does not go 
in and out of the pasteboard, and NSTokenAttachment is some private API thing. 
I need to be able to have placeholder fields in a textview that are based on 
NSCell or can be own views. Is there really nothing available? I don't have the 
capacity to write an entire layout editor like pages for that neither.

Thanks
___

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

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

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

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


Re: NSTextAttachment

2012-07-16 Thread Alexander Reichstadt
There is a blog that outlines how to do this with help of Douglas Davidson:
http://www.dejal.com/blog/2007/11/cocoa-custom-attachment-text-view

The suggestion here is to use a textStorage delegate to insert the custom 
attachment cell into the text. It actually relies on what seems like a bug:

if ([attachment isKindOfClass:[NSTextAttachment class]] 
![[attachment attachmentCell] 
isKindOfClass:[TATextAttachmentCell class]])
{


This is happening in

- (void)textStorageWillProcessEditing:(NSNotification *)note

What I don't understand is that before it's a TATextAttachment with a 
TATextAttachmentCell, being my subclasses, and afterwards when pasting/dropping 
and looking at the debugger, the objects become NSTextAttachment and its cell 
respectively. Why? And how can I make it stop it from turning my subclasses 
into their superclasses?



Am 16.07.2012 um 23:51 schrieb Jens Alfke:

 
 On Jul 16, 2012, at 2:15 PM, Alexander Reichstadt l...@mac.com wrote:
 
 Is there any way to have an NSTextView to hold text and custom data-widgets 
 that are unrelated to filewrappers? I don't want NSTextAttachmentCell I 
 think, because without a file it doesn't work
 
 I have used NSTextAttachmentCell for things that are not files. Note the 
 comment in NSTextAttachment.h that says An NSTextAttachment *usually* has a 
 fileWrapper (emphasis mine). It doesn't *have* to have one.
 
 Unfortunately it's been enough years that I don't remember the details. It 
 may be that you can initialize an NSTextAttachment with a nil fileWrapper, or 
 to set the fileWrapper property to nil after initialization. If not, you may 
 just be able to pass in an arbitrary path to some file, and then the 
 NSTextAttachmentCell methods such that they don't care what the file is.
 
 —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

NSAttributedString location for drawing, glyph location and baseline

2012-07-15 Thread Alexander Reichstadt
Hi,

I have a subclass of NSAttachmentCell which draws itself into an NSTextView. 
Its y-location is wrong though when drawing the cell using 

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *) controlView 
characterIndex:(NSUInteger)charIndex layoutManager: (NSLayoutManager 
*)layoutManager

How do I determine the correct origin for cellFrame to ensure that the baseline 
of the text inside the NSTextView matches that of the text inside the cell to 
be drawn in the textview? In above call I use 

[self.displayWord drawInRect:cellFrame withAttributes:stringAttributes];

to draw the string which in turn uses boundingRectWithSize to figure out the 
NSRect dimensions to accommodate the string?

Thanks
___

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

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

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

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


Re: NSAttributedString location for drawing, glyph location and baseline

2012-07-15 Thread Alexander Reichstadt
I think I found it in, at least it looks correct:

CGFloat gb = [[NSTypesetter sharedSystemTypesetter] 
baselineOffsetInLayoutManager:[(NSTextView *)controlView layoutManager] 
glyphIndex:charIndex];

NSRect useFrame = cellFrame;
useFrame.origin.y += gb;

Thanks
  

Am 15.07.2012 um 23:40 schrieb Alexander Reichstadt:

 Hi,
 
 I have a subclass of NSAttachmentCell which draws itself into an NSTextView. 
 Its y-location is wrong though when drawing the cell using 
 
 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *) controlView 
 characterIndex:(NSUInteger)charIndex layoutManager: (NSLayoutManager 
 *)layoutManager
 
 How do I determine the correct origin for cellFrame to ensure that the 
 baseline of the text inside the NSTextView matches that of the text inside 
 the cell to be drawn in the textview? In above call I use 
 
 [self.displayWord drawInRect:cellFrame withAttributes:stringAttributes];
 
 to draw the string which in turn uses boundingRectWithSize to figure out the 
 NSRect dimensions to accommodate the string?
 
 Thanks
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/lxr%40mac.com
 
 This email sent to l...@mac.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


Custom NSTextAttachment

2012-07-13 Thread Alexander Reichstadt
Hi,

trying to build a custom subclass of NSTextAttachment I thought it would be 
fully supported in an NSTextView.

In a test project at app launch I insert an attachment:

[_textView setString:@This is a test string\rThis is a test string\rThis 
is a test string\rThis is a test string\rThis is a test string\rThis is a test 
string\rThis is a test string\rThis is a test string\rThis is a test 
string\rThis is a test string\r];
TATextAttachment *att = [[TATextAttachment alloc] init];
NSAttributedString *as = [NSAttributedString 
attributedStringWithAttachment:att];
[[_textView textStorage] appendAttributedString:as];

In the attachment I draw a custom cell. It all works so far, but when I select 
a text that contains that custom attachment and drag the selection to another 
location, only the text without the custom attachment cell icon is inserted at 
the new location.

When dragging a text that contains a regular NSTextAttachment it gets dragged 
and dropped as a file icon in the new location.

Why?

Alex
___

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: Calculating lineFragment for NSTextContainer

2012-07-12 Thread Alexander Reichstadt
Hi,

sorry for the delay and thanks for the response, I moved house. Anyway, this 
all worked fine and now the text while being edited is taking crossing paths 
into consideration and writes around them the way I wanted to. But it discards 
the layout whenever I end editing. I first thought this was due to a call of 
removeLayoutManager, but also after I removed this line it keeps on ignoring 
all layout efforts and just writes across all paths.

- (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect 
sweepDirection:(NSLineSweepDirection)sweepDirection 
movementDirection:(NSLineMovementDirection)movementDirection 
remainingRect:(NSRect *)remainingRect

…is stopped being called after editing ended. Why? How can I freeze the layout 
in the view for after editing ended?

Alex


Am 20.06.2012 um 01:41 schrieb Graham Cox:

 
 On 19/06/2012, at 7:02 PM, Alexander Reichstadt wrote:
 
 Hi,
 
 for the 
 
 - (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect 
 sweepDirection:(NSLineSweepDirection)sweepDirection 
 movementDirection:(NSLineMovementDirection)movementDirection 
 remainingRect:(NSRect *)remainingRect {
 
 call I'd like to calculate the proposedRect in case there are bezierPaths 
 limitations of custom shapes.
 
 So I thought there'd be a way to not only clipRect to shade out a piece of a 
 path, but also a way to get that spare-piece from the NSBezierPath instance. 
 Is there?
 
 No, not built-in anyway.
 
 I wanted to split up the bounds rect of the path to circumvent with the text 
 into stripes of the height of proposedRect passed into the call, then 
 considering the offset from top, if any, then pick the stripe I need and see 
 what the minimum bounds would be if the bezierpath stripe was an own bezier 
 path on its own. Or is there another way?
 
 
 I'm guessing you're trying to run text into an arbitrary path defined by a 
 bezier.
 
 If that's the case, I think your understanding of what the text system wants 
 from you here is a bit off. Basically, it tells you where it proposes to lay 
 the text down, and you can modify that to constrain it to lay it down 
 differently. So, for the proposedRect, you need to work out where that 
 intersects the edges of your path and pull the sides of that rect in until 
 they lie within the path. THERE IS NO BUILT-IN WAY TO DO THIS! But it's not 
 that hard. For the points representing the corners of the rect, you can find 
 out whether they are inside or outside the path with [NSBezierPath 
 containsPoint:], then use a binary approximation to shrink the rect until it 
 is just inside the path. In remainingRect, you return the bit of the rect 
 you are NOT using, in the direction of the text sweep. The text system uses 
 that to understand what part of the text it can't use this time round and so 
 will take that into account for the next fragment. You'll be called again 
 with the remainder rect as the proposedRect, so if your path shape is such 
 that more text could fit on the same line  but horizontally displaced, you 
 have an opportunity to calculate that as well. This system allows any path 
 shape to work, even paths that are disjoint, or that have holes.
 
 If the object is to run text around the outside of a path, it's the same 
 idea, you just return the rects outside instead.
 
 This method is called repeatedly until all the text is laid out - so you 
 don't usually precalculate a series of strips and figure out which one to 
 return - you just have to focus on the single strip being considered right 
 now. There is no method to intersect a rect with a bezier and return another 
 bezier (arbitrary bezier path set operations would be wonderful, but they 
 ain't happening, even after years of asking for it).
 
 --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: Calculating lineFragment for NSTextContainer

2012-07-12 Thread Alexander Reichstadt
Oh, it dawns me that this is due to adding an NSTextView instance that is being 
removed when editing ends. This was in a sample project. Never mind.

Am 12.07.2012 um 12:09 schrieb Alexander Reichstadt:

 Hi,
 
 sorry for the delay and thanks for the response, I moved house. Anyway, this 
 all worked fine and now the text while being edited is taking crossing paths 
 into consideration and writes around them the way I wanted to. But it 
 discards the layout whenever I end editing. I first thought this was due to a 
 call of removeLayoutManager, but also after I removed this line it keeps on 
 ignoring all layout efforts and just writes across all paths.
 
 - (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect 
 sweepDirection:(NSLineSweepDirection)sweepDirection 
 movementDirection:(NSLineMovementDirection)movementDirection 
 remainingRect:(NSRect *)remainingRect
 
 …is stopped being called after editing ended. Why? How can I freeze the 
 layout in the view for after editing ended?
 
 Alex
 
 
 Am 20.06.2012 um 01:41 schrieb Graham Cox:
 
 
 On 19/06/2012, at 7:02 PM, Alexander Reichstadt wrote:
 
 Hi,
 
 for the 
 
 - (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect 
 sweepDirection:(NSLineSweepDirection)sweepDirection 
 movementDirection:(NSLineMovementDirection)movementDirection 
 remainingRect:(NSRect *)remainingRect {
 
 call I'd like to calculate the proposedRect in case there are bezierPaths 
 limitations of custom shapes.
 
 So I thought there'd be a way to not only clipRect to shade out a piece of 
 a path, but also a way to get that spare-piece from the NSBezierPath 
 instance. Is there?
 
 No, not built-in anyway.
 
 I wanted to split up the bounds rect of the path to circumvent with the 
 text into stripes of the height of proposedRect passed into the call, then 
 considering the offset from top, if any, then pick the stripe I need and 
 see what the minimum bounds would be if the bezierpath stripe was an own 
 bezier path on its own. Or is there another way?
 
 
 I'm guessing you're trying to run text into an arbitrary path defined by a 
 bezier.
 
 If that's the case, I think your understanding of what the text system wants 
 from you here is a bit off. Basically, it tells you where it proposes to lay 
 the text down, and you can modify that to constrain it to lay it down 
 differently. So, for the proposedRect, you need to work out where that 
 intersects the edges of your path and pull the sides of that rect in until 
 they lie within the path. THERE IS NO BUILT-IN WAY TO DO THIS! But it's not 
 that hard. For the points representing the corners of the rect, you can find 
 out whether they are inside or outside the path with [NSBezierPath 
 containsPoint:], then use a binary approximation to shrink the rect until it 
 is just inside the path. In remainingRect, you return the bit of the 
 rect you are NOT using, in the direction of the text sweep. The text system 
 uses that to understand what part of the text it can't use this time round 
 and so will take that into account for the next fragment. You'll be called 
 again with the remainder rect as the proposedRect, so if your path shape is 
 such that more text could fit on the same line  but horizontally displaced, 
 you have an opportunity to calculate that as well. This system allows any 
 path shape to work, even paths that are disjoint, or that have holes.
 
 If the object is to run text around the outside of a path, it's the same 
 idea, you just return the rects outside instead.
 
 This method is called repeatedly until all the text is laid out - so you 
 don't usually precalculate a series of strips and figure out which one to 
 return - you just have to focus on the single strip being considered right 
 now. There is no method to intersect a rect with a bezier and return another 
 bezier (arbitrary bezier path set operations would be wonderful, but they 
 ain't happening, even after years of asking for it).
 
 --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/lxr%40mac.com
 
 This email sent to l...@mac.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

Calculating lineFragment for NSTextContainer

2012-06-19 Thread Alexander Reichstadt
Hi,

for the 

- (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect 
sweepDirection:(NSLineSweepDirection)sweepDirection 
movementDirection:(NSLineMovementDirection)movementDirection 
remainingRect:(NSRect *)remainingRect {

call I'd like to calculate the proposedRect in case there are bezierPaths 
limitations of custom shapes.

So I thought there'd be a way to not only clipRect to shade out a piece of a 
path, but also a way to get that spare-piece from the NSBezierPath instance. Is 
there?

I wanted to split up the bounds rect of the path to circumvent with the text 
into stripes of the height of proposedRect passed into the call, then 
considering the offset from top, if any, then pick the stripe I need and see 
what the minimum bounds would be if the bezierpath stripe was an own bezier 
path on its own. Or is there another way?

Thanks
Alex

___

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


Instruments, how to fix leak in C Lib

2012-05-02 Thread Alexander Reichstadt
Hi,

through Instruments I found a memory leak outside my code in a pqlib, the 
postgres client library. 

This is what Leaks prints out:

Bytes Used  # Leaks Symbol Name
  84.81 KB 100.0%   48  PQgetResult
  84.81 KB 100.0%   48   pqParseInput3
  80.00 KB  94.3%   40pqResultAlloc
  80.00 KB  94.3%   40 malloc
   4.00 KB   4.7%   4 pqAddTuple
   4.00 KB   4.7%   4  malloc
832 Bytes0.9%   4 PQmakeEmptyPGresult
832 Bytes0.9%   4  malloc


I thought that inside PQgetResult there ought to be a call to pqParseInput3, 
inside of which I would then e.g. find a call to pqResultAlloc. But this is not 
the case. So I thought maybe the compiled version of the C-library I am using 
here does not match the sourcecode I obtained. I recompiled the library from 
source, built the Objective-C framework and rebuilt my app and did a new trace, 
but the leaks' trees were identical also now that I excluded the source for 
error of there being a difference in version.

Please can someone help how to read this?

Cheers
___

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


Storing UTF8 Umlauts in Postgres using PGSQLKit

2012-03-22 Thread Alexander Reichstadt
Hi,


for a couple of reasons we migrated our project from mysql to postgres using 
PGSQLKit.

But we are experiencing problems storing UTF8 data. So far we checked the 
database to be able to store UTF8. When using pgPHPAdmin to store values with 
German Umlaute it works. When using PGSQLKit chars get garbled.

The following code stores the values:


const char *cString = [sql cStringUsingEncoding:NSUTF8StringEncoding];
if (cString == NULL) 
{ 
self.errorDescription = [NSString stringWithFormat:@ERROR: 
execCommand could not be losslessly converted to c string: %@, sql];
[self appendSQLLog:[NSString stringWithFormat:@%@\n, 
self.errorDescription]];
return NO;
}
res = PQexec(pgconn, cString);

Both sides seem correct, server as well as client, so I am not sure what the 
issue might be.

Any ideas?

Thanks
Alex
___

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


[Solved] Re: Storing UTF8 Umlauts in Postgres using PGSQLKit

2012-03-22 Thread Alexander Reichstadt
The issue was in PGSQLKit.

-(NSString *)sqlEncodeString:(NSString *)toEncode
{

//size_t result;
int error;
char *sqlEncodeCharArray = malloc(1 + ([toEncode length] * 2)); // per 
the libpq doc.
const char *sqlCharArrayToEncode = [toEncode 
cStringUsingEncoding:defaultEncoding];
size_t length = strlen(sqlCharArrayToEncode);

PQescapeStringConn ((PGconn *)pgconn, sqlEncodeCharArray,
(const char *)[toEncode 
cStringUsingEncoding:defaultEncoding], 
length, error);

//This is bad
//  NSString *encodedString = [[[NSString alloc] 
initWithFormat:@%s,sqlEncodeCharArray] //autorelease];
//Instead use
NSString *encodedString = [NSString 
stringWithCString:sqlEncodeCharArray encoding:defaultEncoding]; 

free(sqlEncodeCharArray);

return encodedString;   

}




Am 22.03.2012 um 09:09 schrieb Alexander Reichstadt:

 Hi,
 
 
 for a couple of reasons we migrated our project from mysql to postgres using 
 PGSQLKit.
 
 But we are experiencing problems storing UTF8 data. So far we checked the 
 database to be able to store UTF8. When using pgPHPAdmin to store values with 
 German Umlaute it works. When using PGSQLKit chars get garbled.
 
 The following code stores the values:
 
 
 const char *cString = [sql cStringUsingEncoding:NSUTF8StringEncoding];
   if (cString == NULL) 
   { 
   self.errorDescription = [NSString stringWithFormat:@ERROR: 
 execCommand could not be losslessly converted to c string: %@, sql];
[self appendSQLLog:[NSString stringWithFormat:@%@\n, 
 self.errorDescription]];
return NO;
}
   res = PQexec(pgconn, cString);
 
 Both sides seem correct, server as well as client, so I am not sure what the 
 issue might be.
 
 Any ideas?
 
 Thanks
 Alex
 ___
 
 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/lxr%40mac.com
 
 This email sent to l...@mac.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: [Solved] Re: Storing UTF8 Umlauts in Postgres using PGSQLKit

2012-03-22 Thread Alexander Reichstadt
Hi, sorry to hear that, but great to meet you here!! Let's catch up off list.

Alex




Am 22.03.2012 um 14:20 schrieb Andy 'Dru' Satori:

 Sorry I didn't see this, I was KO'd by the pollen and seasonal allergies.   
 Yes this is an issue with PGSQLkit, I have confirmed it and will be 
 committing a change today based upon yours to address this.  Thanks for patch!
 
 -- 
 Andy 'Dru' Satori
 
 On Thursday, March 22, 2012 at 6:55 AM, Alexander Reichstadt wrote:
 
 The issue was in PGSQLKit.
 
 -(NSString *)sqlEncodeString:(NSString *)toEncode
 {
 
 //size_t result;
 int  error;
 char *sqlEncodeCharArray = malloc(1 + ([toEncode length] * 2)); // per the 
 libpq doc.
 const char *sqlCharArrayToEncode = [toEncode 
 cStringUsingEncoding:defaultEncoding];
 size_t length = strlen(sqlCharArrayToEncode);
 PQescapeStringConn ((PGconn *)pgconn, sqlEncodeCharArray,
 (const char *)[toEncode cStringUsingEncoding:defaultEncoding],
 length, error);
 //This is bad
 //   NSString *encodedString = [[[NSString alloc] 
 initWithFormat:@%s,sqlEncodeCharArray] //autorelease];
 //Instead use
 NSString *encodedString = [NSString stringWithCString:sqlEncodeCharArray 
 encoding:defaultEncoding];
 
 free(sqlEncodeCharArray);
 return encodedString;
 }
 
 
 
 
 Am 22.03.2012 um 09:09 schrieb Alexander Reichstadt:
 
 Hi,
 
 
 for a couple of reasons we migrated our project from mysql to postgres 
 using PGSQLKit.
 
 But we are experiencing problems storing UTF8 data. So far we checked the 
 database to be able to store UTF8. When using pgPHPAdmin to store values 
 with German Umlaute it works. When using PGSQLKit chars get garbled.
 
 The following code stores the values:
 
 
 const char *cString = [sql cStringUsingEncoding:NSUTF8StringEncoding];
 if (cString == NULL)
 {
 self.errorDescription = [NSString stringWithFormat:@ERROR: execCommand 
 could not be losslessly converted to c string: %@, sql];
 [self appendSQLLog:[NSString stringWithFormat:@%@\n, 
 self.errorDescription]];
 return NO;
 }
 res = PQexec(pgconn, cString);
 
 Both sides seem correct, server as well as client, so I am not sure what 
 the issue might be.
 
 Any ideas?
 
 Thanks
 Alex
 ___
 
 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/lxr%40mac.com
 
 This email sent to l...@mac.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/dru%40druware.com
 
 This email sent to d...@druware.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


Bundled framework not found despite copy build phase and being inside the bundle

2012-03-09 Thread Alexander Reichstadt
Hi,

having added the PGSQLKit framework when being bundled it is not found. What I 
did was adding the framework, making sure it is linked against, making sure the 
copy buildphase with target frameworks is before the link phase. When I check, 
the built app bundle does contain the Frameworks directory as well as it 
containing the framework in question. But the app when trying to launch 
continues to search in ~/Library/Frameworks and works only if the framework is 
located there, otherwise it stops launching with some dylib error.

Where do I tell it to not search there but inside the bundle?


Thanks
Alex
___

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


[solved] Re: Bundled framework not found despite copy build phase and being inside the bundle

2012-03-09 Thread Alexander Reichstadt
I found the problem, the bundled framework being in another project did not 
have the @executable/../Frameworks set as a installation path.

dyld: Library not loaded: 
/Users/Alexander/Library/Frameworks/PGSQLKit.framework/Versions/A/PGSQLKit

Am 09.03.2012 um 22:00 schrieb Alexander Reichstadt:

 Hi,
 
 having added the PGSQLKit framework when being bundled it is not found. What 
 I did was adding the framework, making sure it is linked against, making sure 
 the copy buildphase with target frameworks is before the link phase. When I 
 check, the built app bundle does contain the Frameworks directory as well as 
 it containing the framework in question. But the app when trying to launch 
 continues to search in ~/Library/Frameworks and works only if the framework 
 is located there, otherwise it stops launching with some dylib error.
 
 Where do I tell it to not search there but inside the bundle?
 
 
 Thanks
 Alex
 ___
 
 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/lxr%40mac.com
 
 This email sent to l...@mac.com

___

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

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

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

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


Re: How to tell Xcode to forget file

2012-02-09 Thread Alexander Reichstadt
It seems the git repo somewhere stores the project filename outside the source 
directories. After recreating the project with a new name in the same location 
it worked. But where does git store its project information? There is no thing 
like a .git directory like there is for svn.


Am 09.02.2012 um 08:48 schrieb Alexander Reichstadt:

 If you mean to select the file and hit the delete-key, this was the first and 
 what seemed to be the most logical to me. It didn't do anything though. The 
 project behaved as if the file would still be included in a target, but it 
 wasn't anywhere.
 
 
 Am 09.02.2012 um 08:37 schrieb Vyacheslav Karamov:
 
 Hi!
 
 You need to remove file from the project tree in XCode.
 
 
 09.02.2012 9:20, Alexander Reichstadt пишет:
 Hi,
 I am loosing my mind here.
 
 I have a project. It was under git control. When I tried to compile it 
 failed. I noticed there was a wrong file added for iOS, the project was 
 Xcode. I removed the file. It now did compile but warned, now over the 
 absence of this file. I tried everything to get this removed in git, it 
 continued to complain, git wouldn't allow me to delete the file, fatal 
 error, path blablabla. Since this was so utterly senseless and after a day 
 I ended up creating a project from scratch. I added the folder formerly 
 under git control. The folder with the wrong file wasn't even in there when 
 looking at it in the finder, the new project in Xcode had no git activated. 
 STILL it complains about the missing file. Just to make sure, when I write 
 I tried everything, I mean everything, I must have cleaned all targets and 
 so on a hundred times to the point where Xcode crashed trying to clean the 
 clean.
 
 Please, can someone tell me how to get rid of this file?
 
 Thanks
 Alex
 ___
 
 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/ubuntulist%40yandex.ru
 
 This email sent to ubuntul...@yandex.ru
 
 
 
 ___
 
 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/lxr%40mac.com
 
 This email sent to l...@mac.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/lxr%40mac.com
 
 This email sent to l...@mac.com


___

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

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

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

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

Re: How to tell Xcode to forget file

2012-02-09 Thread Alexander Reichstadt
Never mind, I found a docu on git and where to look for .git and found it.

Thanks


Am 09.02.2012 um 09:22 schrieb Alexander Reichstadt:

 It seems the git repo somewhere stores the project filename outside the 
 source directories. After recreating the project with a new name in the same 
 location it worked. But where does git store its project information? There 
 is no thing like a .git directory like there is for svn.
 
 
 Am 09.02.2012 um 08:48 schrieb Alexander Reichstadt:
 
 If you mean to select the file and hit the delete-key, this was the first 
 and what seemed to be the most logical to me. It didn't do anything though. 
 The project behaved as if the file would still be included in a target, but 
 it wasn't anywhere.
 
 
 Am 09.02.2012 um 08:37 schrieb Vyacheslav Karamov:
 
 Hi!
 
 You need to remove file from the project tree in XCode.
 
 
 09.02.2012 9:20, Alexander Reichstadt пишет:
 Hi,
 I am loosing my mind here.
 
 I have a project. It was under git control. When I tried to compile it 
 failed. I noticed there was a wrong file added for iOS, the project was 
 Xcode. I removed the file. It now did compile but warned, now over the 
 absence of this file. I tried everything to get this removed in git, it 
 continued to complain, git wouldn't allow me to delete the file, fatal 
 error, path blablabla. Since this was so utterly senseless and after a day 
 I ended up creating a project from scratch. I added the folder formerly 
 under git control. The folder with the wrong file wasn't even in there 
 when looking at it in the finder, the new project in Xcode had no git 
 activated. STILL it complains about the missing file. Just to make sure, 
 when I write I tried everything, I mean everything, I must have cleaned 
 all targets and so on a hundred times to the point where Xcode crashed 
 trying to clean the clean.
 
 Please, can someone tell me how to get rid of this file?
 
 Thanks
 Alex
 ___
 
 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/ubuntulist%40yandex.ru
 
 This email sent to ubuntul...@yandex.ru
 
 
 
 ___
 
 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/lxr%40mac.com
 
 This email sent to l...@mac.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/lxr%40mac.com
 
 This email sent to l...@mac.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/lxr%40mac.com
 
 This email sent to l...@mac.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

How to tell Xcode to forget file

2012-02-08 Thread Alexander Reichstadt
Hi,
I am loosing my mind here.

I have a project. It was under git control. When I tried to compile it failed. 
I noticed there was a wrong file added for iOS, the project was Xcode. I 
removed the file. It now did compile but warned, now over the absence of this 
file. I tried everything to get this removed in git, it continued to complain, 
git wouldn't allow me to delete the file, fatal error, path blablabla. Since 
this was so utterly senseless and after a day I ended up creating a project 
from scratch. I added the folder formerly under git control. The folder with 
the wrong file wasn't even in there when looking at it in the finder, the new 
project in Xcode had no git activated. STILL it complains about the missing 
file. Just to make sure, when I write I tried everything, I mean everything, I 
must have cleaned all targets and so on a hundred times to the point where 
Xcode crashed trying to clean the clean.

Please, can someone tell me how to get rid of this file?

Thanks
Alex
___

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

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

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

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


Re: How to tell Xcode to forget file

2012-02-08 Thread Alexander Reichstadt
If you mean to select the file and hit the delete-key, this was the first and 
what seemed to be the most logical to me. It didn't do anything though. The 
project behaved as if the file would still be included in a target, but it 
wasn't anywhere.


Am 09.02.2012 um 08:37 schrieb Vyacheslav Karamov:

 Hi!
 
 You need to remove file from the project tree in XCode.
 
 
 09.02.2012 9:20, Alexander Reichstadt пишет:
 Hi,
 I am loosing my mind here.
 
 I have a project. It was under git control. When I tried to compile it 
 failed. I noticed there was a wrong file added for iOS, the project was 
 Xcode. I removed the file. It now did compile but warned, now over the 
 absence of this file. I tried everything to get this removed in git, it 
 continued to complain, git wouldn't allow me to delete the file, fatal 
 error, path blablabla. Since this was so utterly senseless and after a day I 
 ended up creating a project from scratch. I added the folder formerly under 
 git control. The folder with the wrong file wasn't even in there when 
 looking at it in the finder, the new project in Xcode had no git activated. 
 STILL it complains about the missing file. Just to make sure, when I write I 
 tried everything, I mean everything, I must have cleaned all targets and so 
 on a hundred times to the point where Xcode crashed trying to clean the 
 clean.
 
 Please, can someone tell me how to get rid of this file?
 
 Thanks
 Alex
 ___
 
 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/ubuntulist%40yandex.ru
 
 This email sent to ubuntul...@yandex.ru
 
 
 
 ___
 
 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/lxr%40mac.com
 
 This email sent to l...@mac.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

UIView is sized out of the blue

2012-01-02 Thread Alexander Reichstadt
Hi,

when returning from my detail view the list view is sized out of the blue.

in viewDidAppear I do this:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
if ([theSearchbar.text length]){
[theSearchbar becomeFirstResponder];
[self switchSearchbarInvisible:NO];
} else {
[theSearchbar resignFirstResponder];
[self switchSearchbarInvisible:YES];
}

}



In switchSearchbarInvisible: I do this:

- (void)switchSearchbarInvisible:(BOOL)isHidden
{
theSearchbar.hidden=isHidden;
CGRect tvbounds = [uiTableView bounds];

CGFloat ypos;
CGFloat yheight;
if (isHidden){
ypos = 0;
alphabetChoiceView.rowHeight=15.5;
} else {
ypos = 42;
alphabetChoiceView.rowHeight=14;
}

yheight = 406-ypos;
[uiTableView setFrame:CGRectMake(29, 
  ypos, 
  292, 
  yheight)];

tvbounds = [alphabetChoiceView bounds];
[alphabetChoiceView setFrame:CGRectMake(0, 
 ypos+2, 
 28, 
 yheight)];



if (!isHidden){
for (UIView *possibleButton in theSearchbar.subviews)
{
if ([possibleButton isKindOfClass:[UIButton class]])
{
UIButton *cancelButton = (UIButton*)possibleButton;
cancelButton.enabled = YES;
break;
}
}
}

[alphabetChoiceView setNeedsLayout];
[uiTableView setNeedsLayout];
[alphabetChoiceView setNeedsDisplay];
[alphabetChoiceView reloadData];
[self.view setNeedsLayout];
[self.view setNeedsDisplay];
 

}


Upon launching the app it works fine, so the via is correctly layouted. But 
once visiting the detail page it gets screwed up and the list view is pushed 
below the bottom toolbar. yheight is completely ignored.

As you can see I tried to refresh every contained view with everything I 
thought would make a change, but it seems that this all gets ignored. My 
question is how to make CocoaTouch stop ignoring my changes? I tried to have 
this called in viewDidLoad, viewWillLoad, viewWillAppear, viewDidAppear to no 
avail?

___

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: UIView is sized out of the blue

2012-01-02 Thread Alexander Reichstadt
I found the issue. The navigation bar was first shown and then removed, thus I 
ended calculating a wrong size.

Thanks

On 02.01.2012, at 16:17, Alexander Reichstadt wrote:

 Hi,
 
 when returning from my detail view the list view is sized out of the blue.
 
 in viewDidAppear I do this:
 - (void)viewDidAppear:(BOOL)animated
 {
[super viewDidAppear:animated];
if ([theSearchbar.text length]){
[theSearchbar becomeFirstResponder];
[self switchSearchbarInvisible:NO];
} else {
[theSearchbar resignFirstResponder];
[self switchSearchbarInvisible:YES];
}
 
 }
 
 
 
 In switchSearchbarInvisible: I do this:
 
 - (void)switchSearchbarInvisible:(BOOL)isHidden
 {
theSearchbar.hidden=isHidden;
CGRect tvbounds = [uiTableView bounds];
 
CGFloat ypos;
CGFloat yheight;
if (isHidden){
ypos = 0;
alphabetChoiceView.rowHeight=15.5;
} else {
ypos = 42;
alphabetChoiceView.rowHeight=14;
}
 
yheight = 406-ypos;
[uiTableView setFrame:CGRectMake(29, 
  ypos, 
  292, 
  yheight)];
 
tvbounds = [alphabetChoiceView bounds];
[alphabetChoiceView setFrame:CGRectMake(0, 
 ypos+2, 
 28, 
 yheight)];
 
 
 
if (!isHidden){
for (UIView *possibleButton in theSearchbar.subviews)
{
if ([possibleButton isKindOfClass:[UIButton class]])
{
UIButton *cancelButton = (UIButton*)possibleButton;
cancelButton.enabled = YES;
break;
}
}
}
 
[alphabetChoiceView setNeedsLayout];
[uiTableView setNeedsLayout];
[alphabetChoiceView setNeedsDisplay];
[alphabetChoiceView reloadData];
[self.view setNeedsLayout];
[self.view setNeedsDisplay];
 
 
 }
 
 
 Upon launching the app it works fine, so the via is correctly layouted. But 
 once visiting the detail page it gets screwed up and the list view is pushed 
 below the bottom toolbar. yheight is completely ignored.
 
 As you can see I tried to refresh every contained view with everything I 
 thought would make a change, but it seems that this all gets ignored. My 
 question is how to make CocoaTouch stop ignoring my changes? I tried to have 
 this called in viewDidLoad, viewWillLoad, viewWillAppear, viewDidAppear to no 
 avail?
 
 ___
 
 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/lxr%40mac.com
 
 This email sent to l...@mac.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


UIToolbar, can't access buttons added in IB

2011-12-29 Thread Alexander Reichstadt
Hi,

in my UIViewController using IB I can add buttons to its view's toolbar bar, I 
am referring to that bar widget thing at the bottom, just in case someone was 
as confused as I was at first. Anyway, I can see them in IB as well as in my 
running app. Yet, when debugging, I found no way to actually get a hold of 
their instances. If I use the controller and say 
navigationController.toolbar.items the resulting array is empty, even though 
the navigationController is not nil nor is its toolbar. I checked in - 
(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 
as well as in viewDidLoad. I also checked in the location where I create the 
instance of the controller.

Is there a way to actually do something with those buttons once they are added 
in IB, or is it like using IB they are built in concrete and somewhere 
inaccessible?

Thanks
Alex

___

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


How to get rid of the back button in UIView

2011-12-29 Thread Alexander Reichstadt
Hi,

this might be totally trivial, but all suggestions I found in the docu and on 
the web failed. I don't want my detail view to show any kind of back button. So 
from the documentation I came up with the following possibilities:

1. set leftItemsSupplementBackButton to NO
2. set leftBarButtonItem to nil
3. set leftBarButtonItems to nil

The button remains though.

self.detailViewController = [[BVZDetailViewController alloc] 
initWithNibName:@BVZDetailViewController bundle:nil];

self.detailViewController.navigationItem.leftItemsSupplementBackButton = NO;
self.detailViewController.navigationItem.leftBarButtonItem = nil;
self.detailViewController.navigationItem.title = @bla;

The title bla is displayed. So it's not clear where it is changed and where 
this button is added or rather where I should remove it after it is added by 
default.

I tried the code above --just slightly changed to self.navigationItem--

- in the controller where the detail view is created
- in initWithNib
- in viewDidLoad

Nothing changes except for the title.

Please, can someone help?

Thanks
Alex
___

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: How to get rid of the back button in UIView

2011-12-29 Thread Alexander Reichstadt
Thanks, this works.



On 29.12.2011, at 11:45, lbland wrote:

 hi-
 
 On Dec 29, 2011, at 5:35 AM, Alexander Reichstadt wrote:
 
 Please, can someone help?
 
 navigationItem.hidesBackButton = YES;
 
 ??
 
 ... but maybe your detailed view should be some other type of modal view 
 controller ...
 
 thanks!-
 
 -lance
 

___

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


CoreData inconsistency caching error snafu

2011-12-25 Thread Alexander Reichstadt
Hi,

On Xcode 4.2 I am getting some error that makes no sense to me and all similar 
reports on the web don't seem to apply:


CoreData: FATAL ERROR: The persistent cache of section information does not 
match the current configuration.  You have illegally mutated the 
NSFetchedResultsController's fetch request, its predicate, or its sort 
descriptor without either disabling caching or using +deleteCacheWithName:


After I reset the simulator device it works once, I quit the app, launch it and 
get the same message. The first launch I did make a fetch, it downloads some 
data and puts them into the sqlite core data store, then I call

[self saveContext];

If I don't call saveContext, my data is not saved, and next launch it needs to 
download it all over again. If I do save I get aforementioned message.

At the end of the message which also lists all objects in core data, it states:

 *** Terminating app due to uncaught exception 
'NSInternalInconsistencyException', reason: 'CoreData: FATAL ERROR: The 
persistent cache of section information does not match the current 
configuration.  You have illegally mutated the NSFetchedResultsController's 
fetch request, its predicate, or its sort descriptor without either disabling 
caching or using +deleteCacheWithName:'

When looking at the documentation on deleteCacheWithName, things make even less 
sense to me, because I never cached anything.

Please, could someone help?

Thanks
Alex

___

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: CoreData inconsistency caching error snafu

2011-12-25 Thread Alexander Reichstadt
Never mind…..I didn't know I need to look after the 
NSFetchedResultsController……..actually I am not sure what'd be the best to do. 
I toy around and see what works best.

On 26.12.2011, at 02:46, Alexander Reichstadt wrote:

 Hi,
 
 On Xcode 4.2 I am getting some error that makes no sense to me and all 
 similar reports on the web don't seem to apply:
 
 
 CoreData: FATAL ERROR: The persistent cache of section information does not 
 match the current configuration.  You have illegally mutated the 
 NSFetchedResultsController's fetch request, its predicate, or its sort 
 descriptor without either disabling caching or using +deleteCacheWithName:
 
 
 After I reset the simulator device it works once, I quit the app, launch it 
 and get the same message. The first launch I did make a fetch, it downloads 
 some data and puts them into the sqlite core data store, then I call
 
[self saveContext];
 
 If I don't call saveContext, my data is not saved, and next launch it needs 
 to download it all over again. If I do save I get aforementioned message.
 
 At the end of the message which also lists all objects in core data, it 
 states:
 
 *** Terminating app due to uncaught exception 
 'NSInternalInconsistencyException', reason: 'CoreData: FATAL ERROR: The 
 persistent cache of section information does not match the current 
 configuration.  You have illegally mutated the NSFetchedResultsController's 
 fetch request, its predicate, or its sort descriptor without either disabling 
 caching or using +deleteCacheWithName:'
 
 When looking at the documentation on deleteCacheWithName, things make even 
 less sense to me, because I never cached anything.
 
 Please, could someone help?
 
 Thanks
 Alex
 
 ___
 
 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/lxr%40mac.com
 
 This email sent to l...@mac.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: NSString looses Umlaute

2011-12-22 Thread Alexander Reichstadt
Yes, you are right, but it does not make a difference, I tried all encodings. 
This is a DBF file. From the DBF file format description the header is binary 
and the rest is ASCII.

I found an older post from someone with French special chars that went lost:
http://stackoverflow.com/questions/4913499/utf8-character-decoding-in-objective-c

But the solution suggested there doesn't work:
NSString *correctString = [NSString stringWithCString:[utf8String 
cStringUsingEncoding:NSISOLatin1StringEncoding] encoding:NSUTF8StringEncoding];
I know the content of the DBF file. I don't want to write a DBF parser, I only 
want to read this specific file and it does correctly read all fields and 
lines, but the Umlaute are still lost. It does work correctly on the Windows 
side using the browser app for that particular database.

The reason I used the percent-lines was to see what happens to the Umlaute, and 
inspecting them inbetween changing to and from percent escaped strings they 
seem to be handled correctly.

Alex

Am 22.12.2011 um 02:18 schrieb Ben Kennedy:

 On 21 Dec 2011, at 4:45 pm, Alexander Reichstadt wrote:
 
  NSString *theContent = [[NSString alloc] initWithData:theData 
 encoding:NSASCIIStringEncoding];
   theContent = [[theContent componentsSeparatedByString:@\r] 
 objectAtIndex:1]; 
   theContent = [theContent 
 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
   theContent = [theContent 
 stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
 
 Is this really your code?  What is the purpose of the latter two lines?  They 
 are completely reciprocal (i.e. redundant).
 
 I can even see it handles everything correctly in NSLog, first I see the 
 unicode for an Umlaut, then it converts it to the correct percent value, 
 like like ö to 94, but when the final NSString is printed to an NSControl, 
 the Umlaute are missing or garbled.
 
 The original file is ascii-encoded.
 
 Impossible.  ASCII does not represent any characters with diacritical marks.  
 Perhaps the original file is ISO-Latin-1 encoded.  You could try using 
 NSISOLatin1StringEncoding.
 
 b
 
 --
 Ben Kennedy, chief magician
 Zygoat Creative Technical Services
 http://www.zygoat.ca
 

___

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: NSString looses Umlaute

2011-12-22 Thread Alexander Reichstadt
Yes, tried NSUTF8StringEncoding, I really tried all the ones I found in the 
NSString encoding documentation.

When I import this file as DBF into FileMaker Pro it looks just as bad. But 
when I import it into a MySql it works fine.

Here an example of what NSLog says:

R\U0094h.,
R\U0094hrchen

It should instead say Röhrchen.

Is the escape sequence even correct or shouldn't it have two slashes instead?

Alex



Am 22.12.2011 um 09:49 schrieb vincent habchi:

 Le 22 déc. 2011 à 09:13, Alexander Reichstadt l...@mac.com a écrit :
 
 Yes, you are right, but it does not make a difference, I tried all encodings.
 
 Did you try UTF-8 encoding?
 
 Besides, if you open your file with an external application, e.g. OpenOffice 
 or TextWrangler, what happens?
 
 Vincent
 

___

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: NSString looses Umlaute

2011-12-22 Thread Alexander Reichstadt
OK, I found a way to import it into FileMaker. It looks good when I use DOS 
Encoding. But when I use kCFStringEncoding derivates I had no luck. I know CF 
and NSString is toll free bridged, but does this apply to the encodings as 
well? There is some post from 2000 by Ali Ozer that would suggest it's not the 
case.




Am 22.12.2011 um 10:24 schrieb Vincent Habchi:

 Yes, tried NSUTF8StringEncoding, I really tried all the ones I found in the 
 NSString encoding documentation.
 
 When I import this file as DBF into FileMaker Pro it looks just as bad. But 
 when I import it into a MySql it works fine.
 
 Here an example of what NSLog says:
 
R\U0094h.,
R\U0094hrchen
 
 It should instead say Röhrchen.
 
 It looks like you string is UTF-16 based (\U0094 looks like UTF-16).
 But ö should be \U00F6, not \U0094 or 0xC3 0xB6 in UTF-8.
 
 Something is rotten in your tubes! ;)
 
 Cheers,
 Vincent

___

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: NSString looses Umlaute

2011-12-22 Thread Alexander Reichstadt
Thanks, it works. The following solved the problem, where theChoice is a URL to 
a local file from an NSOpenPanel:

NSData *theData = [NSData dataWithContentsOfURL:theChoice];
NSString *theContent = [[NSString alloc] initWithData:theData encoding:

CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingDOSLatin1)
];



Am 22.12.2011 um 10:50 schrieb Jean-Daniel Dupas:

 
 Le 22 déc. 2011 à 10:42, Alexander Reichstadt a écrit :
 
 OK, I found a way to import it into FileMaker. It looks good when I use DOS 
 Encoding. But when I use kCFStringEncoding derivates I had no luck. I know 
 CF and NSString is toll free bridged, but does this apply to the encodings 
 as well? There is some post from 2000 by Ali Ozer that would suggest it's 
 not the case
 
 No. NS and CF encoding don't have the same value.
 
 You can use CFStringConvertEncodingToNSStringEncoding() and 
 CFStringConvertNSStringEncodingToEncoding() to convert encoding.
 
 
 
 
 Am 22.12.2011 um 10:24 schrieb Vincent Habchi:
 
 Yes, tried NSUTF8StringEncoding, I really tried all the ones I found in 
 the NSString encoding documentation.
 
 When I import this file as DBF into FileMaker Pro it looks just as bad. 
 But when I import it into a MySql it works fine.
 
 Here an example of what NSLog says:
 
  R\U0094h.,
  R\U0094hrchen
 
 It should instead say Röhrchen.
 
 It looks like you string is UTF-16 based (\U0094 looks like UTF-16).
 But ö should be \U00F6, not \U0094 or 0xC3 0xB6 in UTF-8.
 
 Something is rotten in your tubes! ;)
 
 Cheers,
 Vincent
 
 ___
 
 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/devlists%40shadowlab.org
 
 This email sent to devli...@shadowlab.org
 
 -- Jean-Daniel
 
 
 
 

___

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: NSString looses Umlaute

2011-12-22 Thread Alexander Reichstadt
Thanks, but I  have not tried. My thinking went along the lines of if I read 
the string directly from the URL I have no control over what encoding is being 
used for reading or it defaults to something. If I first read as data, I can do 
with those bytes as I please. The DBF file is not in one consistent encoding 
from start to finish. The DBF file format documentation says the header is in 
binary, then there is a linefeed (\r), then there is the body. Each field has a 
fixed length, wether used or not doesn't matter, the unused rest is filled with 
spaces.

So, I read the file as data, stringily it as DOSLatin1, split it at the 
linefeed and read the body according to the field definitions I am given. They 
are guaranteed, so maybe some day I get around to writing a nice DBF parser, 
but until then I go by the guaranteed field lengths.

I tested it now on a couple of files and it works without a hitch.


Am 22.12.2011 um 14:40 schrieb Mike Abdullah:

 
 On 22 Dec 2011, at 09:59, Alexander Reichstadt wrote:
 
 Thanks, it works. The following solved the problem, where theChoice is a URL 
 to a local file from an NSOpenPanel:
 
   NSData *theData = [NSData dataWithContentsOfURL:theChoice];
   NSString *theContent = [[NSString alloc] initWithData:theData encoding:
   
 CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingDOSLatin1)
   ];
 
 You can initialise a string directly from the contents of a URL you realise, 
 right? Or are you saying that doesn't work, but this technique somehow does?
 

___

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: NSString looses Umlaute

2011-12-22 Thread Alexander Reichstadt
The header cannot be of a fixed length, as it contains the fields, their length 
and their types, which can vary. What it says there is:

n above is the last byte in the field descriptor array. The size of the array 
depends on the number of fields in the table file.

More on this here:
http://dbase.com/KnowledgeBase/int/db7_file_fmt.htm



Am 22.12.2011 um 17:29 schrieb Ken Thomases:

 On Dec 22, 2011, at 9:54 AM, Alexander Reichstadt wrote:
 
 The DBF file format documentation says the header is in binary, then there 
 is a linefeed (\r), then there is the body. Each field has a fixed length, 
 wether used or not doesn't matter, the unused rest is filled with spaces.
 
 So, I read the file as data, stringily it as DOSLatin1, split it at the 
 linefeed and read the body according to the field definitions I am given. 
 They are guaranteed, so maybe some day I get around to writing a nice DBF 
 parser, but until then I go by the guaranteed field lengths.
 
 I tested it now on a couple of files and it works without a hitch.
 
 If the header is binary, then any of its bytes might be 0x0D, which is the 
 same as \r (or did you actually mean it when you said linefeed which is 
 0x0A or \n?), so your approach will fail.  In all probability, the header is 
 a fixed length and you can just skip that part of the data.  Either way, if 
 this is meant for more than a casual, one-off, in-house app, you'll have to 
 find a more reliable technique.
 
 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: NSString looses Umlaute

2011-12-22 Thread Alexander Reichstadt
I should add, you are right in that it also says:

n+1, 1 byte, 0x0D stored as the Field Descriptor terminator.

Everything from byte 68 on is then a multiple of 48 bytes, so I can simply 
check on each 67+(n*48)+1 to see if that byte is 0x0D, which is the marker 
position of which to follow Mike's advise on getting the subdata.

Alex


Am 22.12.2011 um 17:29 schrieb Ken Thomases:

 On Dec 22, 2011, at 9:54 AM, Alexander Reichstadt wrote:
 
 The DBF file format documentation says the header is in binary, then there 
 is a linefeed (\r), then there is the body. Each field has a fixed length, 
 wether used or not doesn't matter, the unused rest is filled with spaces.
 
 So, I read the file as data, stringily it as DOSLatin1, split it at the 
 linefeed and read the body according to the field definitions I am given. 
 They are guaranteed, so maybe some day I get around to writing a nice DBF 
 parser, but until then I go by the guaranteed field lengths.
 
 I tested it now on a couple of files and it works without a hitch.
 
 If the header is binary, then any of its bytes might be 0x0D, which is the 
 same as \r (or did you actually mean it when you said linefeed which is 
 0x0A or \n?), so your approach will fail.  In all probability, the header is 
 a fixed length and you can just skip that part of the data.  Either way, if 
 this is meant for more than a casual, one-off, in-house app, you'll have to 
 find a more reliable technique.
 
 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


NSString looses Umlaute

2011-12-21 Thread Alexander Reichstadt
Hi,

NSString eats the Umlaute. How do I tell NSString to not do that? I tried:

NSString *theContent = [[NSString alloc] initWithData:theData 
encoding:NSASCIIStringEncoding];
theContent = [[theContent componentsSeparatedByString:@\r] 
objectAtIndex:1]; 
theContent = [theContent 
stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
theContent = [theContent 
stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

  

I can even see it handles everything correctly in NSLog, first I see the 
unicode for an Umlaut, then it converts it to the correct percent value, like 
like ö to 94, but when the final NSString is printed to an NSControl, the 
Umlaute are missing or garbled.

The original file is ascii-encoded.

Thanks
Alex___

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


Account validation in CocoaTouch for the purchased app

2011-12-20 Thread Alexander Reichstadt
Hi,

given an app is sold on iTunes, is there a way for that app to find out which 
email address was used for the iTunes account when it was purchased?

Thanks
Alex

___

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


Using Spotlight to query external source

2011-12-17 Thread Alexander Reichstadt
Hi,

reading through the spotlight docu I am not sure where to start or if the 
following is possible. I am trying to find out if a spotlight importer can be 
used to query external data sources. I know the advantage of spotlight is meant 
to pre-catalog files in order to quickly return results. But in other cases 
where there is data not permanently available I am looking for a way to only 
hook into the user entering something into spotlight to additionally forward 
the query to another process or even other server or machine. Is this possible?

Thank you
Alex

___

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


localization nib vs. xib in release build

2011-11-03 Thread Alexander Reichstadt
Hi,

there is a problem localizing the resources for my project.

The way I went about localizing the original English xib was to select it, add 
a loc-language, then I localized it, cleaned the build and ran the app.

My system is running using German language as setup in system preferences and 
verified in other apps.

What's unexpected are two things:
- my app still launches in English
- the English.lproj contains the nib file I localized as e.g. MainMenu.nib, the 
German.lproj however still contains a MainMenu.xib

Shouldn't the localized resource also be .nib and be used then? Is this a bug 
or a step missing in this approach? This was with latest Snowleopard and XCode 
4.x. For both, release and debug configuration, I ensured to have flatten xib 
files set to YES. Also I deleted all derived data.

Thanks
Alex
___

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: How to draw over a control in an NSView

2011-10-31 Thread Alexander Reichstadt
There remains an issue. NSTextViews underneath the drawing view don't respond 
to key events. Text can be selected though, but the highlight color of selected 
text is grey, as if the textview was not first responder and keyview. Any other 
control works correctly though, also textfields.

Alex


Am 31.10.2011 um 00:07 schrieb Alexander Reichstadt:

 Thanks much. I ended up subclassing an NSView to draw the required things, 
 subclassed another view to be the containing superview and hold controls, and 
 override in the containing view the addSubview method to always have it call 
 super and also add the drawing view-subclass at the end. That way the view is 
 always added on top of all others. In the given scenario the containing 
 superview dynamically loads subviews anyway, so overriding addSubview seems 
 to be the easiest path.
 
 Alex
 
 Am 30.10.2011 um 22:06 schrieb Jens Alfke:
 
 
 On Oct 30, 2011, at 12:46 PM, Alexander Reichstadt wrote:
 
 given a custom NSView using drawRect to draw, say, a blue rectangle, 
 controls inside that view are always in front of the blue rectangle. Is 
 there a way to draw above controls with drawRect? Also putting a view with 
 controls inside another view that draw in drawRect doesn't change that. 
 Like textfields, they are always above drawn content. How does one draw 
 above controls?
 
 Subviews are always drawn after their superview, so they are visually in 
 front of it. You can’t change that.
 What you can try is adding a subview, positioning it over the control, and 
 putting it in front (I think that means later in the subviews array.) 
 Historically AppKit hasn’t handled overlapping sibling views, but I think 
 that nowadays if you make the parent view layer-backed it will work. (But 
 layer-backing views brings its own visual issues, so this may not work out 
 for you.)
 
 Another approach is to subclass the control (or its cell class) and 
 customize its drawing.
 
 —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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How to draw over a control in an NSView

2011-10-31 Thread Alexander Reichstadt
I found the source of the problem. The hitTest looked at the wrong view for 
subviews. What was misleading me was that still textfields reacted correctly 
while textviews did not.

Alex


Am 31.10.2011 um 10:44 schrieb Alexander Reichstadt:

 There remains an issue. NSTextViews underneath the drawing view don't respond 
 to key events. Text can be selected though, but the highlight color of 
 selected text is grey, as if the textview was not first responder and 
 keyview. Any other control works correctly though, also textfields.
 
 Alex
 
 
 Am 31.10.2011 um 00:07 schrieb Alexander Reichstadt:
 
 Thanks much. I ended up subclassing an NSView to draw the required things, 
 subclassed another view to be the containing superview and hold controls, 
 and override in the containing view the addSubview method to always have it 
 call super and also add the drawing view-subclass at the end. That way the 
 view is always added on top of all others. In the given scenario the 
 containing superview dynamically loads subviews anyway, so overriding 
 addSubview seems to be the easiest path.
 
 Alex
 
 Am 30.10.2011 um 22:06 schrieb Jens Alfke:
 
 
 On Oct 30, 2011, at 12:46 PM, Alexander Reichstadt wrote:
 
 given a custom NSView using drawRect to draw, say, a blue rectangle, 
 controls inside that view are always in front of the blue rectangle. Is 
 there a way to draw above controls with drawRect? Also putting a view with 
 controls inside another view that draw in drawRect doesn't change that. 
 Like textfields, they are always above drawn content. How does one draw 
 above controls?
 
 Subviews are always drawn after their superview, so they are visually in 
 front of it. You can’t change that.
 What you can try is adding a subview, positioning it over the control, and 
 putting it in front (I think that means later in the subviews array.) 
 Historically AppKit hasn’t handled overlapping sibling views, but I think 
 that nowadays if you make the parent view layer-backed it will work. (But 
 layer-backing views brings its own visual issues, so this may not work out 
 for you.)
 
 Another approach is to subclass the control (or its cell class) and 
 customize its drawing.
 
 —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:
 http://lists.apple.com/mailman/options/cocoa-dev/lxr%40mac.com
 
 This email sent to l...@mac.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


How to draw over a control in an NSView

2011-10-30 Thread Alexander Reichstadt
Hi,

given a custom NSView using drawRect to draw, say, a blue rectangle, controls 
inside that view are always in front of the blue rectangle. Is there a way to 
draw above controls with drawRect? Also putting a view with controls inside 
another view that draw in drawRect doesn't change that. Like textfields, they 
are always above drawn content. How does one draw above controls?

Thanks
Alex

___

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: How to draw over a control in an NSView

2011-10-30 Thread Alexander Reichstadt
Thanks much. I ended up subclassing an NSView to draw the required things, 
subclassed another view to be the containing superview and hold controls, and 
override in the containing view the addSubview method to always have it call 
super and also add the drawing view-subclass at the end. That way the view is 
always added on top of all others. In the given scenario the containing 
superview dynamically loads subviews anyway, so overriding addSubview seems to 
be the easiest path.

Alex

Am 30.10.2011 um 22:06 schrieb Jens Alfke:

 
 On Oct 30, 2011, at 12:46 PM, Alexander Reichstadt wrote:
 
 given a custom NSView using drawRect to draw, say, a blue rectangle, 
 controls inside that view are always in front of the blue rectangle. Is 
 there a way to draw above controls with drawRect? Also putting a view with 
 controls inside another view that draw in drawRect doesn't change that. Like 
 textfields, they are always above drawn content. How does one draw above 
 controls?
 
 Subviews are always drawn after their superview, so they are visually in 
 front of it. You can’t change that.
 What you can try is adding a subview, positioning it over the control, and 
 putting it in front (I think that means later in the subviews array.) 
 Historically AppKit hasn’t handled overlapping sibling views, but I think 
 that nowadays if you make the parent view layer-backed it will work. (But 
 layer-backing views brings its own visual issues, so this may not work out 
 for you.)
 
 Another approach is to subclass the control (or its cell class) and customize 
 its drawing.
 
 —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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


PDFKit reference count underflow with garbage collection

2011-10-14 Thread Alexander Reichstadt
Hi,

generating a PDF throws

malloc: reference count underflow

I have garbage collection turned on.

The issue occurs here:

returnData = [fullDoc dataRepresentation];

fullDoc is a PDFDocument.



Thanks for any help
Alex

___

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: PDFKit reference count underflow with garbage collection

2011-10-14 Thread Alexander Reichstadt

Found b.bum's post at 
http://www.cocoabuilder.com/archive/cocoa/240877-reference-count-underflow-when-writing-pdf.html
Thanks

Am 14.10.2011 um 11:57 schrieb Alexander Reichstadt:

 Hi,
 
 generating a PDF throws
 
 malloc: reference count underflow
 
 I have garbage collection turned on.
 
 The issue occurs here:
 
 returnData = [fullDoc dataRepresentation];
 
 fullDoc is a PDFDocument.
 
 
 
 Thanks for any help
 Alex
 

___

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


PrintOperation reappears when cancelled

2011-10-13 Thread Alexander Reichstadt
Hi,

in our project we have a print operation to print from a view drawn offline. 
This all works fine. But if the operation is cancelled in the printdialog and 
document window closed, another document window selected and then ordered to 
print, the print dialog shows up twice. Once for the previously cancelled 
operation and once for the current operation. This can be increased 
arbitrarily. All cancelled operations are represented to the user.

Garbage collection is turned on, if this is relevant.

Is there something else that needs to be done in case it is cancelled?

Thanks
Alex
___

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


[Solved] Re: PrintOperation reappears when cancelled

2011-10-13 Thread Alexander Reichstadt
[op cleanUp];

Thanks

Am 13.10.2011 um 11:48 schrieb Alexander Reichstadt:

 Hi,
 
 in our project we have a print operation to print from a view drawn offline. 
 This all works fine. But if the operation is cancelled in the printdialog and 
 document window closed, another document window selected and then ordered to 
 print, the print dialog shows up twice. Once for the previously cancelled 
 operation and once for the current operation. This can be increased 
 arbitrarily. All cancelled operations are represented to the user.
 
 Garbage collection is turned on, if this is relevant.
 
 Is there something else that needs to be done in case it is cancelled?
 
 Thanks
 Alex

___

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


[unsolved] Re: PrintOperation reappears when cancelled

2011-10-13 Thread Alexander Reichstadt
OK, this didn't work. It seemed to work, but only because the app sat for a few 
seconds before the next attempt to print. The print dialog reappears for each 
window from which there was an attempt to print and cancelled. I found no 
thread or hint on how to fix this. It seems to be related to garbage 
collection, but it's not clear, if so, what to do in finalize. Even when the 
previous window is closed, when trying to print, that previous window is opened 
and the print dialog presented within. After a while though such self-reopened 
windows fall apart, like list entries going missing and labels presenting no 
more strings.

I tried:
forcing garbage collection in finalize
suggesting garbage collection in finalize
removing printed view from notification center, even though it has never been 
made an observer
setting all properties of printed view to nil in finalize
cleanUpOperation in printOperationDidRun

The view's finalize method is processed, so it definitely seems to get 
collected. Any help is greatly appreciated.


{
.
NSDictionary *printJob = [NSDictionary 
dictionaryWithObjectsAndKeys:allItems,kPrintItems,nil];

//this is just for testing to print the same job multiple times for serial 
letter function
NSArray *printData = [NSArray 
arrayWithObjects:printJob,printJob,printJob,nil];

NSPrintInfo *pi = [NSPrintInfo sharedPrintInfo];
LXPrintView *pv = [[LXPrintView alloc] initWithPrintObjects:printData 
andPrintInfo:pi forPrintDelegate:self];

NSPrintOperation *op = [NSPrintOperation printOperationWithView:pv 
printInfo:pi];
[pv release];

[op runOperationModalForWindow:[[self view] window]
  delegate:self

didRunSelector:@selector(printOperationDidRun:success:contextInfo:)
   contextInfo:nil];


[pv release];
}

- (void)printOperationDidRun:(NSPrintOperation *)printOperation  
success:(BOOL)success  contextInfo:(void *)contextInfo
{

[printOperation cleanUpOperation];
}



Am 13.10.2011 um 11:51 schrieb Alexander Reichstadt:

 [op cleanUp];
that should have been cleanUpOperation
 
 Thanks
 
 Am 13.10.2011 um 11:48 schrieb Alexander Reichstadt:
 
 Hi,
 
 in our project we have a print operation to print from a view drawn offline. 
 This all works fine. But if the operation is cancelled in the printdialog 
 and document window closed, another document window selected and then 
 ordered to print, the print dialog shows up twice. Once for the previously 
 cancelled operation and once for the current operation. This can be 
 increased arbitrarily. All cancelled operations are represented to the user.
 
 Garbage collection is turned on, if this is relevant.
 
 Is there something else that needs to be done in case it is cancelled?
 
 Thanks
 Alex
 
 ___
 
 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/lxr%40mac.com
 
 This email sent to l...@mac.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: Window closes on its own

2011-09-06 Thread Alexander Reichstadt
No, I haven't retained it explicitly. Thanks, makes sense.


Am 06.09.2011 um 11:23 schrieb jonat...@mugginsoft.com:

 
 On 5 Sep 2011, at 21:25, Alexander Reichstadt wrote:
 
 I can't due to using the garbage collection.
 
 Am 05.09.2011 um 20:47 schrieb Jens Alfke:
 
 
 On Sep 5, 2011, at 12:08 AM, Alexander Reichstadt wrote:
 
 the window created through the following code closes on its own after one 
 second. Why?
 
 I’m guessing there’s an extra -release call (or insufficient -retains) and 
 the window’s getting dealloced after the autorelease pool drains.
 
 Try setting a breakpoint in the -dealloc method, adding a generic -dealloc 
 if you don’t already have one.
 
 
 Jens' point is still valid. Have you retained a reference to your controller 
 object so that it is reachable? 
 
 PWSuggestionsWindowController *newCon = [[PWSuggestionsWindowController 
 alloc] initWithWindowNibName:@PWSuggestionsView];
   [[newCon window] makeKeyAndOrderFront:self];
 
 In the above snippet newCon needs to be reachable or the collector will 
 finalise it.
 Normally controller objects are referenced via ivars, often in the 
 application delegate.
 This makes them reachable via the application root (NSApp).
 
 http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcEssentials.html
 
 Regards
 
 Jonathan Mitchell
 
 Developer
 Mugginsoft LLP
 http://www.mugginsoft.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/lxr%40mac.com
 
 This email sent to l...@mac.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


Window closes on its own

2011-09-05 Thread Alexander Reichstadt
Hi,

the window created through the following code closes on its own after one 
second. Why?

PWSuggestionsWindowController *newCon = [[PWSuggestionsWindowController 
alloc] initWithWindowNibName:@PWSuggestionsView];
[[newCon window] makeKeyAndOrderFront:self];

And the subclass of window:

- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle 
backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
{
self = [super initWithContentRect:contentRect 
styleMask:NSBorderlessWindowMask backing:bufferingType defer:NO];
if (self) {
// Initialization code here.
}

return self;
}

Neither windowShouldClose is called on this occasion. It seems it is so known 
and obvious it is not documented any place one can easily google or find. This 
wasn't the case pre-10.5 though afaik.

Please, can someone shed light on this?

Thank you
Alex

___

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: Window closes on its own

2011-09-05 Thread Alexander Reichstadt
I added canBecomeKey, now it stays open. Has this been changed after 10.4?

Am 05.09.2011 um 09:08 schrieb Alexander Reichstadt:

 Hi,
 
 the window created through the following code closes on its own after one 
 second. Why?
 
 PWSuggestionsWindowController *newCon = [[PWSuggestionsWindowController 
 alloc] initWithWindowNibName:@PWSuggestionsView];
 [[newCon window] makeKeyAndOrderFront:self];
 
 And the subclass of window:
 
 - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle 
 backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
 {
 self = [super initWithContentRect:contentRect 
 styleMask:NSBorderlessWindowMask backing:bufferingType defer:NO];
 if (self) {
 // Initialization code here.
 }
 
 return self;
 }
 
 Neither windowShouldClose is called on this occasion. It seems it is so known 
 and obvious it is not documented any place one can easily google or find. 
 This wasn't the case pre-10.5 though afaik.
 
 Please, can someone shed light on this?
 
 Thank you
 Alex
 

___

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: Window closes on its own

2011-09-05 Thread Alexander Reichstadt
I can't due to using the garbage collection.

Am 05.09.2011 um 20:47 schrieb Jens Alfke:

 
 On Sep 5, 2011, at 12:08 AM, Alexander Reichstadt wrote:
 
 the window created through the following code closes on its own after one 
 second. Why?
 
 I’m guessing there’s an extra -release call (or insufficient -retains) and 
 the window’s getting dealloced after the autorelease pool drains.
 
 Try setting a breakpoint in the -dealloc method, adding a generic -dealloc if 
 you don’t already have one.
 
 —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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Representation of strings with special chars

2011-08-25 Thread Alexander Reichstadt
Hi,

Thank you for your many responses.

const char *cstr = [s UTF8String];
mysql_stmt_prepare(myStatement, cstr, strlen(cstr));


This fixed the bug. 

Alexander


Am 24.08.2011 um 22:37 schrieb Greg Parker:

 On Aug 24, 2011, at 1:24 PM, Alexander Reichstadt wrote:
 Actually it's a couple of wrapper-classes to MYSQL c-calls by Karl Kraft.
 
 In the sqlfetch-class, eventually it arrives at
 
 mysql_stmt_prepare(myStatement, [s UTF8String],[s length])
 
 where s is the NSString instance containing the SELECT-statement, such as 
 SELECT field=someÜberthing.
 
 From there it goes on to
 
 int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
  unsigned long length);
 
 and at this point it fails.
 
 First, [s length] is the wrong value to pass as the length of [s UTF8String]. 
 Try this instead:
const char *cstr = [s UTF8String];
mysql_stmt_prepare(myStatement, cstr, strlen(cstr));
 
 Second, this code is sending UTF-8 encoded character data to MySQL. Make sure 
 that your MySQL environment is configured to accept UTF-8 data.

 http://rentzsch.tumblr.com/post/9133498042/howto-use-utf-8-throughout-your-web-stack
 If your MySQL system instead expects some other encoding like ISO Latin-1, 
 you can tell NSString to output that instead.
[myString cStringUsingEncoding:NSISOLatin1StringEncoding];
 
 
 -- 
 Greg Parker gpar...@apple.com Runtime Wrangler
 
 

___

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


Representation of strings with special chars

2011-08-24 Thread Alexander Reichstadt
Hi,

we have a phenomenon, that is not quite clear. This is with 10.6.7 Xcode 4.0.

NSArray *test = [NSArray arrayWithObject:@ÜÄÖüäö];
NSLog(@%@,test);
NSLog(@%@,[test objectAtIndex:0]);

This prints out the following:

2011-08-24 20:03:19.129 PetWorkX[15717:903] (
\U00dc\U00c4\U00d6\U00fc\U00e4\U00f6
)
2011-08-24 20:03:19.129 PetWorkX[15717:903] ÜÄÖüäö

Reason to ask and problem to solve is, that the values with Umlauts are to be 
passed on to an SQL backend, and in some cases the umlauts are not forwarded 
correctly. Escaped they return no answer or, even worse, cause an SQL error and 
the sql connection to break. Also escaping the umlauts int he sql connection 
does not work.

So far we weren't able to fully figure out under which conditions the umlauts 
are passed on correctly and under what conditions they aren't.

Any pointers would be greatly appreciated.

Thank you and kind regards
Alexander

___

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: Representation of strings with special chars

2011-08-24 Thread Alexander Reichstadt
Actually it's a couple of wrapper-classes to MYSQL c-calls by Karl Kraft.

In the sqlfetch-class, eventually it arrives at

mysql_stmt_prepare(myStatement, [s UTF8String],[s length])

where s is the NSString instance containing the SELECT-statement, such as 
SELECT field=someÜberthing.

From there it goes on to

int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
   unsigned long length);


and at this point it fails.







Am 24.08.2011 um 20:15 schrieb Sean McBride:

 On Wed, 24 Aug 2011 20:07:40 +0200, Alexander Reichstadt said:
 
 Reason to ask and problem to solve is, that the values with Umlauts are
 to be passed on to an SQL backend, and in some cases the umlauts are not
 forwarded correctly. Escaped they return no answer or, even worse, cause
 an SQL error and the sql connection to break. Also escaping the umlauts
 int he sql connection does not work.
 
 I'm assuming your SQL backend does not understand NSString.  How do you 
 convert from NSString, and to what do you convert?  Which text encoding is 
 your backend expecting?
 
 --
 
 Sean McBride, B. Eng s...@rogue-research.com
 Rogue Researchwww.rogue-research.com
 Mac Software Developer  Montréal, Québec, Canada
 
 

___

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: Representation of strings with special chars

2011-08-24 Thread Alexander Reichstadt
It seems a work-around is to append a space to the select-statement, mysql does 
not care about that and it brings the umlaut-problem to cease in 
select-statements. Does this only cover some other issue that is going to 
return, or is this valid? I found a thread talking about the length with 
umlauts being not clear to answer in some cases which lead me to try this. It 
doesn't seem like a feature, but I wouldn't know what to log a bug against.

In this context I also observed some bug in Xcode. Using opt-arrow in a text to 
move through the text in Cocoa apps allows to skip an entire word, not only a 
single character. But skipping over somewordAÜsomeotherwordB will not bring the 
cursor from before the s to after the d, but instead hop from s to after A to 
after Ü to after B.


Am 24.08.2011 um 22:24 schrieb Alexander Reichstadt:

 Actually it's a couple of wrapper-classes to MYSQL c-calls by Karl Kraft.
 
 In the sqlfetch-class, eventually it arrives at
 
 mysql_stmt_prepare(myStatement, [s UTF8String],[s length])
 
 where s is the NSString instance containing the SELECT-statement, such as 
 SELECT field=someÜberthing.
 
 From there it goes on to
 
 int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
unsigned long length);
 
 
 and at this point it fails.
 
 
 
 
 
 
 
 Am 24.08.2011 um 20:15 schrieb Sean McBride:
 
 On Wed, 24 Aug 2011 20:07:40 +0200, Alexander Reichstadt said:
 
 Reason to ask and problem to solve is, that the values with Umlauts are
 to be passed on to an SQL backend, and in some cases the umlauts are not
 forwarded correctly. Escaped they return no answer or, even worse, cause
 an SQL error and the sql connection to break. Also escaping the umlauts
 int he sql connection does not work.
 
 I'm assuming your SQL backend does not understand NSString.  How do you 
 convert from NSString, and to what do you convert?  Which text encoding is 
 your backend expecting?
 
 --
 
 Sean McBride, B. Eng s...@rogue-research.com
 Rogue Researchwww.rogue-research.com
 Mac Software Developer  Montréal, Québec, Canada
 
 
 

___

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


Linebreaks ignored in custom cell

2011-07-08 Thread Alexander Reichstadt
Hi,

my cell doesn't display newline chars. It returns YES in the wraps-override. I 
tried all newline chars including the unicode one. Nothing shows. Please, can 
someone help?

Thanks

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{


snip




[style setAlignment:NSLeftTextAlignment];
attr = [NSDictionary 
dictionaryWithObjectsAndKeys:style,NSParagraphStyleAttributeName,topLineFont,NSFontAttributeName,topLineColor,NSForegroundColorAttributeName,nil];
[displayID drawInRect:bgRectLineAContent withAttributes:attr];

NSRect lineBodyFrame = cellFrame;
lineBodyFrame.origin.x = 0;
lineBodyFrame.size.height -= bgRectLineA.size.height;
lineBodyFrame.origin.y = cellFrame.origin.y+bgRectLineA.size.height;

NSMutableString *displayString = [NSMutableString string];
//[displayID appendString:[[self objectValue] objectForKey:@source]];
//[displayID appendString:@ ];
sortedArray = [NSArray arrayWithArray:[[self objectValue] allKeys]];
sortedArray = [sortedArray 
sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
for (NSString *thisOne in sortedArray){
if ([thisOne length]6  [[thisOne substringToIndex:6] 
isEqualToString:@qdesc_]){
if ([[[self objectValue] objectForKey:thisOne] length]0){
//  if ([displayString length]0) 
[displayID appendString:@\r];
[displayString appendString:[[self objectValue] 
objectForKey:thisOne]];
}

}
}

[style setAlignment:NSLeftTextAlignment];
attr = [NSDictionary 
dictionaryWithObjectsAndKeys:style,NSParagraphStyleAttributeName,bodyFont,NSFontAttributeName,topLineColor,NSForegroundColorAttributeName,NSLineBreakByClipping,NSParagraphStyleAttributeName,nil];
[displayString drawInRect:lineBodyFrame withAttributes:attr];
}

___

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: Linebreaks ignored in custom cell

2011-07-08 Thread Alexander Reichstadt
Never mindDoh.

Am 08.07.2011 um 15:00 schrieb Alexander Reichstadt:


___

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: Dynamically loading NIB files with a common stem

2011-07-06 Thread Alexander Reichstadt
Try:
NSArray *sometest = [[NSBundle mainBundle] pathsForResourcesOfType:@nib 
inDirectory:@.];
for (id thisOne in sometest){
NSLog(@This is a path:%@,thisOne);
}


Am 06.07.2011 um 14:04 schrieb Vincent Habchi:

 Hi there,
 
 I'm, as we say in French, tearing my hair away with this little problem: 
 Briefly, I have an object in a NIB file, and I'd like it to load further NIB 
 files (through +[NSBundle loadNibNamed:owner:] calls), all of them ending 
 with the same suffix (ex: onefoo, twofoo, threefoo).
 
 I just can't seem to find a way to enumerate all NIB files in the main 
 bundle. Has somebody a clue?
 
 Thanks a lot,
 Vincent
 
 PS : If you wonder why, let's say the main object is a NSArray, and the NIB 
 files I'd like to load contain objects that register themselves into this 
 array, so they can be retrieved and used 
 afterwards.___
 
 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/lxr%40mac.com
 
 This email sent to l...@mac.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: NSTextFieldDelegate issues

2011-06-17 Thread Alexander Reichstadt
Try controlTextDidChange

Am 17.06.2011 um 16:11 schrieb JAMES ROGERS:

 I have an app with six (6) text fields. I need to know when the text in any 
 of the text fields has changed so I can process them as a group.
 
 AppDelegate .h
 @interface WK2CFGMacAppDelegate : NSObject NSApplicationDelegate, 
 NSTextFieldDelegate {
   outlets
 }
 actions
 - (void) textDidChange:(NSNotification *)aNotification;
 
 AppDelegate.m
 
 -(void) awakeFromNib {
[textField setDelegate:self] // for all six fields
 }
 
 -(void) textDidChange:(Notification *)aNotification {
NSLog(@Text changed);
 }
 
 The textDidChange method is not being called. Any help would be appreciated.
 
 Jim
 JIM ROGERS
 jimrogers_w4...@me.com
 http://web.me.com/jimrogers_w4atk
 
 ___
 
 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/lxr%40mac.com
 
 This email sent to l...@mac.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


How to remove the NSCell border in an NSTableView that hasFocus

2011-06-16 Thread Alexander Reichstadt
Hi,

i have an NSCell subclass in an NSTableView. It's highlight color should be 
consistent regardless of the table view's focus state. It works, but I have one 
thing remaining I can't figure Out. While the table view has no focus the cells 
look fine. But when it has focus the cell gets a border of about one pixel. I 
can't find how to alter this border in color or size or make it disappear.

Docs on either NSTableColumn, NSTableView nor NSCell gave any hint on that. 
Please, can someone help?

Thanks
Alex


___

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


visibleRect returns bogus results, why?

2011-06-11 Thread Alexander Reichstadt
Hi,


I have a view with view controller. The controller receives scroll changes. 
visibleRect returns bogus, so I tracked it with NSLog and confirmed this.

I use this code:
 NSRect theRect = [[self view] visibleRect];
 NSLog(@%@,NSStringFromRect(theRect));  

When I scroll using the scrollwheel or arrows of the scrollbar, it looks good

2011-06-11 14:34:06.089 App[20913:903] {{0, 0}, {10, 344}

When I click onto the dot inside the scrollbar and drag it to another position, 
it turns to bogus:
2011-06-11 14:34:09.108 App[20913:903] {{0, 1.21354e+09}, {10, 344}}

I also tried:
 NSRect theRect = [[[self view] enclosingScrollView] documentVisibleRect];

Same result. Why



Thanks
Alex
___

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


Solved: visibleRect returns bogus results, why?

2011-06-11 Thread Alexander Reichstadt
Never mind, what works reliably is:

NSRect theRect = [[[self view] enclosingScrollView] visibleRect];


Am 11.06.2011 um 14:39 schrieb Alexander Reichstadt:

 Hi,
 
 
 I have a view with view controller. The controller receives scroll changes. 
 visibleRect returns bogus, so I tracked it with NSLog and confirmed this.
 
 I use this code:
  NSRect theRect = [[self view] visibleRect];
  NSLog(@%@,NSStringFromRect(theRect));  
 
 When I scroll using the scrollwheel or arrows of the scrollbar, it looks good
 
 2011-06-11 14:34:06.089 App[20913:903] {{0, 0}, {10, 344}
 
 When I click onto the dot inside the scrollbar and drag it to another 
 position, it turns to bogus:
 2011-06-11 14:34:09.108 App[20913:903] {{0, 1.21354e+09}, {10, 344}}
 
 I also tried:
  NSRect theRect = [[[self view] enclosingScrollView] documentVisibleRect];
 
 Same result. Why
 
 
 
 Thanks
 Alex

___

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: Solved: visibleRect returns bogus results, why?

2011-06-11 Thread Alexander Reichstadt
No, it's not solved. This works, because it always gives me the same rectangle. 
As far as I can see this call is broken. As soon as a user drags the scrollbar 
freely, the numbers go all bunkers as if the visible rectangle had an origin 
which was a hundred miles down the screen. As a result rowsInRect for tableview 
doesn't work neither and returns also useless results. Stupid. Is this normal 
and a known bug, or am I missing something?

Am 11.06.2011 um 14:49 schrieb Alexander Reichstadt:

 Never mind, what works reliably is:
 
 NSRect theRect = [[[self view] enclosingScrollView] visibleRect];
 
 
 Am 11.06.2011 um 14:39 schrieb Alexander Reichstadt:
 
 Hi,
 
 
 I have a view with view controller. The controller receives scroll changes. 
 visibleRect returns bogus, so I tracked it with NSLog and confirmed this.
 
 I use this code:
  NSRect theRect = [[self view] visibleRect];
  NSLog(@%@,NSStringFromRect(theRect));  
 
 When I scroll using the scrollwheel or arrows of the scrollbar, it looks good
 
 2011-06-11 14:34:06.089 App[20913:903] {{0, 0}, {10, 344}
 
 When I click onto the dot inside the scrollbar and drag it to another 
 position, it turns to bogus:
 2011-06-11 14:34:09.108 App[20913:903] {{0, 1.21354e+09}, {10, 344}}
 
 I also tried:
  NSRect theRect = [[[self view] enclosingScrollView] documentVisibleRect];
 
 Same result. Why
 
 
 
 Thanks
 Alex
 

___

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


Close: Solved: visibleRect returns bogus results, why?

2011-06-11 Thread Alexander Reichstadt
My bad, I made an NSInteger into an NSUInteger the wrong way hence returning an 
amount of rows for an NSTableview that was incorrect, so the tableview really 
grew to that size.

Am 11.06.2011 um 15:03 schrieb Alexander Reichstadt:

 No, it's not solved. This works, because it always gives me the same 
 rectangle. As far as I can see this call is broken. As soon as a user drags 
 the scrollbar freely, the numbers go all bunkers as if the visible rectangle 
 had an origin which was a hundred miles down the screen. As a result 
 rowsInRect for tableview doesn't work neither and returns also useless 
 results. Stupid. Is this normal and a known bug, or am I missing something?
 
 Am 11.06.2011 um 14:49 schrieb Alexander Reichstadt:
 
 Never mind, what works reliably is:
 
NSRect theRect = [[[self view] enclosingScrollView] visibleRect];
 
 
 Am 11.06.2011 um 14:39 schrieb Alexander Reichstadt:
 
 Hi,
 
 
 I have a view with view controller. The controller receives scroll changes. 
 visibleRect returns bogus, so I tracked it with NSLog and confirmed this.
 
 I use this code:
 NSRect theRect = [[self view] visibleRect];
 NSLog(@%@,NSStringFromRect(theRect));  
 
 When I scroll using the scrollwheel or arrows of the scrollbar, it looks 
 good
 
 2011-06-11 14:34:06.089 App[20913:903] {{0, 0}, {10, 344}
 
 When I click onto the dot inside the scrollbar and drag it to another 
 position, it turns to bogus:
 2011-06-11 14:34:09.108 App[20913:903] {{0, 1.21354e+09}, {10, 344}}
 
 I also tried:
 NSRect theRect = [[[self view] enclosingScrollView] documentVisibleRect];
 
 Same result. Why
 
 
 
 Thanks
 Alex
 
 
 ___
 
 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/lxr%40mac.com
 
 This email sent to l...@mac.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


Retain Count of NSConnection object

2010-01-04 Thread Alexander Reichstadt

Hi and happy new year,

I have a server and a client app using NSConnection.

All seems to work fine. The client is doing something like  
[(NSDistantObject *)aServer doThis] while the server object has a method


- (oneway void)doThis
{
NSLog(@do something);
}

After calling this method, the retain count I geton the client side  
when I call [[aServer connectionForProxy] retainCount] has increased  
by 3. Why I cannot understand at all. It doesn't do anything. Even if  
I empty the entire method doThis it increases and makes my client run  
out of memory eventually.


Is the server actually influencing the retainCount of its client's  
connectionForProxy, or is the retainCount something that every party  
has to look after on its own (which I thought would be the case)?


I can hardly expect for this to be a Cocoa-bug but imagine I am  
misunderstanding something. Can anyone help and please tell me where I  
am erring here?


Thanks a lot
Alex



smime.p7s
Description: S/MIME cryptographic signature
___

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

NSArrayController, only refreshes after mouse moves random key

2009-02-26 Thread Alexander Reichstadt

Hi,

I try to change a string from the default value to a specific value  
when a new object is inserted. I observe the NSArrayController that in  
turn is bound to a table view.


It has been impossible so far to get the value to reliably be changed  
upon insertion every time.


I am observing the contextDidChange notification but that doesn't get  
posted every time. Most times it does get posted, and sometimes it  
doesn't. When I hit the add key bound to my array controller, I see  
the entry being added, and in those cases where it doesn't get posted  
when I then move the mouse, it does get triggered too. Why doesn't it  
always get triggered?


Thanks
Alex




smime.p7s
Description: S/MIME cryptographic signature
___

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: NSArrayController, only refreshes after mouse moves random key

2009-02-26 Thread Alexander Reichstadt


On 26.02.2009, at 12:30, Alexander Reichstadt wrote:


Hi,

I try to change a string from the default value to a specific value  
when a new object is inserted. I observe the NSArrayController that  
in turn is bound to a table view.
Correction, I observe the managedObjectContext with  
NSManagedObjectContextObjectsDidChangeNotification





It has been impossible so far to get the value to reliably be  
changed upon insertion every time.


I am observing the contextDidChange notification but that doesn't  
get posted every time. Most times it does get posted, and sometimes  
it doesn't. When I hit the add key bound to my array controller, I  
see the entry being added, and in those cases where it doesn't get  
posted when I then move the mouse, it does get triggered too. Why  
doesn't it always get triggered?


Thanks
Alex


___

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/lxr%40mac.com

This email sent to l...@mac.com




smime.p7s
Description: S/MIME cryptographic signature
___

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

NSArrayController empty after changing entityName

2009-02-19 Thread Alexander Reichstadt

Hi,

I want to dynamically change the entity an arraycontroller is using  
depending on a selection in the UI.


When I do I either end up with undefinedkeys because the remaining  
items from previous entity hang around, or if I explicitly say  
setContent:nil it only works once, after that it stays empty and  
doesn't fetch new items from the currently selected entity then.


		NSString *zEntityname = [[[entitiesController selectedObjects]  
objectAtIndex:0] valueForKey:@name];
		NSEntityDescription *zEntity = [[[self managedObjectModel]  
entitiesByName] objectForKey:zEntityname];

[databaseController setContent:nil];
[databaseController setEntityName:zEntityname];

id thisOne;
int i;
for (i=[[dataTable tableColumns] count];i0;i--){
			[dataTable removeTableColumn:[[dataTable tableColumns]  
objectAtIndex:0]];

}

for (thisOne in [[zEntity attributesByName] allKeys]){
			NSTableColumn *newColumn = [[NSTableColumn alloc]  
initWithIdentifier:thisOne];

[[newColumn headerCell] setStringValue:thisOne];
[newColumn bind:@value
   toObject:databaseController
withKeyPath:[NSString stringWithFormat:@arrangedObjects. 
%@,thisOne]

options:nil];
[dataTable addTableColumn:newColumn];
[newColumn release];

}
What do I have to do so this works?

Thanks
Alex

smime.p7s
Description: S/MIME cryptographic signature
___

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: runModalForWindow, best solution to modal session

2009-01-21 Thread Alexander Reichstadt

Hi Ken,

On 17.01.2009, at 17:51, Ken Thomases wrote:


On Jan 16, 2009, at 2:06 AM, Alexander Reichstadt wrote:


@implementation KSingleItemSelectorController

#pragma mark -
#pragma mark Init+Dealloc
+ (id)selectItemUsingFenstertyp:(NSString *)aFenstertyp  
withComposition:(NSString *)aKomposition

{
	KSingleItemSelectorController *newXelector = [[self alloc]  
initWithWindow:nil];


Why are you initializing your window controller with a window, and a  
nil window at that, rather than with a nib name?  If you want the  
window controller to load the window to be controlled from a nib,  
tell it to do that directly.
That's the problem, see beginning of this thread. The initial problem  
was that regardless of what initializer I used, none would give me a  
window. I thought that if in the end all initializers of  
NSWindowController do call initWithWindow I try that. Someone else off- 
list was certain that init would only give me an object and not take  
care of all else that should be taken care of when initializing a  
window controller.



[...]
}

- (id)initWithWindow:(NSWindow *)aWindow
{
if ((self = [super initWithWindow:aWindow])){
[NSBundle loadNibNamed:[self windowNibName] owner:self];
return self;
}
return nil;
}


You don't need to override the initWithWindow: method.  The usual  
pattern with window controller subclasses is to either: 1) don't  
override any of the initializers (at least not for the purpose of  
nib loading) and instead have the code with allocates and  
initializes the object invoke -initWithWindowNibName:, or 2)  
override plain old -init and have the subclass hard-code the name of  
the nib it manages when it invokes [super  
initWithWindowNibName:YourNibName].


Regards,
Ken


I think I go with the second option.

Thanks
Alex

smime.p7s
Description: S/MIME cryptographic signature
___

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

modifier-flags with no key pressed and mouseDown 256, why?

2009-01-16 Thread Alexander Reichstadt

Hi,

I have a phenomenon I am exploiting but unless I know for sure why it  
works must stop to use. The objective is to make sure that while the  
mousebuttons is being pressed no other modifier key is pressed, if  
anything is pressed the whole method return. Testing for 256 seems to  
work, why?


NSUInteger  modifierFlags = [currentEvent modifierFlags];
if (modifierFlags!=256) return;

Is there some documentation that supports this test, or do I have to  
check for all the different keys not to be pressed instead?


Thanks
Alex

smime.p7s
Description: S/MIME cryptographic signature
___

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: modifier-flags with no key pressed and mouseDown 256, why?

2009-01-16 Thread Alexander Reichstadt
Thanks Dave, if someone still has a reference or headerfile or can  
point me to something from which I can logically deduce that this will  
hold true, it would help a lot.


On 16.01.2009, at 22:15, Dave DeLong wrote:

My understanding is that the modifierFlag 256 means that no other  
modifiers are pressed.  I haven't found it in the docs anywhere, but  
I believe that you can count on 256 meaning no flags.  Every  
machine I've tested this on (I've done a bunch of CGEvent stuff  
recently) seems to agree.


Dave

On Jan 16, 2009, at 2:08 PM, Alexander Reichstadt wrote:


Hi,

I have a phenomenon I am exploiting but unless I know for sure why  
it works must stop to use. The objective is to make sure that while  
the mousebuttons is being pressed no other modifier key is pressed,  
if anything is pressed the whole method return. Testing for 256  
seems to work, why?


NSUInteger  modifierFlags = [currentEvent modifierFlags];
if (modifierFlags!=256) return;

Is there some documentation that supports this test, or do I have  
to check for all the different keys not to be pressed instead?


Thanks
Alex

___

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/lxr%40mac.com

This email sent to l...@mac.com




smime.p7s
Description: S/MIME cryptographic signature
___

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: modifier-flags with no key pressed and mouseDown 256, why?

2009-01-16 Thread Alexander Reichstadt

Thanks for all the input, makes sense.

Alex

On 16.01.2009, at 23:29, Shawn Erickson wrote:

On Fri, Jan 16, 2009 at 1:15 PM, Dave DeLong davedel...@me.com  
wrote:

My understanding is that the modifierFlag 256 means that no other
modifiers are pressed.  I haven't found it in the docs anywhere,  
but I
believe that you can count on 256 meaning no flags.  Every  
machine I've
tested this on (I've done a bunch of CGEvent stuff recently) seems  
to agree.


Unsafe assumption. You are just lucky that some lower bit (device
dependent bit) is being set for you. I know of no documentation that
says this bit will always set. Additionally if some other device
dependent bit is set your assumption would be broken.

-Shawn
___

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/lxr%40mac.com

This email sent to l...@mac.com




smime.p7s
Description: S/MIME cryptographic signature
___

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

runModalForWindow, best solution to modal session

2009-01-13 Thread Alexander Reichstadt

Hi,

in my app I call runModalForWindow: in a class method initializer -- 
the class is a NSWindowController subclass-- from a controller of a  
sheet. Please, disregard UI Guidelines, it's a highly customized app  
and this approach used as per specific request.


+ (id)selectItem
{
	KSingleItemSelectorController *newSelector =  
[[KSingleItemSelectorController alloc]  
initWithWindowNibName:@SingleItemSelector];

(void)[newSelector window];
NSLog(@The window is nil, see: %@,[newSelector window]);

[NSApp runModalForWindow:[newSelector window]];
id keepThis = newSelector.returnValue;
[newSelector release];
return keepThis;
}

As a result I am getting the following message:

2009-01-13 14:10:49.424 Secret[76477:10b] loading
2009-01-13 14:10:49.425 Secret[76477:10b] The window is nil, see: (null)
2009-01-13 14:10:49.438 Secret[76477:10b] *** Assertion failure in - 
[KApplication  
_commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo 
:], /SourceCache/AppKit/AppKit-949.35/AppKit.subproj/NSApplication.m: 
3031
2009-01-13 14:10:49.439 Secret[76477:10b] Modal session requires modal  
window


I read up on the different threads across the forums on this message  
to no avail, so I tried something different because I found no way so  
that my subclass would actually ever get its window, regardless how I  
initialized it.


In turn now, when I do the following everything works:

+ (id)selectItem
{
	KSingleItemSelectorController *newSelector =  
[[KSingleItemSelectorController alloc]  
initWithWindowNibName:@SingleItemSelector];
	NSWindowController *ersatz = [[NSWindowController alloc]  
initWithWindowNibName:@SingleItemSelector];

[ersatz loadWindow];

[newSelector setWindow:[ersatz window]];
[ersatz release];

[NSApp runModalForWindow:[newSelector window]];

id keepThis = newSelector.returnValue;
[newSelector release];  

return keepThis;
}


This second option is unacceptable but just for experimenting to  
understand where the source of the problem is. It suggests to me that  
there is no reason for the first approach not to work, given I  
excluded all other possible faults, like wrong subclass, no delegate  
or subclass assignment of File's owner and so forth.


Finally I found a third way:

+ (id)selectItem
{
	KSingleItemSelectorController *newSelector = [[self alloc]  
initWithWindowNibName:@SingleItemSelector];

[NSBundle loadNibNamed:[newSelector windowNibName] owner:newSelector];  
[NSApp runModalForWindow:[newSelector window]];

id keepThis = newSelector.returnValue;
[newSelector release];  

return keepThis;
}

This works, too. The question is why the initial way doesn't work and  
the second one does, where either both or none of both should work. I  
read through the documentation on Resource Programming Guide, but in  
the end found so many answers,I wonder which of all three is the  
correct one, or is there a fourth and they are all wrong?


Alex

smime.p7s
Description: S/MIME cryptographic signature
___

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: runModalForWindow, best solution to modal session

2009-01-13 Thread Alexander Reichstadt

Hi Keary,

On 13.01.2009, at 19:44, Keary Suska wrote:



On Jan 13, 2009, at 10:44 AM, Alexander Reichstadt wrote:


Hi,

in my app I call runModalForWindow: in a class method initializer -- 
the class is a NSWindowController subclass-- from a controller of a  
sheet. Please, disregard UI Guidelines, it's a highly customized  
app and this approach used as per specific request.


+ (id)selectItem
{
	KSingleItemSelectorController *newSelector =  
[[KSingleItemSelectorController alloc]  
initWithWindowNibName:@SingleItemSelector];

(void)[newSelector window];
NSLog(@The window is nil, see: %@,[newSelector window]);

[NSApp runModalForWindow:[newSelector window]];
id keepThis = newSelector.returnValue;
[newSelector release];
return keepThis;
}
snipped


Is the class of the File's Owner of the nib set to  
KSingleItemSelectorController


Yes.


and its window outlet set?


Yes

If so, do you override -initWithWindowNibName:? The implementation  
may matter.


No, I only override initWithWindow. Should I override it, and if so  
should I call on NSBundle to load my nib there then?


Alex

smime.p7s
Description: S/MIME cryptographic signature
___

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: AddressBook Framework, adding multiple records

2008-12-12 Thread Alexander Reichstadt

Hi again,

did nobody encounter this issue so far?

 There's already an instance of AddressBookSync running.

I thought it would be related to making too many calls on  
sharedAddressBook, but it makes no difference whether I use the  
sharedAddressBook or addressBook, the message is logged as soon as I  
iterate through a bunch of ABRecords and make changes to them. In the  
docu it says notifications require for sharedAddressBook to be called  
once, which I do, the rest uses addressBook.


Any pointers would be helpful.

Regards
Alexander


Am 11.12.2008 um 09:17 schrieb Alexander Reichstadt:


Hi,

using the AddressBook framework to add new records causes a console  
log saying that there is already one instance running of  
AddressBookSync. The entries I am adding do get added though and  
they look ok. Is there some way to avoid this or is this a bug? This  
is on 10.5.x


Thank you.

Alexander

___

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/lxr%40mac.com

This email sent to l...@mac.com




smime.p7s
Description: S/MIME cryptographic signature
___

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

AddressBook Framework, adding multiple records

2008-12-11 Thread Alexander Reichstadt

Hi,

using the AddressBook framework to add new records causes a console  
log saying that there is already one instance running of  
AddressBookSync. The entries I am adding do get added though and they  
look ok. Is there some way to avoid this or is this a bug? This is on  
10.5.x


Thank you.

Alexander



smime.p7s
Description: S/MIME cryptographic signature
___

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 [EMAIL PROTECTED]

NSTableView text color of cells in highlighted rows unreadable

2008-11-11 Thread Alexander Reichstadt

Hi,

I am trying to turn off the highlight color. I subclassed NSTableView  
and NSTextAttachmentCell. In my tv-subclass I override - 
(void)highlightSelectionInClipRect:(NSRect)theClipRect and use  
clearColor to draw the selected rows which works. But I haven't found  
the way to draw the text in black regardless of the row's hightlight- 
state, so it continues to write the cell content in white on a white  
background whenever it's highlighted.


Can someone please point me into the right direction?

Thanks
Alexander

smime.p7s
Description: S/MIME cryptographic signature
___

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 [EMAIL PROTECTED]

Re: Cannot change menu state in NSSearchField menu for more than once

2008-11-02 Thread Alexander Reichstadt
I found something really odd just now. The searchmenu is actually  
connected to an IBAction method. The NSLog sits in there and simply  
prints out the sender, i.e. the menuItem that triggered it.


If I change the menu item in the UI the NSLog printout shows that it's  
another part of memory that triggered it as if I trigger the  
searchaction through my code, so the objects are not identical. It's  
not that I instantiate more than one menu, so it's not clear to me  
where the other menu-twin with the same menuItems comes from. When I  
try to retrieve the menu through the NSSearchFields cell-menu, it's  
empty. This makes me wonder where the menu is actually stored and how  
many instances for whatever purposes are kept alive under the hood. I  
definitely only know of one NSMenu instance referenced through one  
IBOutlet which should be the one attached to the NSSearchField, but  
somehow I end up with two at runtime.


Any pointers would be of much help.

Thanks

On 03.11.2008, at 08:31, Alexander Reichstadt wrote:


Hi,

when trrying to change the tickmark next to a menu of an  
NSSearchField it works exactly once, after that it doesn't work any  
more. I have to relaunch the app. I see that my code is indeed  
executed, but it makes no difference after the first time. Or maybe  
it's not refreshed somehow.


[[[mySearchMenu itemArray] objectAtIndex:1] setState:NSOnState];
[[[mySearchMenu itemArray] objectAtIndex:0] setState:NSOffState];


Is there some fault with my code?

Thanks
Alexander




smime.p7s
Description: S/MIME cryptographic signature
___

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 [EMAIL PROTECTED]

Re: launchd daemon Throttling respawn log messages

2008-06-12 Thread Alexander Reichstadt
Thank you, the process needs to be running permanently, the script was  
just for testing. It works on both, 10.4 and 10.5 without throttling  
now. I had used Lingon but that doesn't create the plist the way it  
needed to be.


Alexander



On Jun 11, 2008, at 16:58 , Jens Alfke wrote:



On 11 Jun '08, at 12:05 AM, Alexander Reichstadt wrote:

launchd gives me a hard time with a daemon I need to keep running.  
It prints Throttling respawn to my console forever. Because of  
that I wrote a script that does nothing but print test and sleep  
before exiting to somehow understand why launchd does that.


It looks like launchctl submit expects that the task will never  
quit; the man page says
 A simple way of submitting a program to run without a  
configuration file.
 This mechanism also tells launchd to keep the program  
alive in the event

 of failure.
So if your program exits it will relaunch it; and if that happens  
too often, it'll start to throttle the rate at which it does that  
and print those warnings.


If you want to use a program that runs and quits, and presumably  
schedule it to run at certain times, you'll need to create a  
property list that defines its behavior (see man 5 launch.plist).


—Jens




smime.p7s
Description: S/MIME cryptographic signature
___

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 [EMAIL PROTECTED]

App fails to kill NSTask processes

2008-04-15 Thread Alexander Reichstadt

Hi,

my app makes heavy use of NSTask. The tool it nstasks oftentimes falls  
asleep and doesn't return, I can't fix it cause I don't have the  
source code.
Til Tiger I worked around this behavior by making a custom class that  
contains an NSTask and a thread, run the task, and let the thread  
sleepUntilDate for a few seconds, then have the thread check on the  
task and if it is dead kill it. That worked fine. But ever since  
Leopard that doesn't work any more, neither main thread nor any other  
thread can terminate the task or sigkill it, it continues hanging  
around in the system. Only when I quit the app, it being the ppid of  
all the dead processes, does it take the dead processes with it. How  
can I kill those processes in Leopard?


Regards
Alexander Reichstadt
[EMAIL PROTECTED]





smime.p7s
Description: S/MIME cryptographic signature
___

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 [EMAIL PROTECTED]

Re: App fails to kill NSTask processes

2008-04-15 Thread Alexander Reichstadt
Thanks, had found wait(0) to work along with changing from thread to  
timer in some cases. The zombies are gone now.

On Apr 15, 2008, at 5:23 PM, Scott Ribe wrote:


Whether I waitUntilExit or not makes no
difference


Try waitpid after killing the process.

--
Scott Ribe
[EMAIL PROTECTED]
http://www.killerbytes.com/
(303) 722-0567 voice






smime.p7s
Description: S/MIME cryptographic signature
___

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 [EMAIL PROTECTED]