Re: Method Sequence on Application Loads

2009-03-09 Thread Andreas Mayer


Am 09.03.2009 um 06:49 Uhr schrieb Kenneth Ramey:


What method do I need to hook for this?


You typically start processing in your application delegate's - 
applicationDidFinishLaunching: method.



Andreas
___

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


Properly symbol fonts handling in Cocoa

2009-03-09 Thread Rimas
Hello list,

Last few days I was trying to understand how symbol fonts (wingdings,
webdings X, etc) should be properly handled with cocoa text system. As
a good example could be Adobe Photoshop and Apple Pages. Both behaves
in the same way and I want to achieve the same result.
For example if I choose Wingdings font and type "PO", I see two flag
symbols. If I change font to any other (Arial, Times, Helvetica etc.)
I see characters I have entered by keyboard layout (PO). Also, If I
copy text while Wingdings font is selected, and paste it to another
app, I am getting "PO".
Searching through the list gave me few ideas. But none of them I found
very useful. One of them is to map characters to different codes (by
adding 0x00F000). This works, but I doubt this is correct way, because
that brakes copy/paste mechanism and when converting back to
Arial/Times.. symbols needs to be remapped again. Unless this could be
done in auto way. I think only glyphs should be used from font and
mapping should be done by text system. The problem is - I have no idea
how to do that.

Any help is appreciate.

P.S. default behavior is like TextEdit: say we have "PO" and after
choosing Wingdings font is changed to default Lucida Grande.

Best Regards,

Rimas M.
___

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: Method Sequence on Application Loads

2009-03-09 Thread Mike Abdullah


On 9 Mar 2009, at 05:49, Kenneth Ramey wrote:

I am looking for information on the sequence of method invocation as  
an application loads.  For instance, Apple's documentation says that  
awakeFrom Nib is called after the user interface loads but before  
any events have been handled.  I want to create an application that  
begins reading real-time data as soon as possible, without user  
intervention.  Once it gets started, users will be able to interact  
and modify behavior, but the basic functions should begin  
automatically as soon as feasible.


What method do I need to hook for this?


This article may be of some interest:
http://cocoawithlove.com/2008/03/cocoa-application-startup.html

Mike.

___

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


subLayers - GPU - optimizing

2009-03-09 Thread rajesh

Hi all,

sorry for bad subject line, again :)

I have a layer backed view, I am trying to add subLayers roughly sized  
around 300 X 270 (in pixels ) to it,
its that the, sublayers count may reach upto the 1000 to 2000 in  
number and not to mention each of sublayer is again scalable to  
roughly 4280 X 1500 or more for starters.


So the problem is obviously that of a GPU constraint.

after adding around 100 subLayers sized 300 X 270 , there is a warning  
" image is too large for GPU, ignoring" and that messing up with my  
the layer display.
solution for such problem (from some mailing lists) was to use  
CATiledLayer , but I can't make use of the tiledLayer due to the  
complex requirement of the subLayer's display.


Is there a possibility of removingthe subLayers which don't fall under  
VisibleRect of the view ?


I tried to "removeFromSuperlayer" and then adding it whenever  
required , there's always a crash when I try to add the subLayer back.


Is there any solution for tackling the problem ?

any help is appreciated.


Thanks
Rajesh

@ViewClass
-(IBAction)addLayer:(id)sender
{
Layer *l = [[Layer alloc] init];
CALayer *layer = [l page];
[contentArray addObject:page];
[drawLayer addSublayer:layer];
[self layout];
}

-(void)layout
{
NSEnumerator *pageEnumr = [contentArray objectEnumerator];

float widthMargin = [self frame].size.width;
CGRect rect;
float zoom = [self zoomFactor];
while(obj = [contentEnmr nextObject] )
{
[obj setZoomFactor:zoom];
CALayer *pg =(CALayer *)[obj page] ;
rect = pg.bounds;

if ( x + pg.bounds.size.width   > widthMargin  )
{
x = xOffset;
y += rect.size.height + spacing ;

}
rect.origin = CGPointMake(x,y);
[pg setFrame:rect];
[obj changeBounds];

//this is where i am trying to remove and add the sublayer
//  NSRect VisibleRect = [self visibleRect];
//		NSRect result =  
NSIntersectionRect(VisibleRect,NSRectFromCGRect( rect));

//  if( NSEqualRects (result ,NSZeroRect) )
//  {
//  [pg removeFromSuperlayer];
//  }else
//  {
//  [drawLayer addSublayer:pg];
//  [pg setFrame:rect];
//  [pg setNeedsDisplay];
//  }


x += ( rect.size.width + spacing);
}

NSRect viewRect = [self frame];
if(viewRect.size.height < ( y + rect.size.height + spacing )  )
viewRect.size.height = ( y + rect.size.height + spacing) ;

[self setFrameSize: viewRect.size];

}

@interface Layer : NSObject {
CALayer *page;
}
@property (retain) CALayer *page;
___

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: Why don't only these images don't show on the device?

2009-03-09 Thread James Cicenia

Anyone?

I have cleaned build this three times but not all the images are being  
moved over?


Thank
James Cicenia


On Mar 8, 2009, at 8:43 PM, James Cicenia wrote:


OK -

It seems as though my builds aren't bringing over all my images. How  
can I force the build to include all these images?


Thanks
James


On Mar 8, 2009, at 6:55 PM, James Cicenia wrote:


Hello -

All my images show except for these:

UIImageView *imageView = [[UIImageView alloc]initWithFrame:  
CGRectMake(30+(horizontalCount*92),15+currentYOffset,30,30)];
[imageView setImage: [UIImage imageNamed:[pName  
stringByAppendingString:@".i.png"]]];

[imageView setTag:100];
[scrollView addSubview:imageView];

However they do show on the simulator. Is there something obvious I  
am missing here?


James Cicenia








___

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: Why don't only these images don't show on the device?

2009-03-09 Thread Mike Glass
Try deleting the app off the device manually (by tapping and holding  
so the icons go into "wiggle mode" and then tapping the x) and then  
doing a clean build to the device.


-Mike

On Mar 9, 2009, at 9:57 AM, James Cicenia wrote:


Anyone?

I have cleaned build this three times but not all the images are  
being moved over?


Thank
James Cicenia


On Mar 8, 2009, at 8:43 PM, James Cicenia wrote:


OK -

It seems as though my builds aren't bringing over all my images.  
How can I force the build to include all these images?


Thanks
James


On Mar 8, 2009, at 6:55 PM, James Cicenia wrote:


Hello -

All my images show except for these:

UIImageView *imageView = [[UIImageView alloc]initWithFrame:  
CGRectMake(30+(horizontalCount*92),15+currentYOffset,30,30)];
[imageView setImage: [UIImage imageNamed:[pName  
stringByAppendingString:@".i.png"]]];

[imageView setTag:100];
[scrollView addSubview:imageView];

However they do show on the simulator. Is there something obvious  
I am missing here?


James Cicenia








___

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/mikeg%40marware.com

This email sent to mi...@marware.com



Mike Glass
Developer
Marware, Inc.

mi...@marware.com
http://www.projectx.com
http://www.marware.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: Why don't only these images don't show on the device?

2009-03-09 Thread Paul Sanders
> I have cleaned build this three times but not all the images are being  
> moved over?


Try this:
  - right click on the errant files in XCode
  - select 'targets'
  - ensure that the checkbox is ticked

No idea if this will work - I'm new to all this.

Rgds - Paul.
___

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: subLayers - GPU - optimizing

2009-03-09 Thread Matt Long
A crash when trying to add your layer again after a call to  
removeFromSuperlayer suggests that you're not retaining the layer and  
it's been autoreleased. You either need to re-allocate each time or  
retain it yourself. How are you allocating your CALayer inside of your  
Layer object?


-Matt



On Mar 9, 2009, at 7:43 AM, rajesh wrote:


Hi all,

sorry for bad subject line, again :)

I have a layer backed view, I am trying to add subLayers roughly  
sized around 300 X 270 (in pixels ) to it,
its that the, sublayers count may reach upto the 1000 to 2000 in  
number and not to mention each of sublayer is again scalable to  
roughly 4280 X 1500 or more for starters.


So the problem is obviously that of a GPU constraint.

after adding around 100 subLayers sized 300 X 270 , there is a  
warning " image is too large for GPU, ignoring" and that messing up  
with my the layer display.
solution for such problem (from some mailing lists) was to use  
CATiledLayer , but I can't make use of the tiledLayer due to the  
complex requirement of the subLayer's display.


Is there a possibility of removingthe subLayers which don't fall  
under VisibleRect of the view ?


I tried to "removeFromSuperlayer" and then adding it whenever  
required , there's always a crash when I try to add the subLayer back.


Is there any solution for tackling the problem ?

any help is appreciated.


Thanks
Rajesh

@ViewClass
-(IBAction)addLayer:(id)sender
{
Layer *l = [[Layer alloc] init];
CALayer *layer = [l page];
[contentArray addObject:page];
[drawLayer addSublayer:layer];
[self layout];
}

-(void)layout
{
NSEnumerator *pageEnumr = [contentArray objectEnumerator];

float widthMargin = [self frame].size.width;
CGRect rect;
float zoom = [self zoomFactor];
while(obj = [contentEnmr nextObject] )
{
[obj setZoomFactor:zoom];
CALayer *pg =(CALayer *)[obj page] ;
rect = pg.bounds;

if ( x + pg.bounds.size.width   > widthMargin  )
{
x = xOffset;
y += rect.size.height + spacing ;

}
rect.origin = CGPointMake(x,y);
[pg setFrame:rect];
[obj changeBounds];

//this is where i am trying to remove and add the sublayer
//  NSRect VisibleRect = [self visibleRect];
//		NSRect result =  
NSIntersectionRect(VisibleRect,NSRectFromCGRect( rect));

//  if( NSEqualRects (result ,NSZeroRect) )
//  {
//  [pg removeFromSuperlayer];
//  }else
//  {
//  [drawLayer addSublayer:pg];
//  [pg setFrame:rect];
//  [pg setNeedsDisplay];
//  }


x += ( rect.size.width + spacing);
}

NSRect viewRect = [self frame];
if(viewRect.size.height < ( y + rect.size.height + spacing )  )
viewRect.size.height = ( y + rect.size.height + spacing) ;

[self setFrameSize: viewRect.size];

}

@interface Layer : NSObject {
CALayer *page;
}
@property (retain) CALayer *page;


___

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: subLayers - GPU - optimizing

2009-03-09 Thread rajesh

Thanks Matt ,
I overlooked it completely .
simply changing
[CALayer layer]; to [[CALayer alloc] init]; solved the problem

after successfully making the changes I still see the problem exists.
CALayers are removed if they are no longer needed , but after adding  
around 120 layers (I could see just 12 as the sublayers count in  
total , accounting from Visible Rect) I see there's a GPU warning  
again :(


what could be the problem ? Caching ?

Thanks
Rajesh

On Mar 9, 2009, at 3:24 PM, Matt Long wrote:

A crash when trying to add your layer again after a call to  
removeFromSuperlayer suggests that you're not retaining the layer  
and it's been autoreleased. You either need to re-allocate each time  
or retain it yourself. How are you allocating your CALayer inside of  
your Layer object?


-Matt



On Mar 9, 2009, at 7:43 AM, rajesh wrote:


Hi all,

sorry for bad subject line, again :)

I have a layer backed view, I am trying to add subLayers roughly  
sized around 300 X 270 (in pixels ) to it,
its that the, sublayers count may reach upto the 1000 to 2000 in  
number and not to mention each of sublayer is again scalable to  
roughly 4280 X 1500 or more for starters.


So the problem is obviously that of a GPU constraint.

after adding around 100 subLayers sized 300 X 270 , there is a  
warning " image is too large for GPU, ignoring" and that messing up  
with my the layer display.
solution for such problem (from some mailing lists) was to use  
CATiledLayer , but I can't make use of the tiledLayer due to the  
complex requirement of the subLayer's display.


Is there a possibility of removingthe subLayers which don't fall  
under VisibleRect of the view ?


I tried to "removeFromSuperlayer" and then adding it whenever  
required , there's always a crash when I try to add the subLayer  
back.


Is there any solution for tackling the problem ?

any help is appreciated.


Thanks
Rajesh

@ViewClass
-(IBAction)addLayer:(id)sender
{
Layer *l = [[Layer alloc] init];
CALayer *layer = [l page];
[contentArray addObject:page];
[drawLayer addSublayer:layer];
[self layout];
}

-(void)layout
{
NSEnumerator *pageEnumr = [contentArray objectEnumerator];

float widthMargin = [self frame].size.width;
CGRect rect;
float zoom = [self zoomFactor];
while(obj = [contentEnmr nextObject] )
{
[obj setZoomFactor:zoom];
CALayer *pg =(CALayer *)[obj page] ;
rect = pg.bounds;

if ( x + pg.bounds.size.width   > widthMargin  )
{
x = xOffset;
y += rect.size.height + spacing ;

}
rect.origin = CGPointMake(x,y);
[pg setFrame:rect];
[obj changeBounds];

//this is where i am trying to remove and add the sublayer
//  NSRect VisibleRect = [self visibleRect];
//		NSRect result =  
NSIntersectionRect(VisibleRect,NSRectFromCGRect( rect));

//  if( NSEqualRects (result ,NSZeroRect) )
//  {
//  [pg removeFromSuperlayer];
//  }else
//  {
//  [drawLayer addSublayer:pg];
//  [pg setFrame:rect];
//  [pg setNeedsDisplay];
//  }


x += ( rect.size.width + spacing);
}

NSRect viewRect = [self frame];
if(viewRect.size.height < ( y + rect.size.height + spacing )  )
viewRect.size.height = ( y + rect.size.height + spacing) ;

[self setFrameSize: viewRect.size];

}

@interface Layer : NSObject {
CALayer *page;
}
@property (retain) CALayer *page;




___

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 do I debug iPhone restarts?

2009-03-09 Thread James Cicenia

Hello -

While testing on my phone, the iPhone just quits my app and doesn't  
write a crash log or such.


How does one debug this?

Thanks
James Cicenia

___

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 do I debug iPhone restarts?

2009-03-09 Thread Ricky Sharp
You should send such questions to the dedicated iPhone portal  
discussion forums.


In fact, many of your questions should have gone there instead of this  
list as they were not general Cocoa.


Sent from my iPhone

On Mar 9, 2009, at 10:41 AM, James Cicenia  wrote:


Hello -

While testing on my phone, the iPhone just quits my app and doesn't  
write a crash log or such.


How does one debug this?

Thanks
James Cicenia

___

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

This email sent to rsh...@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: How do I debug iPhone restarts?

2009-03-09 Thread Roland King
not sure I agree totally there. This particular question perhaps might  
get a better answer on the iPhone portal forums but many of the iPhone  
questions posted here are as relevant to general Cocoa as the  
objective-C memory management, XCode building and other related  
questions which are asked and answered here daily. Apple's done an  
amazing job of porting to the iPhone and there are more similarities  
than differences between OSX Cocoa and iPhone Cocoa/Cocoa Touch and  
some of the APIs from Touch seem to be heading back to mainstream.


I started with an intention to write for iPhone but what I've learned  
here has taught me a lot about 'thinking Cocoa' and now I write  
libraries using common classes and test them on OSX (because it's  
easier) and leave the iPhone/OSX stuff for the presentation layer for  
whichever platform I'm targeting, which is where most of the  
differences lie.


There are definitely questions (like this one) which will get a better  
answer on an iPhone-specific forum, just like questions about build  
settings should probably go to an XCode list, but I think this list is  
a great place for anyone using any flavour of Cocoa to learn the  
common design principles which make up the platform.





On Mar 9, 2009, at 11:50 PM, Ricky Sharp wrote:

You should send such questions to the dedicated iPhone portal  
discussion forums.


In fact, many of your questions should have gone there instead of  
this list as they were not general Cocoa.


Sent from my iPhone

On Mar 9, 2009, at 10:41 AM, James Cicenia  wrote:


Hello -

While testing on my phone, the iPhone just quits my app and doesn't  
write a crash log or such.


How does one debug this?

Thanks
James Cicenia

___

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

This email sent to rsh...@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/rols%40rols.org

This email sent to r...@rols.org


___

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 intercept NSToolbar item selection changes

2009-03-09 Thread Stuart Malin


On Mar 9, 2009, at 3:46 AM, cocoa-dev-requ...@lists.apple.com wrote:

On Sun, Mar 8, 2009 at 6:03 PM, Stuart Malin   
wrote:
I'm building a Preferences window that has a toolbar, in the style  
of Mail.
I need to know if the user clicks on a toolbar item to change the  
pane. If
the current pane has pending changes, I display a sheet asking for  
action
regarding the present changes. I need to do this BEFORE the  
selected toolbar

item is changed. Which means I need to intercept that change. Alas, I
haven't been able to zero in on how to do that. I don't see NSToolBar
delegate methods that provide such intercept (e.g.
-(BOOL)shouldChangeToolbarItem or something of the like), nor  
do I see
anything useful that I could override if I subclass the Toolbar  
instance.
So, I must be overlooking something. If anyone can tell me what,  
I'd be

eternally grateful :-) Â TIA.


Could you simply reset the toolbar selection to whatever it was
before, then display your sheet and then manually set the selection to
the new one if the user agrees?


I could do that, but then the user would see the selected toolbar item  
change away, then back. Mail's preference doesn't behave that way, so  
I am presuming there must be some way to intercept the change and stop  
it, if appropriate.  Perhaps the way do handle this is to prevent  
redisplay of the window... I'll have to explore this...


___

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 intercept NSToolbar item selection changes

2009-03-09 Thread Michael Ash
On Mon, Mar 9, 2009 at 12:38 PM, Stuart Malin  wrote:
>
> On Mar 9, 2009, at 3:46 AM, cocoa-dev-requ...@lists.apple.com wrote:
>
>> Could you simply reset the toolbar selection to whatever it was
>> before, then display your sheet and then manually set the selection to
>> the new one if the user agrees?
>
> I could do that, but then the user would see the selected toolbar item
> change away, then back. Mail's preference doesn't behave that way, so I am
> presuming there must be some way to intercept the change and stop it, if
> appropriate.  Perhaps the way do handle this is to prevent redisplay of the
> window... I'll have to explore this...

No need to "prevent" redisplay. Redisplay due to changes usually
happens at the end of the event loop cycle where the changes took
place. If you reset the selection before that happens (e.g. if the
toolbar item's action fires before the redisplay) then the user will
not see the intermediate state.

For example, consider this loop:

for(i = 0; i < 100; i++) [textField setIntValue:i];

The user will just see the text field display 99, and won't see it
counting up. The same *should* apply to your toolbar.

Mike
___

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

2009-03-09 Thread Shawn Erickson
On Sat, Mar 7, 2009 at 9:37 PM, Jonathan Hess  wrote:
> When using a 64-bit architecture, Mac OS X uses 32 bit integers, but 64 bit
> longs. NSInteger is defined as a long for 64, not an integer.
>
> When running 64-bit, you need to use %ld as the format option.

( bit width with 32b arch / bit width with 64b arch )

%lld <==> long long <==> 64b / 64b
%ld <==> long <==> 32b / 64b  (aligns with how NSInteger changes size)
%d <==> int <==> 32b / 32b
%p <==> void* <==> 32b / 64b
etc.
___

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


MVC, storing VIEW-specific information and core data

2009-03-09 Thread Karolis Ramanauskas
Good Day,

I'm in a MVC-induced contradiction here. I've read the archives and found
good answers to many of my questions, however it seems one thing kind of
escaped from being answered. I have Core Data Document Based app. Core Data
model contains entities that describe graph objects (nodes). Of course each
node knows any number of nodes that it has connections to. That's all well
and dandy. I save the model, I open the model, beautiful. Now I want to
write a View that would draw these objects. Of course I should be able to
drag them around the screen all that stuff. But this is purely user
interface stuff I don't want the model to change because I drag stuff
around. What is the best way to store the coordinates, colors, all that UI
stuff using core data? I really don't want to put extra entities within my
.xcdatamodel file that deal purely with UI stuff. While I do realize that I
will have to get this data into the Managed Context somehow in order for it
to be stored automatically with the document, I want to be able to make my
model completely and utterly UI independent.

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

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


Re: MVC, storing VIEW-specific information and core data

2009-03-09 Thread Sean McBride
On 3/9/09 12:49 PM, Karolis Ramanauskas said:

>What is the best way to store the coordinates, colors, all that UI
>stuff using core data?

You could use the various setMetadata: methods of NSPersistentStore and
NSPersistentStoreCoordinator.

--

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


iPhone book recommendations

2009-03-09 Thread Donald Hall
I'm not sure if this is the most appropriate list for this question, 
but here goes:


Can anyone recommend a good book to get started on iPhone 
programming? I've been using Cocoa for several years now, so I don't 
need a really basic starter book. I've looked at several books at 
amazon.com. Has anyone tried the new one by Maher Ali? Too new for 
any customer reviews yet, but it looks like it might be the right 
level for me.


TIA,

Don
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
d...@appsandmore.com
http://www.appsandmore.com
___

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

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

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

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


Re: MVC, storing VIEW-specific information and core data

2009-03-09 Thread Benjamin Stiglitz
> While I do realize that I will have to get this data into the Managed
> Context somehow in order for it to be stored automatically with the
> document, I want to be able to make my model completely and utterly UI
> independent.

You could have a NodeViewState, joined to the Node by a relationship,
for each node to store the view-only parameters.

-Ben
___

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: iPhone book recommendations

2009-03-09 Thread I. Savant
On Mon, Mar 9, 2009 at 2:45 AM, Donald Hall  wrote:

> Can anyone recommend a good book to get started on iPhone programming?
...
> I've looked at several books at amazon.com.

  Don't forget The Pragmatic Programmers (if you don't mind e-books):

http://www.pragprog.com/titles/amiphd/iphone-sdk-development

  I've been more or less pleased with their books*, even following
through beta status. They get fleshed out in reasonable time and I
like the fact that errata are updated (and downloadable) much like
we've come to expect from our software.

--
I.S.

* Not affiliated with The Pragmatic Programmers
___

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: MVC, storing VIEW-specific information and core data

2009-03-09 Thread I. Savant
On Mon, Mar 9, 2009 at 1:49 PM, Karolis Ramanauskas  wrote:

> I have Core Data Document Based app. Core Data
> model contains entities that describe graph objects (nodes).
...
> Of course I should be able to
> drag them around the screen all that stuff. But this is purely user
> interface stuff I don't want the model to change because I drag stuff
> around. What is the best way to store the coordinates, colors, all that UI
> stuff using core data? I really don't want to put extra entities within my
> .xcdatamodel file that deal purely with UI stuff.

  It's not entirely clear whether you mean to say that the
coordinates, colors, etc. are ever persisted at all.

IF PERSISTED

  What's your aversion to storing this within the nodes themselves? If
they're meant to be persisted at all, and these properties belong to
your Node instances, then there's no obvious reason (from your
description) to create a separate entity to store them. What's the
problem? Be specific.


IF NOT PERSISTED

  Your Node entity, by default, uses the NSManagedObject class. This
can be subclassed. Just because your NSManagedObject subclass provides
the ability to managed / persist data with Core Data doesn't mean all
its properties have to be persisted. This is well-covered in the
documentation. Questions? Again be specific. :-)

--
I.S.
___

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: MVC, storing VIEW-specific information and core data

2009-03-09 Thread Karolis Ramanauskas
Thanks Sean, Benjamin and I. Savant for your responses so far,

>You could use the various setMetadata: methods of NSPersistentStore
and NSPersistentStoreCoordinator.
I thought metadata was meant to make stores searchable with spotlight? Is
this the correct usage? I claim ignorance here :)

>You could have a NodeViewState, joined to the Node by a relationship, for
each node to store the view-only parameters.

This is true, but then I have to include extra entities within the data
model that have nothing to do with the graph itself but only with the View.

>IF PERSISTED

Yes, I'd like to save this document with a specific layout and open it.

>What's your aversion to storing this within the nodes themselves? If
>they're meant to be persisted at all, and these properties belong to
>your Node instances, then there's no obvious reason (from your
>description) to create a separate entity to store them. What's the
>problem? Be specific.
Well, perhaps I didn't explain it well enough. Let's say, in the future I
want to have a different View. In that case specific location X and Y for
this view will mean different things or may not be required at all. Perhaps
other View will not need background color or border info, etc. Within my
model objects I just want to store model related information, nothing that
pertains to a particular view. Nevertheless I would like to store whatever
view information I have with the document so when I open it that view is
back to the state user left it at.
___

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: iPhone book recommendations

2009-03-09 Thread Isa Goksu
Try to watch screencasts in iPhone developer center, and there are  
some nice guys trying to create st similar (http:// 
iphonedevcentral.com). Go watch their screencasts as well. Other than  
that, I'd recommend you to use Apple's documentations. It's pretty  
detailed and well covered.


Cheers,
Isa Goksu
Senior Software Engineer at EP
http://isagoksu.com
http://linkedin.com/in/isagoksu

On 8-Mar-09, at 11:45 PM, Donald Hall wrote:

I'm not sure if this is the most appropriate list for this question,  
but here goes:


Can anyone recommend a good book to get started on iPhone  
programming? I've been using Cocoa for several years now, so I don't  
need a really basic starter book. I've looked at several books at  
amazon.com. Has anyone tried the new one by Maher Ali? Too new for  
any customer reviews yet, but it looks like it might be the right  
level for me.


TIA,

Don
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
d...@appsandmore.com
http://www.appsandmore.com
___

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

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

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

This email sent to develo...@isagoksu.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: MVC, storing VIEW-specific information and core data

2009-03-09 Thread I. Savant
On Mon, Mar 9, 2009 at 3:04 PM, Karolis Ramanauskas  wrote:

> Well, perhaps I didn't explain it well enough.

  That's usually the case with technical posts. :-) You know your
project well. Nobody else does, though.

> Let's say, in the future I
> want to have a different View. In that case specific location X and Y for
> this view will mean different things or may not be required at all. Perhaps
> other View will not need background color or border info, etc. Within my
> model objects I just want to store model related information, nothing that
> pertains to a particular view. Nevertheless I would like to store whatever
> view information I have with the document so when I open it that view is
> back to the state user left it at.

  Okay, I see your point, but that really *is* model-layer
information. "For THIS persistent representation of THIS persistent
object, there are THESE properties."

  In this case, Benjamin's response is the recommended route. The fact
is, you want to store this information. Yes, it's view state, but it's
persistent. How else are you going to store it? Preferences? Some
other external file?

  Why??

  If you're worried about performance impact (making your model more
complex), I have two very simple words for you: STOP IT.

  That's right. Stop it.

  No no, just  just stop it.*

  You need to manage and persist this information, right? Well, Core
Data is an object graph MANAGEMENT and PERSISTENCE framework. You're
already storing node information there, so why wouldn't you also store
the persistent view / representation state along with it, where it's
easily managed and retrieved?

  Design your model to do the job it needs to do (even if it means a
separate entity to track different states for different views to any
one node), THEN profile the code performance and work from there *if*
there's a problem.

--
I.S.

* Borrowed from MAD TV sketch.
___

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


Archiving/unarchiving root objects using instance methods

2009-03-09 Thread Paul Kim
I have been using NSKeyedArchiver's +archivedDataWithRootObject:  
method to create archives. Now, I want to create and read the same  
archives but using a instances of NSKeyedArchiver and  
NSKeyedUnarchiver instead of the class methods (so I can do things  
like set a delegate, for instance). The problem is is that to produce  
the same archive using instance methods as opposed to the class  
convenience method, I have to encode the object with the undocumented  
"root" key. I understand not wanting to expose that in the API but I  
can't seem to find the methods to produce the same output using an  
instance.


I've tried -encodeRootObject (defined in NSCoder) thinking  
NSKeyedArchiver's version might do the right thing by encoding with an  
implicit "root" key but not so. The resulting archive cannot be read  
by NSKeyedUnarchiver's +unarchiveObjectWithData.


If I am missing something here, then let me know. And re-defining the  
format is not acceptable as there are many files out there in the  
field. It seems a bit silly if it is indeed the case that the  
"convenience" methods provide no supported way to do it  
"inconveniently." And yes, for practical reasons, using the "root" key  
will work because of backwards compatibility but it would be nice if  
there were an official way to do this (or some semi-official word that  
using the "root" key is ok).


Thanks,

Paul Kim



___

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: MVC, storing VIEW-specific information and core data

2009-03-09 Thread Karolis Ramanauskas
>
> STOP IT.
>
>  That's right. Stop it.
>
>  No no, just  just stop it.*


I needed that, ;) I can't come up with a better way either, I've been
sitting and reading all this morning, my platonic MVC ideal a little
diminished... Perhaps this could be one-to-many relationship so I could
associate several view settings (for different views, if needed, more than
one view per app) with one object! Ha, really this would only mean adding
one property to my model and it will not even be reflected in code since
Core Data defaults will probably suffice.

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

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


Re: MVC, storing VIEW-specific information and core data

2009-03-09 Thread I. Savant
On Mon, Mar 9, 2009 at 4:04 PM, Karolis Ramanauskas  wrote:
>> STOP IT.
>>
>>  That's right. Stop it.
>>
>>  No no, just  just stop it.*
>
> I needed that, ;)

 Sometimes a comically cold splash of water helps. ;-)


> I can't come up with a better way either, I've been
> sitting and reading all this morning, my platonic MVC ideal a little
> diminished...

 For what it's worth, I speak from experience here. I have a similar
situation (different data mining 'views' on a large data set, each
with multiple graphical representations, each of which have their own
custom settings defined by the user - all of which must be persisted
so the user can switch between saved views). For a short moment, I was
also momentarily confused as to how / where to store this information.

 I got over it. ;-)

 For this, I have a "SavedView" entity. The saved view stores all
graph settings as well as the current configuration of the data view
(how the data is cut, shuffled, stacked, racked, and computed).


> Perhaps this could be one-to-many relationship so I could
> associate several view settings (for different views, if needed, more than
> one view per app) with one object! Ha, really this would only mean adding
> one property to my model and it will not even be reflected in code since
> Core Data defaults will probably suffice.

 Well the original idea was:   Node <->> Representation

 ... you'll need to add a "Representation" entity with appropriate
attributes, but then all you need to do is ask for the representation
whose node is x and whose associated view is y.

 For performance, you'll want to grab all the needed representations
in one go (see "batch faulting" and other approaches in the Core Data
guide) so you're not making multiple round-trips to the data store (if
using SQLite or some other atomic store). But that's for later, if you
see a performance problem.

--
I.S.
___

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: Archiving/unarchiving root objects using instance methods

2009-03-09 Thread A.M.


On Mar 9, 2009, at 3:59 PM, Paul Kim wrote:

I have been using NSKeyedArchiver's +archivedDataWithRootObject:  
method to create archives. Now, I want to create and read the same  
archives but using a instances of NSKeyedArchiver and  
NSKeyedUnarchiver instead of the class methods (so I can do things  
like set a delegate, for instance). The problem is is that to  
produce the same archive using instance methods as opposed to the  
class convenience method, I have to encode the object with the  
undocumented "root" key. I understand not wanting to expose that in  
the API but I can't seem to find the methods to produce the same  
output using an instance.


I've tried -encodeRootObject (defined in NSCoder) thinking  
NSKeyedArchiver's version might do the right thing by encoding with  
an implicit "root" key but not so. The resulting archive cannot be  
read by NSKeyedUnarchiver's +unarchiveObjectWithData.


If I am missing something here, then let me know. And re-defining  
the format is not acceptable as there are many files out there in  
the field. It seems a bit silly if it is indeed the case that the  
"convenience" methods provide no supported way to do it  
"inconveniently." And yes, for practical reasons, using the "root"  
key will work because of backwards compatibility but it would be  
nice if there were an official way to do this (or some semi-official  
word that using the "root" key is ok).


I have successfully subclassed NSKeyed[Un]archiver for a similar  
purpose. Here are the methods I used:


__Archiver__
initForWritingWithMutableData:
encodeRootObject:
finishEncoding
return (mutable data from above)

__Unarchiver__
initForReadingWithData:
decodeObject

Cheers,
M

___

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: Archiving/unarchiving root objects using instance methods

2009-03-09 Thread Paul Kim
Thanks for the response but your code changes the archive format. I  
have existing files encoded already with the "root" key and  
decodeObject: without a key won't do it. As mentioned before, yes, I  
can specify the root key but it appears to not be official API.


Paul Kim

Chief Noodler - Noodlesoft
mr_noo...@noodlesoft.com
http://www.noodlesoft.com



On Mar 9, 2009, at 4:20 PM, A.M. wrote:



On Mar 9, 2009, at 3:59 PM, Paul Kim wrote:

I have been using NSKeyedArchiver's +archivedDataWithRootObject:  
method to create archives. Now, I want to create and read the same  
archives but using a instances of NSKeyedArchiver and  
NSKeyedUnarchiver instead of the class methods (so I can do things  
like set a delegate, for instance). The problem is is that to  
produce the same archive using instance methods as opposed to the  
class convenience method, I have to encode the object with the  
undocumented "root" key. I understand not wanting to expose that in  
the API but I can't seem to find the methods to produce the same  
output using an instance.


I've tried -encodeRootObject (defined in NSCoder) thinking  
NSKeyedArchiver's version might do the right thing by encoding with  
an implicit "root" key but not so. The resulting archive cannot be  
read by NSKeyedUnarchiver's +unarchiveObjectWithData.


If I am missing something here, then let me know. And re-defining  
the format is not acceptable as there are many files out there in  
the field. It seems a bit silly if it is indeed the case that the  
"convenience" methods provide no supported way to do it  
"inconveniently." And yes, for practical reasons, using the "root"  
key will work because of backwards compatibility but it would be  
nice if there were an official way to do this (or some semi- 
official word that using the "root" key is ok).


I have successfully subclassed NSKeyed[Un]archiver for a similar  
purpose. Here are the methods I used:


__Archiver__
initForWritingWithMutableData:
encodeRootObject:
finishEncoding
return (mutable data from above)

__Unarchiver__
initForReadingWithData:
decodeObject

Cheers,
M

___

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/mr_noodle%40noodlesoft.com

This email sent to mr_noo...@noodlesoft.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: How to intercept NSToolbar item selection changes

2009-03-09 Thread Stuart Malin


On Mar 9, 2009, at 8:47 AM, Michael Ash wrote:

On Mon, Mar 9, 2009 at 12:38 PM, Stuart Malin   
wrote:


On Mar 9, 2009, at 3:46 AM, cocoa-dev-requ...@lists.apple.com wrote:


Could you simply reset the toolbar selection to whatever it was
before, then display your sheet and then manually set the  
selection to

the new one if the user agrees?


I could do that, but then the user would see the selected toolbar  
item
change away, then back. Mail's preference doesn't behave that way,  
so I am
presuming there must be some way to intercept the change and stop  
it, if
appropriate. Â Perhaps the way do handle this is to prevent  
redisplay of the

window... I'll have to explore this...


No need to "prevent" redisplay. Redisplay due to changes usually
happens at the end of the event loop cycle where the changes took
place. If you reset the selection before that happens (e.g. if the
toolbar item's action fires before the redisplay) then the user will
not see the intermediate state.


Works like a charm!
Thanks for the inisght, Michael. ___

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


persisting user credentials -- how?

2009-03-09 Thread Stefan Wolfrum

Hi,

I have a little app that needs a username & password to log into some  
web service.
These user credentials should be stored permanently so that the user  
doesn't have to enter them after each start of the application again.


What's the most common way to do this? In a .plist file? But how does  
one encrypt the password? What does Apple suggest?


I googled and searched developer docs -- to no avail.

A pointer to a webpage, tutorial, document, code snippet would be cool!

Thanks a lot,
Stefan.

___

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: persisting user credentials -- how?

2009-03-09 Thread Steven Degutis
You should look into EMKeychain made by Brian Amerige, same guy who
made Flow. It's handy.

- Steven Degutis
www.degutis.org
www.teachmecocoa.com
www.thoughtfultree.com

On Mon, Mar 9, 2009 at 4:32 PM, Stefan Wolfrum  wrote:
> Hi,
>
> I have a little app that needs a username & password to log into some web
> service.
> These user credentials should be stored permanently so that the user doesn't
> have to enter them after each start of the application again.
>
> What's the most common way to do this? In a .plist file? But how does one
> encrypt the password? What does Apple suggest?
>
> I googled and searched developer docs -- to no avail.
>
> A pointer to a webpage, tutorial, document, code snippet would be cool!
>
> Thanks a lot,
> Stefan.
>
> ___
>
> 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/steven.degutis%40gmail.com
>
> This email sent to steven.degu...@gmail.com
>



-- 
~Steven Degutis
President, Thoughtful Tree Software, Inc.
http://www.ThoughtfulTree.com/
http://www.TeachMeCocoa.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: persisting user credentials -- how?

2009-03-09 Thread Dave Carrigan


On Mar 9, 2009, at 2:32 PM, Stefan Wolfrum wrote:

I have a little app that needs a username & password to log into  
some web service.
These user credentials should be stored permanently so that the user  
doesn't have to enter them after each start of the application again.


What's the most common way to do this? In a .plist file? But how  
does one encrypt the password? What does Apple suggest?



Keychain services and keychain manager are most likely what you're  
looking for.


--
Dave Carrigan
d...@rudedog.org
Seattle, WA, USA



PGP.sig
Description: This is a digitally signed message part
___

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: persisting user credentials -- how?

2009-03-09 Thread John C. Randolph


On Mar 9, 2009, at 2:32 PM, Stefan Wolfrum wrote:


Hi,

I have a little app that needs a username & password to log into  
some web service.
These user credentials should be stored permanently so that the user  
doesn't have to enter them after each start of the application again.


What's the most common way to do this? In a .plist file? But how  
does one encrypt the password? What does Apple suggest?


I googled and searched developer docs -- to no avail.

A pointer to a webpage, tutorial, document, code snippet would be  
cool!


Look for "Keychain" in the Apple developer docs.

-jcr

___

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: persisting user credentials -- how?

2009-03-09 Thread Hal Mueller
Buzz Andersen has a nice sample that works for iPhone simulator and  
device without code changes:

Blog post: http://log.scifihifi.com/post/55837387/simple-iphone-keychain-code
Source code: http://github.com/ldandersen/scifihifi-iphone/tree/master/security

Hal


___

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


Inducing a crash?

2009-03-09 Thread Rick Mann
I want to test how well our background agent is restarted. I'd like to  
programmatically induce a crash. What's a good way to do so?


TIA,
--
Rick

___

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

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

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

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


[CAWUG] Reminder Meeting Tomorrow

2009-03-09 Thread Bob Frank

Yes ... sorry for the terse reminder, here's the standard info:


  Agenda:
- Bob on optimizing your web site / web app for the iPhone & iPod Touch
- adjournment to O'Toole's

When:   
Tuesday, March 10th, 7:00 PM

Where:
Apple Store Michigan Avenue
679 North Michigan Ave. (at the corner of Huron & Michigan Ave.)
Chicago, IL 60611
http://tinyurl.com/Michigan-Ave-Apple-Store   (Google Maps URL)



On Mar 9, 2009, at 5:07 PM, Adam Howitt wrote:


Hi Bob,
I'm new to the group - Apple store at 7pm?

On Mon, Mar 9, 2009 at 5:00 PM, Bob Frank  wrote:

Hi all,

Sorry for the late reminder, I've been totaly swamped.

Tomorrow I'll be talking about how to optimize your web sites & web
apps for the iPhone.

-Bob








--  
~~~

Adam Howitt
312.714.9229
http://www.walkjogrun.net
http://www.adamhowitt.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google  
Groups "CAWUG: Chicago Cocoa & WebObjects User Group" group.

To post to this group, send email to ca...@googlegroups.com
To unsubscribe from this group, send email to cawug+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cawug?hl=en
-~--~~~~--~~--~--~---



___

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: Inducing a crash?

2009-03-09 Thread davelist


On Mar 9, 2009, at 6:05 PM, Rick Mann wrote:

I want to test how well our background agent is restarted. I'd like  
to programmatically induce a crash. What's a good way to do so?


TIA,
--
Rick



I'm not certain if you mean crashing use a Cocoa method, but this  
should certainly cause a memory fault crash.


  int *x;
  x = 0;
  *x = 5;

Dave

___

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

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

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

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


Re: Inducing a crash?

2009-03-09 Thread Rick Mann
Yeah, something like that. I didn't know if there was a more preferred  
way.


Thanks!

On Mar 9, 2009, at 15:15:18, davel...@mac.com wrote:



On Mar 9, 2009, at 6:05 PM, Rick Mann wrote:

I want to test how well our background agent is restarted. I'd like  
to programmatically induce a crash. What's a good way to do so?


TIA,
--
Rick



I'm not certain if you mean crashing use a Cocoa method, but this  
should certainly cause a memory fault crash.


 int *x;
 x = 0;
 *x = 5;

Dave



--
Rick

___

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

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

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

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


Re: Properly symbol fonts handling in Cocoa

2009-03-09 Thread Alan Shouls

Hi Rimas,


Last few days I was trying to understand how symbol fonts (wingdings,
webdings X, etc) should be properly handled with cocoa text system. As
a good example could be Adobe Photoshop and Apple Pages. Both behaves
in the same way and I want to achieve the same result.


Probably the best thing to do is to 'forget about it' and let cocoa  
text do it's stuff. I will try and explain.


Many symbol fonts have symbols that exist in different parts of the  
unicode space. So, for example, there is an area of Unicode that is  
used for dingbats symbols. To enter a dingbat symbol you should use  
the "Character Palette" input method. You can turn this input method  
on in the International section of the System Prefs. With this palette  
open you can locate the dingbat and click on it. This is the way that  
these things are generally done in Unicode. Wingdings is, if I  
remember correctly a bit strange as it is part of the roman character  
space.


This way of doing things is consistent and works across applications -  
so if you enter text like this, with these characters, in text edit  
and then paste them into your own app it will work fine. I would not  
recommend changing character codes as the UI will be strange and  
different from other applications.


Best regards

Alan Shouls
___

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


Is UITableView more memory efficient than UIScrollView?

2009-03-09 Thread James Cicenia
I am trying to get my one screen to work and I feel I am having a  
memory issue that just causes my application to reboot.


Even though UITableView subclasses UIScrollView I was wondering if it  
pages memory or such and would be better for my app.


Thanks
James Cicenia

___

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: MVC, storing VIEW-specific information and core data

2009-03-09 Thread Erik Buck
Let me explain how I solved the same problem:
 
I have an application that stores large data files via Core Data.  Multiple 
users access the same data at different times, and each user has a preferred 
way of visualizing the data.  E.g. starting point, filter sets, color coding, 
etc. all differ for every user for every document.  The user's want their view 
configurations preserved even if the last person who modified the data used a 
different view configuration.
 
My solution:
Most of my Core Data entities have a Data blob attribute which is actually and 
archived dictionary of "extra data."  Each user's per-document view 
configuration is stored under keys within each blob.  The Data blobs start out 
nil which just defaults to something reasonable in each view.
 
Question 1: Why not store the view attributes in separate Core Data attributes 
or in relationships ? 
Answer 1a: The application allows users to strip all view configuration 
information out before delivering to a customer.  That makes the files smaller 
and removes information that won't benefit the customer anyway.  It's easy to 
strip the information by just walking through all entities and setting the 
"extra data" attribute to nil.
Answer 1b: Most user's never set most "extra data" attributes, so why reserve 
storage for pointless default values.  Plus, I can invent new view attributes 
at any time by just using new dictionary keys without changing the Core Data 
model.
 
Question 2: Why store the "extra" data in Core Data at all instead of a 
separate file in a "bundle"?:
Answer 2: I tried it both ways, and there didn't seem to be any reason to 
create an extra file per document just for this.
 
Question 3: Doesn't this violate the MVC pattern?
Answer 3: The Model is "any data the user cares about", so if the user cares 
about the position and color of elements, that information is part of the 
Model.  The only issue is that different users want different information about 
the same data.  Sometimes a single user wants multiple conflicting sets of 
information about the same data.  I actually show the user all of the "named 
view configurations" that are available in a particular document and let the 
user pick which one to view at that moment.  The user can have multiple views 
of the same data open at once.
 
Question 4: Why not use Core Data's context merging features and store extra 
data in a separate context?
Answer 4: I didn't know how, and it didn't seem necessary to learn at the time.
 
 
___

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: Inducing a crash?

2009-03-09 Thread Jean-Daniel Dupas
Killing it from the terminal is probably preferred, as it does not  
require you alter the code.


Le 9 mars 09 à 23:17, Rick Mann a écrit :

Yeah, something like that. I didn't know if there was a more  
preferred way.


Thanks!

On Mar 9, 2009, at 15:15:18, davel...@mac.com wrote:



On Mar 9, 2009, at 6:05 PM, Rick Mann wrote:

I want to test how well our background agent is restarted. I'd  
like to programmatically induce a crash. What's a good way to do so?


TIA,
--
Rick



I'm not certain if you mean crashing use a Cocoa method, but this  
should certainly cause a memory fault crash.


int *x;
x = 0;
*x = 5;

Dave



--
Rick

___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org

This email sent to devli...@shadowlab.org



___

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: Properly symbol fonts handling in Cocoa

2009-03-09 Thread Paul Sanders

> Wingdings is, if I remember correctly a bit strange as it is part of the 
> roman character
space.

Yes, it's a Windows thing.  So if you cut and paste Wingdings characters as 
plain text, and the paste target is using a standard (i.e. non-Wingdings) 
font, you will see ASCII characters, 'cos that's what's on the clipboard. 

___

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

2009-03-09 Thread Steve Steinitz

Hi Michael,

On 9/3/09, michael.suess...@utanet.at wrote:

When I execute the program and click on the add button, the 
controller  creates a new data record and I can enter the 
attributes. If I press  again the button, the add method is 
called, but no new record is  created.


I've had plenty of problems with Core Data but never that one 
:)  Have you had a look at the run log in Xcode to see if 
anything is going wrong after you add that first record?


I have subclassed the controller object and learned that the 
canAdd:  method returns false after I press the button the 
second time.


Odd.


What have I done wrong? Which action does the controller expect?


Feel free to post your test project and I or someone else can 
have a look.


Cheers,

Steve

___

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: Is UITableView more memory efficient than UIScrollView?

2009-03-09 Thread Mike Abdullah

Well it rather depends what you ask UIScrollView to do for you…

The most important thing is to recycle or dispose of views that are no  
longer visible to the user. Care to explain more what your code is  
actually doing?


Mike.

On 9 Mar 2009, at 22:27, James Cicenia wrote:

I am trying to get my one screen to work and I feel I am having a  
memory issue that just causes my application to reboot.


Even though UITableView subclasses UIScrollView I was wondering if  
it pages memory or such and would be better for my app.


Thanks
James Cicenia

___

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/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net


___

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

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

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

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


Re: Inducing a crash?

2009-03-09 Thread Greg Parker

On Mar 9, 2009, at 3:17 PM, Rick Mann wrote:

On Mar 9, 2009, at 15:15:18, davel...@mac.com wrote:


On Mar 9, 2009, at 6:05 PM, Rick Mann wrote:
I want to test how well our background agent is restarted. I'd  
like to programmatically induce a crash. What's a good way to do so?


I'm not certain if you mean crashing use a Cocoa method, but this  
should certainly cause a memory fault crash.


int *x;
x = 0;
*x = 5;


Yeah, something like that. I didn't know if there was a more  
preferred way.


abort() and __builtin_trap() work well. They have the advantage of  
being grep-able when you want to take them out. abort() and  
__builtin_trap() and intentional memory faults should behave  
identically other than the precise contents of the crash log, unless  
you have  signal handlers for SIGSEGV/SIGBUS/SIGABRT.



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


Re: Archiving/unarchiving root objects using instance methods

2009-03-09 Thread Martin Wierschin

Hi Paul,

I have existing files encoded already with the "root" key and  
decodeObject: without a key won't do it. As mentioned before, yes,  
I can specify the root key but it appears to not be official API.



I hit the same problem a while back and never did find an official  
way to solve this. I think you just have to hardcode @"root" and hope  
it works going forward. I filed a bug on it as radar://6440080


~Martin

___

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: Properly symbol fonts handling in Cocoa

2009-03-09 Thread Martin Wierschin
Wingdings is, if I remember correctly a bit strange as it is part  
of the

roman character space.


Yes, the "ding" fonts are rather strange in their handling of  
characters. Wingdings will display symbol glyphs when applied to  
characters in either the ASCII range (0-256) or the private use area  
(U+F021 to U+F0FF). If you're using the NSFont API to query supported  
characters for a ding font (eg: via "coveredCharacterSet"), be  
careful as it seems to lie; at least under Tiger.


~Martin

___

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: User In-Activity hook? And a request

2009-03-09 Thread Gerriet M. Denkmann


On 6 Mar 2009, at 02:24, Shawn Erickson  wrote:


On Thu, Mar 5, 2009 at 8:58 AM, m  wrote:

For the archives, the blog Torsten linked to had this bit of code:

double CGSSecondsSinceLastInputEvent(long evType);
double idleTime = CGSSecondsSinceLastInputEvent(-1);


You should note that those are private / undocumented API ...so you
shouldn't use them.
This might be undocumented (at least I failed to find any  
documentation) but it's use is highly recommended by Apple: " Instead  
[of NXIdleTime], we strongly encourage developers to make use of the  
CGSSecondsSinceLastInputEvent API."


Quoted from: /System/Library/Frameworks/IOKit.framework/Versions/A/ 
Headers/hidsystem/event_status_driver.h on 10.5.6.


Gerriet.

___

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: Inducing a crash?

2009-03-09 Thread Rick Mann


On Mar 9, 2009, at 16:52:09, Greg Parker wrote:


On Mar 9, 2009, at 3:17 PM, Rick Mann wrote:

On Mar 9, 2009, at 15:15:18, davel...@mac.com wrote:


On Mar 9, 2009, at 6:05 PM, Rick Mann wrote:
I want to test how well our background agent is restarted. I'd  
like to programmatically induce a crash. What's a good way to do  
so?


I'm not certain if you mean crashing use a Cocoa method, but this  
should certainly cause a memory fault crash.


int *x;
x = 0;
*x = 5;


Yeah, something like that. I didn't know if there was a more  
preferred way.


abort() and __builtin_trap() work well. They have the advantage of  
being grep-able when you want to take them out. abort() and  
__builtin_trap() and intentional memory faults should behave  
identically other than the precise contents of the crash log, unless  
you have  signal handlers for SIGSEGV/SIGBUS/SIGABRT.


Hmm. Good to know. We may have *some* sig handlers, but this is just  
for testing in one place (-(void) crash: (id) sender)).


Thanks!

--
Rick

___

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

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

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

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


Re: persisting user credentials -- how?

2009-03-09 Thread Nathan Kinsinger

On Mar 9, 2009, at 3:32 PM, Stefan Wolfrum wrote:


Hi,

I have a little app that needs a username & password to log into  
some web service.
These user credentials should be stored permanently so that the user  
doesn't have to enter them after each start of the application again.


What's the most common way to do this? In a .plist file? But how  
does one encrypt the password? What does Apple suggest?


I googled and searched developer docs -- to no avail.

A pointer to a webpage, tutorial, document, code snippet would be  
cool!


Thanks a lot,
Stefan.


Keychain Framework
http://sourceforge.net/projects/keychain/

--Nathan


___

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: CrashReporter alternatives for third-party apps?

2009-03-09 Thread Daniel Waylonis

On Mar 4, 2009, at 6:26 PM, Rick Mann wrote:

Can you guys suggest something I can use to submit crash reports to  
my own servers (and perhaps to suppress Apple's CrashReporter)?


Hi Rick,

Check out Google's open source Breakpad project:

http://code.google.com/p/google-breakpad/

It works on Mac, Windows, and Linux.  If there's a crash, it can  
create a report to send (with or w/o interaction) to the server of  
your choice.  The report is in a binary format, but you can use the  
crash_report tool to generate a text file very similar to Apple's  
crash report logs.  And you can choose to skip Apple's CrashReporter.


Dan
-
Dan Waylonisd...@nekotech.com
nekotech SOFTWARE
http://www.nekotech.com
650.887.3711



___

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: MVC, storing VIEW-specific information and core data

2009-03-09 Thread Karolis Ramanauskas
>
> Most of my Core Data entities have a Data blob attribute which is actually
> and archived dictionary of "extra data."  Each user's per-document view
> configuration is stored under keys within each blob.  The Data blobs start
> out nil which just defaults to something reasonable in each view.


 This is what I will probably do. Reasons:

1. No need to create extra entities, objects.
2. Controller may be application specific and take care of deciding what
goes in the "Blob".
3. Only need to fetch this info once at the start, then save it before
closing.


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

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


Re: Is UITableView more memory efficient than UIScrollView?

2009-03-09 Thread James Cicenia
I have a listing of approximately 100 lines. Within each line I create  
a visual calendar that has up 24 images. These images are tiny.
However, I have proved to myself that it is a memory issue and calling  
didRecieveMemory warning. This view has two tabs on top which allows  
you to switch between views. They are just a category for each with  
the same visual setup. When I switch the view, it displays, and then  
poof the app quits.


I just can't seem to figure out what to do in that memory that will  
alleviate this problem.

I have tried this:

[veggieImageView release], veggieImageView = nil;
[veggieTypeView release], veggieTypeView = nil;
[veggieScrollView release], veggieScrollView = nil;

but it just clears the view and then the same poof the app quits.

I have aggressively tested everything else on this app and I am down  
to this one unstable area.

Thank you,
James Cicenia


On Mar 9, 2009, at 6:43 PM, Mike Abdullah wrote:


Well it rather depends what you ask UIScrollView to do for you…

The most important thing is to recycle or dispose of views that are  
no longer visible to the user. Care to explain more what your code  
is actually doing?


Mike.

On 9 Mar 2009, at 22:27, James Cicenia wrote:

I am trying to get my one screen to work and I feel I am having a  
memory issue that just causes my application to reboot.


Even though UITableView subclasses UIScrollView I was wondering if  
it pages memory or such and would be better for my app.


Thanks
James Cicenia

___

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/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net




___

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

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

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

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


Re: Archiving/unarchiving root objects using instance methods

2009-03-09 Thread Graham Cox


On 10/03/2009, at 6:59 AM, Paul Kim wrote:


I have to encode the object with the undocumented "root" key.


And yes, for practical reasons, using the "root" key will work  
because of backwards compatibility but it would be nice if there  
were an official way to do this (or some semi-official word that  
using the "root" key is ok).



This isn't, of course, official in any way.

I use the "root" key also and expect it won't change. If Apple ever  
decided on some strange whim to do that, they'd break all existing  
archives out there or else have to add extra code to accept the  
existence of the "root" key in all those older archives. What would be  
the point?


As far as I could discover, if you need a delegate, you have no choice  
but to use "root". This fact pretty much forces Apple's hand since  
it's their error that they haven't documented or exposed this, but the  
wide existence of archives that must assume it means that they pretty  
much have to support it forever after.


Also, if it really concerns you, you could create your archiver  
manually also, using "root" as your explicit root key. That way you've  
supplied it at both ends and so your code would be proof against Apple  
ever changing this for the convenience methods.


File a documentation bug also - it'll be a dupe but at least this  
flags up the fact that it matters to devs.


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

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


Automatically select current system's timezone from popup button

2009-03-09 Thread Jushin
I have a NSPopUpButton list, which contains name of timezones.
When I construct the popup button, I get the list of the timezone using
[NSTimeZone knownTimeZoneNames]
and then constructed another array using [NSTimeZone timeZoneWithName:name]

So, basically, the popup button has the list of NSString of timezone name.
However, when I launch my application, I would like to make my
application automatically select current system's timezone from the
list.
Also, when a user select a timezone from the popup button, I want to
convert it into NSTimeZone.
How can I do this?
___

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: Automatically select current system's timezone from popup button

2009-03-09 Thread Nick Zitzmann


On Mar 9, 2009, at 9:33 PM, Jushin wrote:

So, basically, the popup button has the list of NSString of timezone  
name.

However, when I launch my application, I would like to make my
application automatically select current system's timezone from the
list.
Also, when a user select a timezone from the popup button, I want to
convert it into NSTimeZone.
How can I do this?



Use the represented object feature of NSMenuItem to implement both.

Nick Zitzmann




___

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

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

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

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


[ANN] InspectorKit (framework/IB-plugin)

2009-03-09 Thread Steven Degutis
Hi all!

I've just released a piece of open-source software (BSD license) as
both a framework and an Interface Builder plugin, called InspectorKit.
It's intended to give you the ability to create an inspector at design
time, which mimics the aesthetics and functionality of many found in
Leopard. You can read more detail about it at the following link,
including finding the source, a binary download, and a video demo of
the plugin in action:

http://www.degutis.org/dev/open-source/2009/03/09/introducing-inspectorkit/

Thanks, I hope you find good use from it. If you end up using it in
your project, I'd love to hear about it!

-Steven Degutis
Lead Monkey Assassin
www.ThoughtfulTree.com
www.TeachMeCocoa.com
www.Degutis.org
(also hire.Degutis.org)
___

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: Automatically select current system's timezone from popup button

2009-03-09 Thread Ron Fleckner


On 10/03/2009, at 3:30 PM, Nick Zitzmann wrote:



On Mar 9, 2009, at 9:33 PM, Jushin wrote:

So, basically, the popup button has the list of NSString of  
timezone name.

However, when I launch my application, I would like to make my
application automatically select current system's timezone from the
list.
Also, when a user select a timezone from the popup button, I want to
convert it into NSTimeZone.
How can I do this?



Use the represented object feature of NSMenuItem to implement both.

Nick Zitzmann



Or just get the time zone from the name of the item:

- (IBAction)popupAction:(id)sender
{   
NSString *place = [[sender selectedItem] title];
NSTimeZone *zone = [NSTimeZone timeZoneWithName:place];
// Do stuff with zone...
}

Ron
___

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: Automatically select current system's timezone from popup button

2009-03-09 Thread Kyle Sluder
On Tue, Mar 10, 2009 at 1:12 AM, Ron Fleckner
 wrote:
> Or just get the time zone from the name of the item:

In general, tying constant identifiers to UI elements like this is a
very bad idea; it makes localization very hard and introduces stronger
coupling between the UI and your code.

In this specific case, you should be using +knownTimeZoneNames only to
fill in the represented object of each menu item.  You should instead
use -localizedName:locale: to provide the label of each menu item.
Note that this method is 10.5 only.

--Kyle Sluder
___

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

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

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

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