Join me in Pearltrees

2011-02-22 Thread praveenmatanam
___

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

Please do not post 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: [NSBitmapImageRep getBitmapDataPlanes] copying data?

2011-02-22 Thread Jonathan Taylor
On 21 Feb 2011, at 23:49, Ken Thomases wrote:
 What makes you think the data copy is extra?
 
 If you read that AppKit release note, you'll see that NSImage may not be 
 decoding the file contents right off the bat.  For example, it mentions that 
 [i]f you initialize a NSImage from a JPEG file, then draw it in a PDF, you 
 should get a PDF of the same file size as the original JPEG.  In other 
 words, NSImage is keeping the image data in its original JPEG-compressed 
 format, not as a rasterized bitmap.

That's a very good point. In this case, though, I think there probably is some 
excess stuff going on. Looking at what's going on with Shark, approx 1/5th of 
this thread's time is spent in 'read' (backed by disk cache), 1/4 in 
copyImageBlockSetTIFF, which seems to be done lazily but I presume is the 
decoding phase you allude to [although in this case it's pretty much just a 
memcpy], and 1/5 in imageProvider_getBytes, which copies the data *again*.


On 22 Feb 2011, at 00:05, Quincey Morris wrote:
 
 You know you're stuck with disk reads at some point in the process, which are 
 going to be as slow as they're going to be. I'm going to go out on a limb and 
 say that if your application can't swallow the additional cost of 
 uncompressing and/or copying inside 'getBitmapDataPlanes' *once* per image**, 
 your application design is broken*** -- or your Mac hardware is too slow for 
 that application. :)

Very true, though as I mentioned the disk cache often works in my favour here. 
To be honest the specific issue of getBitmapDataPlanes is not really on the 
most critical realtime path in my code. As much as anything, it was a case of 
having spotted this issue I wanted to understand it thoroughly because there is 
GUI drawing (using NSImages/bitmaps etc) that is taking place in parallel with 
the main performance-critical stuff. Also, as Ken Ferry's reply revealed, there 
are evidently some impedance matching issues I should really understand 
better, so this is all extremely helpful.

On 22 Feb 2011, at 02:02, Ken Ferry wrote:
 However!  ImageIO, the underlying home framework of all image file format 
 reading and writing on Mac OS X, makes no promises about the relationship of 
 the file to the in-memory pixel format.  Certainly you know that many file 
 formats are compressed, whereas the buffer you returned from the bitmapData 
 method of NSBitmapImageRep is not.  Further, there are many on-disk formats 
 that are not supported by Quartz.  Besides that, you might figure that the OS 
 will never reduce the number of pixel formats, so if you're currently getting 
 something tightly related to what you see in the file, you will expect to get 
 that in the future.  That's not the case though… CoreGraphics has talked 
 about standardizing everything with less data than ARGB 32 host endian to 
 ARGB 32 host endian right when its read in, to simplify and speedup later 
 steps of the graphics pipeline.  There are formats for which that happens 
 today (I think maybe RGB JPEG data is coming in as as ARGB as of 10.6, 
 perhaps?).  That change was made as part of work in 10.6 to support decoding 
 only rectangular blocks of an image throughout the graphics pipeline.  Asking 
 for the bitmapData also defeats that pipeline and forces everything into 
 memory.
 
 Plus, it's pretty hard to write code that deals expressly with pixel data 
 without putting things in a standard colorspace.  RGBA (.3, .5, .6, 1.0) is a 
 different color in sRGB vs generic RGB.  For most pixel-processing 
 algorithms, you'll get different visual results if you naively apply the same 
 mathematics in different colorspaces.  
 
 Anyway, point is, in all likelihood, you do need to draw your image to a 
 bitmap in known format in order to work with the pixels.  You probably only 
 need to do this once though…  if you're seeing repeated copying in 
 bitmapData, that suggests that you're alternately drawing and asking for 
 pixel data from the image.  If you're never modifying the data, you could 
 instead store the data on the side in addition to the rep.  Storing can be 
 done via subclass, wrapper object, global dictionary mapping rep object to 
 data, objc associative storage, etc.  Or, look at just drawing the image into 
 a bitmap when you need to see the data.  That's less work for you to 
 implement, and may find that it performs well, depending on what was really 
 costing you before.  You could consider reusing one bitmap to draw in from 
 multiple images to avoid malloc'ing and free'ing memory.  
Thanks very much - lots of food for thought there. I think some of the issues 
you mention ~should~ be less severe because I am working with greyscale data, 
but maybe it's not guaranteed. The pattern I was following was at least 
previously a recommended approach I presume (see for example 
CocoaCreateMovie/CopyNSImageToGWorld). It sounds from what you're saying as if 
drawing the image into a bitmap may actually now be potentially more 

unloading an launch agent with in the same process

2011-02-22 Thread Rajendran P


 Hi All ,
 I have a ui based application which is launched by   launch agent .The  
user is provided with an option to exit/ quit  from the same applicaion . what 
is the best way to unload the application  ?



  P.Rajendran or Raju   

(for further details contact 
me ) 



___

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

Please do not post 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: unloading an launch agent with in the same process

2011-02-22 Thread Arun
Make sure it is launched only once. This can be set as a value in the launch
agent plist.

-Arun

On Tue, Feb 22, 2011 at 4:36 PM, Rajendran P rasu_1...@yahoo.com wrote:



  Hi All ,
 I have a ui based application which is launched by   launch agent .The
 user is provided with an option to exit/ quit  from the same applicaion .
 what
 is the best way to unload the application  ?



  P.Rajendran or Raju

 (for further details contact
 me )



 ___

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

 Please do not post 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/arun.ka%40gmail.com

 This email sent to arun...@gmail.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: unloading an launch agent with in the same process

2011-02-22 Thread Jerry Krinock

On 2011 Feb 22, at 03:14, Arun wrote:

 Make sure it is launched only once. This can be set as a value in the launch
 agent plist.

If you can't use Arun's idea, then you'll need to unload it by invoking 
launchctl as an NSTask, because I've never been able to find an API to do this.

P.S.  For low-level questions on launchd, ask launchd-...@lists.macosforge.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


Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Brad Stone
I've been trying for days to determine why I get EXC_BAD_ACCESS when I try to 
access a managedObject property from within an accessor of another property?

this code in main.m
[[self note] setValue:@HELLO WORLD forKey:@category];
NSNumber *tmpVal = [NSNumber numberWithBool:![[[self note] 
valueForKey:@isEncrypted] boolValue]]; // if I type po [self note] I see the 
note description
[[self note] setValue:tmpVal forKey:@isEncrypted]; // if I type po [self 
note] after this I get EXEC_BAD_ACCESS

The if statement in the accessor is causing the problem:
- (NSString *)category {
NSString * tmpValue;

[self willAccessValueForKey:@category];
tmpValue = [self primitiveCategory];
[self didAccessValueForKey:@category];

if ([[self valueForKey:@isEncrypted] boolValue]) {  // THIS IS CAUSING 
THE PROBLEM
// code to decrypt tmpValue
}

return tmpValue;
}

When I replace: if ([[self valueForKey:@isEncrypted] boolValue]) with if (1 
== 2 ) or if (1 == 1 ) it works

FYI: in my .h file @property (nonatomic, retain) NSNumber * isEncrypted; and 
@dynamic isEncrypted; in .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


Fwd: Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Brad Stone
FYI - my managedObject is defined as such:

@interface Note :  NSManagedObject  
{
}

@property (nonatomic, retain) NSNumber * uid;
@property (nonatomic, retain) NSString * category;
@property (nonatomic, retain) NSNumber * isEncrypted;

@interface Note (CoreDataGeneratedPrimitiveAccessors)

- (NSString *)primitiveCategory;
- (void)setPrimitiveCategory:(NSString *)value;

@end


@implementation Note 

@dynamic uid;
@dynamic category;
@dynamic isEncrypted;

- (NSString *)category 
{


NSString * tmpValue;

[self willAccessValueForKey:@category];
tmpValue = [self primitiveCategory];   
[self didAccessValueForKey:@category];

   if ([[self valueForKey:@isEncrypted] boolValue]) {
//code to decrypt tmpValue
}
 
return tmpValue;
}

- (void)setCategory:(NSString *)value 
{   


if ([[self valueForKey:@isEncrypted] boolValue]) {
// code to encrypt tmpValue
}
 

[self willChangeValueForKey:@category];
[self setPrimitiveCategory:value];
[self didChangeValueForKey:@category];
}

- (BOOL)validateCategory:(id *)valueRef error:(NSError **)outError 
{
// Insert custom validation logic here.
return YES;
}
___

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

Please do not post 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: Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Uli Kusterer
On 22.02.2011, at 16:13, Brad Stone wrote:
 FYI - my managedObject is defined as such:
 
 @interface Note :  NSManagedObject  
 {
 }

That's probably not your problem, but just to eliminate it as a cause: You 
should prefix your class names. Apple has been known to create internal private 
classes with un-prefixed names (like Account). And once one class with a 
particular name has been loaded, requests to load any other class of the same 
name will be ignored. Anyone trying to create an instance of such a class will 
get the first class that was loaded, which is probably something completely 
different.

So I recommend choosing your own three-character prefix (BST?), just in case 
there's some private Apple class named Note.

Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Brad Stone
Yes, all my other classes are prefixed with SR since this one.  I haven't 
gotten back to fixing this.

On Feb 22, 2011, at 10:22 AM, Uli Kusterer wrote:

 On 22.02.2011, at 16:13, Brad Stone wrote:
 FYI - my managedObject is defined as such:
 
 @interface Note :  NSManagedObject  
 {
 }
 
 That's probably not your problem, but just to eliminate it as a cause: You 
 should prefix your class names. Apple has been known to create internal 
 private classes with un-prefixed names (like Account). And once one class 
 with a particular name has been loaded, requests to load any other class of 
 the same name will be ignored. Anyone trying to create an instance of such a 
 class will get the first class that was loaded, which is probably something 
 completely different.
 
 So I recommend choosing your own three-character prefix (BST?), just in case 
 there's some private Apple class named Note.
 
 Cheers,
 -- Uli Kusterer
 The Witnesses of TeachText are everywhere...
 http://www.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Problem opening file

2011-02-22 Thread Carlos Eduardo Mello

Hi there,

I have a configuration file which is used by an internal library in my  
app's data model engine. The engine was written in c++ and needs this  
file for loading the app's documents correctly. Theis file never  
changes and shouldn't have to be seen or open  by the user. Its  
contents are the same for any document files oppened by the user.


During debugging I place the file next to the executable in Build- 
Debug and the library opens it with using c++ streams with just the  
file name. However, when I compilethe  app as release, and place the  
configuration file next to the executable, it fails to find the file.  
I imagine I have to deal with application bundle api, but the thing is  
I can't add any cocoa code to this library, as it needs remain cross- 
platform. Also I can't follow the problem when I use the release  
version since the debugging symbols are not there. NSLog helped me  
track the problem, but iI can't figure out how to fix it.


 My questions are:

- Other than debugging symbols, are there anyother differences between  
a debug and release build?
- Why can I open the file when running the app from Xcode and not  
otherwise?

- How can I make my app see the file?

Any comments would be much appreciated.

Carlos.
___

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

Please do not post 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: Problem opening file

2011-02-22 Thread Sherm Pendley
On Tue, Feb 22, 2011 at 10:47 AM, Carlos Eduardo Mello
carloseme...@gmail.com wrote:

 I have a configuration file which is used by an internal library in my app's
 data model engine. The engine was written in c++ and needs this file for
 loading the app's documents correctly. Theis file never changes and
 shouldn't have to be seen or open  by the user. Its contents are the same
 for any document files oppened by the user.

 During debugging I place the file next to the executable in Build-Debug and
 the library opens it with using c++ streams with just the file name.
 However, when I compilethe  app as release, and place the configuration file
 next to the executable, it fails to find the file.

It's not a Debug/Release difference. The difference is how you're
launching your app - the current working directory is different when
you launch the app from Finder, from Xcode, and using the open
command-line tool.

 I imagine I have to deal
 with application bundle api, but the thing is I can't add any cocoa code to
 this library, as it needs remain cross-platform.

Does this library allow you to specify the full path to its config
file, instead of just its name, when you initialize the library? If
so, you could keep the platform-specific code outside of the library
itself.

Alternatively, you could use NSBundle methods to find the location of
your executable, then chdir() to that directory before initializing
the library.

sherm--

-- 
Cocoa programming in Perl:
http://camelbones.sourceforge.net
___

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

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

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

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


Re: Problem opening file

2011-02-22 Thread Scott Ribe
On Feb 22, 2011, at 9:14 AM, Sherm Pendley wrote:

 I imagine I have to deal
 with application bundle api, but the thing is I can't add any cocoa code to
 this library, as it needs remain cross-platform.
 
 Does this library allow you to specify the full path to its config
 file, instead of just its name, when you initialize the library? If
 so, you could keep the platform-specific code outside of the library
 itself.
 
 Alternatively, you could use NSBundle methods to find the location of
 your executable, then chdir() to that directory before initializing
 the library.

Also, although I don't know that it really matters other than style  
consistency, but next to the executable is not where such a file would normally 
be put in an app bundle. The Resources folder in the bundle is more 
appropriate--assuming here that you're building a regular bundled app and not 
just a command-line executable...

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice




___

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

Please do not post 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 detect when an NSTextView has finished being loaded into a window?

2011-02-22 Thread Keith Blount
Many thanks for the reply. Yes, you're right - the text view could get 
deallocated in -viewDidMoveToWindow which is indeed a recipe for disaster and 
was causing the issues. (I should have realised that in the first place, but by 
the time the page layout set-up got moved to a method responding to a 
notification sent from -viewDidMoveToWindow, I was at the end of my tether 
trying to put it in the right place to avoid the artefact bug, and as the 
program got away with not crashing for most users, I never noticed the 
potential problem with this move.)

The way the page view gets swapped for the text view and then the original text 
view gets removed entirely is actually based on code straight from TextEdit, so 
I think it's more the placement of the code than the way it's done.

I seem to have fixed the issue, although my solution is a bit of an ugly 
mash-up. In my controller I now retain the original text view in the method 
responding to the notification it receives from -viewDidMoveToWindow and then 
release it again after a delay of 0, i.e. at the end of the run loop. That way 
I ensure it's kept around long enough so that it doesn't get deallocated while 
it's still calling methods on itself (e.g. from _setWindow:). I'm also now 
sending the notification from the end of _setWindow: if that method is 
available and it's not the App Store version, otherwise after a delay of 0 from 
-viewDidMoveToWindow. The latter still has the issue of the slight delay where 
the user can see the original text view appear on screen for an instant before 
it gets swapped out for the page view, but that's better than a crash. Taken 
together, these ensure that the page view only gets loaded when there is a 
window for it to get loaded into, and that the
 old text view is only deallocated after it's been finished with.

Part of the issue is the complex arrangement of views in my app. TextEdit can 
call -setHasMultiplePages: in -windowDidLoad, because the page view will move 
directly to the window; in my app the page view may be hidden away in a tab 
view at this point as there may be a different sort of view selected for 
viewing on project open - showing an image, or a PDF file, for instance - 
meaning that if I call -setHasMultiplePages: in -windowDidLoad, the page view 
may not have a window and so the artefacts bug will rear its head. The next 
obvious place for switching to multiple pages view was 
-tabView:didSelectTabViewItem:, so that it only got called when the text was 
displayed in the tab view. However, that's no good either because my app has 
hide-able split panes, so there's no guarantee that the tab view is on screen 
and part of a window when everything gets set up... This is why I ended up only 
switching to the multiple page view when the program knows that the
 basic text view has made it to the window - that's the only time I'm 
guaranteed a window for the page view.

Hmm, although I'm now wondering if maybe I should just set the scroll view's 
documentView to nil when it's off-window and do all this when the scroll view 
moves to the window...

Thanks again and all the best,
Keith

--- On Tue, 2/22/11, Kyle Sluder kyle.slu...@gmail.com wrote:

 From: Kyle Sluder kyle.slu...@gmail.com
 Subject: Re: How to detect when an NSTextView has finished being loaded into 
 a window?
 To: Keith Blount keithblo...@yahoo.com
 Cc: Matt Neuburg m...@tidbits.com, cocoa-dev@lists.apple.com
 Date: Tuesday, February 22, 2011, 3:19 AM
 On Mon, Feb 21, 2011 at 1:04 PM,
 Keith Blount keithblo...@yahoo.com
 wrote:
  Hi Matt,
 
  Many thanks for the reply. Unfortunately that doesn't
 really work, as if it is hidden in any way then it is off
 screen and therefore the artefacts bug rears its ugly head.
 (The whole thing is in a tab view, and even if the text view
 is in a different tab to the visible one while it is set up,
 the artefacts bug appears.)
 
 Are you running on Snow Leopard?
 
 Also, from your original description, it sounds like you
 intend for
 the text view to possibly be deallocated during
 -viewDidMoveToWindow.
 This sounds like a recipe for disaster. Instead, you should
 try
 hooking up additional text views/containers to the same
 layout
 manager. Your first text view will therefore always exist;
 in
 single-view mode it will be the only text view, whereas in
 page layout
 mode it will be the first in the chain of text views
 sharing the
 layout manager and text storage.
 
 --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


Re: Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Quincey Morris
On Feb 22, 2011, at 06:19, Brad Stone wrote:

 I've been trying for days to determine why I get EXC_BAD_ACCESS when I try to 
 access a managedObject property from within an accessor of another property?
 
 this code in main.m
 [[self note] setValue:@HELLO WORLD forKey:@category];
 NSNumber *tmpVal = [NSNumber numberWithBool:![[[self note] 
 valueForKey:@isEncrypted] boolValue]]; // if I type po [self note] I see 
 the note description
 [[self note] setValue:tmpVal forKey:@isEncrypted]; // if I type po [self 
 note] after this I get EXEC_BAD_ACCESS
 
 The if statement in the accessor is causing the problem:
 - (NSString *)category {
 NSString * tmpValue;
 
[self willAccessValueForKey:@category];
tmpValue = [self primitiveCategory];
[self didAccessValueForKey:@category];
   
if ([[self valueForKey:@isEncrypted] boolValue]) {  // THIS IS CAUSING 
 THE PROBLEM
// code to decrypt tmpValue
}
   
return tmpValue;
 }

No answer, but a couple of points:

-- What happens if you write 'note.isEncrypted' (or '[note isEncrypted]') 
instead of '[note valueForKey: @isEncrypted]'?

-- What happens if you code your own custom accessors for isEncrypted, like 
you've done for category?

-- EXC_BAD_ACCESS is often a symptom of a memory management problem. Is there a 
problem with the object being returned by '[self note]'? You didn't show code 
for where this is implemented. It's possible that you failed to retain the 
object, or, if you're using garbage collection, returned an object with no 
strong references, or perhaps you returned a zombie object.

What happens in the above code if you set first a local variable to '[[self 
note] retain]' and use the local variable in place of the other references to 
'[self note]'?


___

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

Please do not post 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


Reliable way to determine bitness of the kernel

2011-02-22 Thread eveningnick eveningnick
hello
i have a kext (or, rather, 2 kexts - one built with -arch i386, another one
with -arch x86_64). They should work on both OS X 10.5 and 10.6.
i have an installing script, which looks like
if [ `uname -a | grep x86_64 | wc -l` ge 1 ]; then
   cp -R 64bit.kext /Library/Extensions/
else
   cp -R 32bit.kext /Library/Extensions/

this goes into production code.
But unfortunately, it seems like it does not work well on all systems.
What caveats may this method of determining the bitness of the system have?
It works fine on my Leopard and Snow Leopard (even though my Snow Leo runs
in 32 bit mode), but other people complain that the driver is not being
installed.
Maybe some instances of the system are missing any of the command line
utilities i used?
Could you suggest a better way of determining the bitness of the kernel?
Thanks for any advice!
___

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

Please do not post 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: Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Brad Stone
Quincey,

Thanks for relying.  It's good to have another developer to talk this thru with.

1) customer accessors for isEncrypted didn't work (I have a set exactly like 
category)
2) I'm using garbage collection
3) I tried [note isEncrypted] same error
4) i tried using a local ivar i..e Note *thisNote = [self note], no change

I've been trying these variations for days.


On Feb 22, 2011, at 12:44 PM, Quincey Morris wrote:

 On Feb 22, 2011, at 06:19, Brad Stone wrote:
 
 I've been trying for days to determine why I get EXC_BAD_ACCESS when I try 
 to access a managedObject property from within an accessor of another 
 property?
 
 this code in main.m
 [[self note] setValue:@HELLO WORLD forKey:@category];
 NSNumber *tmpVal = [NSNumber numberWithBool:![[[self note] 
 valueForKey:@isEncrypted] boolValue]]; // if I type po [self note] I see 
 the note description
 [[self note] setValue:tmpVal forKey:@isEncrypted]; // if I type po [self 
 note] after this I get EXEC_BAD_ACCESS
 
 The if statement in the accessor is causing the problem:
 - (NSString *)category {
 NSString * tmpValue;
 
   [self willAccessValueForKey:@category];
   tmpValue = [self primitiveCategory];
   [self didAccessValueForKey:@category];
  
   if ([[self valueForKey:@isEncrypted] boolValue]) {  // THIS IS CAUSING 
 THE PROBLEM
   // code to decrypt tmpValue
   }
  
   return tmpValue;
 }
 
 No answer, but a couple of points:
 
 -- What happens if you write 'note.isEncrypted' (or '[note isEncrypted]') 
 instead of '[note valueForKey: @isEncrypted]'?
 
 -- What happens if you code your own custom accessors for isEncrypted, like 
 you've done for category?
 
 -- EXC_BAD_ACCESS is often a symptom of a memory management problem. Is there 
 a problem with the object being returned by '[self note]'? You didn't show 
 code for where this is implemented. It's possible that you failed to retain 
 the object, or, if you're using garbage collection, returned an object with 
 no strong references, or perhaps you returned a zombie object.
 
 What happens in the above code if you set first a local variable to '[[self 
 note] retain]' and use the local variable in place of the other references to 
 '[self note]'?
 
 

___

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

Please do not post 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: Reliable way to determine bitness of the kernel

2011-02-22 Thread Wim Lewis

On 22 Feb 2011, at 10:09 AM, eveningnick eveningnick wrote:
 i have a kext (or, rather, 2 kexts - one built with -arch i386, another one
 with -arch x86_64). They should work on both OS X 10.5 and 10.6.
 i have an installing script, which looks like
 if [ `uname -a | grep x86_64 | wc -l` ge 1 ]; then
   cp -R 64bit.kext /Library/Extensions/
 else
   cp -R 32bit.kext /Library/Extensions/

I've never tried developing a kext, but is there a reason you can't lipo the 
two versions together to create a fat executable? Then the kernel will just 
automatically load the correct one.


___

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

Please do not post 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: Reliable way to determine bitness of the kernel

2011-02-22 Thread Dave Zarzycki
We support fat binaries. Please use them to avoid this problem entirely. You 
just need to reconfigure your kext project to build both architectures at the 
same. A simple example from the command line:

/tmp $ cat test.c
#include stdio.h

int
main(void)
{
printf(sizeof(void *) == %zu\n, sizeof(void *));
return 0;
}
/tmp $ gcc -arch i386 -arch x86_64 -Wall -Wextra -Werror -Os -o test test.c
/tmp $ file test
test: Mach-O universal binary with 2 architectures
test (for architecture i386):   Mach-O executable i386
test (for architecture x86_64): Mach-O 64-bit executable x86_64
/tmp $ ./test
sizeof(void *) == 8
/tmp $ arch -i386 ./test
sizeof(void *) == 4
/tmp $ 

You can use the file command against to verify that any binary is fat, just 
like the above.

davez


On Feb 22, 2011, at 10:09 AM, eveningnick eveningnick wrote:

 hello
 i have a kext (or, rather, 2 kexts - one built with -arch i386, another one
 with -arch x86_64). They should work on both OS X 10.5 and 10.6.
 i have an installing script, which looks like
 if [ `uname -a | grep x86_64 | wc -l` ge 1 ]; then
   cp -R 64bit.kext /Library/Extensions/
 else
   cp -R 32bit.kext /Library/Extensions/
 
 this goes into production code.
 But unfortunately, it seems like it does not work well on all systems.
 What caveats may this method of determining the bitness of the system have?
 It works fine on my Leopard and Snow Leopard (even though my Snow Leo runs
 in 32 bit mode), but other people complain that the driver is not being
 installed.
 Maybe some instances of the system are missing any of the command line
 utilities i used?
 Could you suggest a better way of determining the bitness of the kernel?
 Thanks for any advice!
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post 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/zarzycki%40apple.com
 
 This email sent to zarzy...@apple.com

___

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

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

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

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


Re: Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Quincey Morris
On Feb 22, 2011, at 10:10, Brad Stone wrote:

 2) I'm using garbage collection

Then my money's on a memory management error with the [self note] object. Can 
you show the code for [self note] and/or show the strong reference that keeps 
it alive?


___

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

Please do not post 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


iOS: Calling up numeric keypad

2011-02-22 Thread Jon Sigman
I have a UITextField that should accept only numerics. Is there a way to set 
the 
textfield so that when the user touches it, the numeric keypad comes up instead 
of the alpha keypad? iOS 4.2.1


  
___

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

Please do not post 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: Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Quincey Morris
On Feb 22, 2011, at 10:10, Brad Stone wrote:

 2) I'm using garbage collection

Also, it's worth checking that you really have garbage collection turned on. 
It's easy mistake to turn it on in the project build settings and not realize 
that the target settings turn it off. The symptoms you've been describing are 
exactly consistent with 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: Reliable way to determine bitness of the kernel

2011-02-22 Thread eveningnick eveningnick
thanks for detailed description of the solution
___

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

Please do not post 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: Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Felix Franz

On Feb 22, 2011, at 3:19 PM, Brad Stone wrote:

 I've been trying for days to determine why I get EXC_BAD_ACCESS when I try to 
 access a managedObject property from within an accessor of another property?

Could you post the stack trace? Just for debugging purposed: What happens if 
you define another method (not an CoreData-Property)
like:

- (NSString*) categoryPlain
{
 NSString* categoryEncryptedOrNot = self.category;
 if ([self.isEncrypted boolValue]) {
  // decrypt
  return decryptedCategory;
 } 
 return categoryEncryptedOrNot;
}   

and leave category as a @dynamic-property. Maybe CoreDate gets confused if 
you retrieve the value, but change 
it after your didAccessValueForKey:-message send

Cheers, 

Felix

 
 this code in main.m
 [[self note] setValue:@HELLO WORLD forKey:@category];
 NSNumber *tmpVal = [NSNumber numberWithBool:![[[self note] 
 valueForKey:@isEncrypted] boolValue]]; // if I type po [self note] I see 
 the note description
 [[self note] setValue:tmpVal forKey:@isEncrypted]; // if I type po [self 
 note] after this I get EXEC_BAD_ACCESS
 
 The if statement in the accessor is causing the problem:
 - (NSString *)category {
 NSString * tmpValue;
 
[self willAccessValueForKey:@category];
tmpValue = [self primitiveCategory];
[self didAccessValueForKey:@category];
   
if ([[self valueForKey:@isEncrypted] boolValue]) {  // THIS IS CAUSING 
 THE PROBLEM
// code to decrypt tmpValue
}
   
return tmpValue;
 }
 
 When I replace: if ([[self valueForKey:@isEncrypted] boolValue]) with if (1 
 == 2 ) or if (1 == 1 ) it works
 
 FYI: in my .h file @property (nonatomic, retain) NSNumber * isEncrypted; and 
 @dynamic isEncrypted; in .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/franz%40ergosign.de
 
 This email sent to fr...@ergosign.de

-- 
Mit freundlichen Grüßen,

Felix Franz

Lead Software Engineer

ERGOSIGN GmbH
Europa-Allee 12
66113 Saarbrücken
Phone: +49 681 98 84 12 14
Fax: +49 681 98 84 12 10
www.ergosign.de

HRB 11850
Amtsgericht Saarbrücken

Geschäftsführung:
Dr. Marcus Plach
Prof. Dr. Dieter Wallach

Sitz der Gesellschaft:
Saarbrücken







___

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

Please do not post 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: iOS: Calling up numeric keypad

2011-02-22 Thread Laurent Daudelin
I'm surprised nobody replied to this yet. Open the interface file in Interface 
Builder. Set the keyboard for that UITextField to use the numeric keyboard. 
Then, each time the user touches the textfield, the numeric keyboard will show 
up.

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

On Feb 22, 2011, at 10:42, Jon Sigman wrote:

 I have a UITextField that should accept only numerics. Is there a way to set 
 the 
 textfield so that when the user touches it, the numeric keypad comes up 
 instead 
 of the alpha keypad? iOS 4.2.1

___

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

Please do not post 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: Problem opening file

2011-02-22 Thread Carlos Eduardo Mello

On Feb 22, 2011, at 1:46 PM, Scott Ribe wrote:


On Feb 22, 2011, at 9:14 AM, Sherm Pendley wrote:


I imagine I have to deal
with application bundle api, but the thing is I can't add any  
cocoa code to

this library, as it needs remain cross-platform.


Does this library allow you to specify the full path to its config
file, instead of just its name, when you initialize the library? If
so, you could keep the platform-specific code outside of the library
itself.

Alternatively, you could use NSBundle methods to find the location of
your executable, then chdir() to that directory before initializing
the library.


Also, although I don't know that it really matters other than style  
 consistency, but next to the executable is not where such a file  
would normally be put in an app bundle. The Resources folder in  
the bundle is more appropriate--assuming here that you're building a  
regular bundled app and not just a command-line executable...


Thank you both.
 I put my file in Contents/Resources/  and passed the path to my  
internal library. Two lines did the trick:


NSString * nsPath = [ [NSBundle mainBundle]  pathForResource:@comp  
ofType:@slf];

string cppPath = [nsPath UTF8String];
___

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

Please do not post 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: iOS: Calling up numeric keypad

2011-02-22 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2/22/11 12:56 PM, Laurent Daudelin wrote:
 I'm surprised nobody replied to this yet. Open the interface file in
 Interface Builder. Set the keyboard for that UITextField to use the
 numeric keyboard. Then, each time the user touches the textfield, the
 numeric keyboard will show up.

Beat me to it... I was waiting to get back to IB to verify what the
setting was called. :-)

Also, in the event that you need to do this in code, you can set the
keyboardType property appropriately.

This property (and others) are defined in the UITextInputTraits
protocol, found in the header of the same name.

- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFNZCVfaOlrz5+0JdURAoXBAJ9Fhl7fGpT8pIg14k8+SzZoVH5d5wCdEXrs
zhTG6HsjNloUSq9ybExKlPg=
=mSiR
-END PGP 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: Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Quincey Morris
On Feb 22, 2011, at 12:21, Brad Stone wrote:

 I'm assuming since I can successfully change the string in category my 
 reference to [self note] is OK.

This is an absolutely false assumption. If, as I'm hypothesizing, [self note] 
is returning a zombie object (or it becomes a zombie object after the value is 
returned), there will be a timing window before undeath == death. During that 
window, the object may appear to function perfectly normally.

If you don't want this to take more days of debugging, you need to stop 
flailing, and *prove* that [self note] is alive. That could be difficult since 
the debugger seems to have proof that it's not. If you can prove [self note] is 
alive, then you need to look elsewhere -- the failing property reference may 
only be the place where the error becomes apparent, and may not itself have any 
role in the error.

So, again, how are you getting the value for [self note]? And what is its 
address? (Its 'p (void*)' value, not its 'po' value, if you want to think in 
GDB terms.) 0x7fff5f3ffd80 doesn't look like a typical 64-bit pointer 
address. (I have a vague recollection of a past thread about GC XORing 
something into dead pointer values, producing numbers like this, but I may be 
remembering something irrelevant.) Note also that 0x7fff843748d7 in 
_CFArrayReplaceValues () in the debugger output tends to suggest that [self 
note] is mucking about changing arrays.

And I agree with the earlier poster who suggested you get it to fail in code 
and then post a real backtrace.


___

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

Please do not post 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


Trouble retrieving selection from NSArrayController

2011-02-22 Thread Ayers, Joseph
I have an app that has a NSTableView populated with and array of Tapes  from 
CoreData. Tapes is declared as:
@interface Tapes :  NSManagedObject
{
NSString * TapeName;
NSDate   * TapeDate;
NSString * Notes;
NSSet* VideoClip;
}
The TableView is bound to an NSArrayController (tapesController). If I select a 
row in the table and execute

NSArray * tapeSelection = [tapesController selectedObjects];



Tapes *  theTape = [tapeSelection objectAtIndex:0];

the local variable
theTape = (Tapes*) 0x

How do I get a valid selection


Joseph Ayers, Professor
Department of Biology and
Marine Science Center
Northeastern University
East Point, Nahant, MA 01908
Phone (781) 581-7370 x309(office), x335(lab)
Boston: 444 Richards Hall (617) 373-4044
Cellular (617) 755-7523, FAX: (781) 581-6076
Google Voice: (781) 346-9589
eMail: lobs...@neu.edumailto:lobs...@neu.edu
iPhone: robopl...@gmail.commailto:robopl...@gmail.com
http://www.neurotechnology.neu.edu/
http://robobees.seas.harvard.edu/
http://cyberplasm.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: Trouble retrieving selection from NSArrayController

2011-02-22 Thread Mike Abdullah

On 22 Feb 2011, at 21:30, Ayers, Joseph wrote:

 I have an app that has a NSTableView populated with and array of Tapes  from 
 CoreData. Tapes is declared as:
 @interface Tapes :  NSManagedObject
 {
NSString * TapeName;
NSDate   * TapeDate;
NSString * Notes;
NSSet* VideoClip;
 }
 The TableView is bound to an NSArrayController (tapesController). If I select 
 a row in the table and execute
 
NSArray * tapeSelection = [tapesController selectedObjects];
 
 
 
Tapes *  theTape = [tapeSelection objectAtIndex:0];
 
 the local variable
 theTape = (Tapes*) 0x
 
 How do I get a valid selection

Logically, this must be because tapesController or tapeSelection is nil. I 
suspect the former.

___

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

Please do not post 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: Trouble retrieving selection from NSArrayController

2011-02-22 Thread Quincey Morris
On Feb 22, 2011, at 13:30, Ayers, Joseph wrote:

 @interface Tapes :  NSManagedObject
 {
NSString * TapeName;
NSDate   * TapeDate;
NSString * Notes;
NSSet* VideoClip;
 }

Incidentally, what are those instance variables doing in the managed object 
subclass? They seem *extremely* unlikely.


___

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

Please do not post 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: Trouble retrieving selection from NSArrayController

2011-02-22 Thread Ayers, Joseph
Here's the interface

I understood from Scott Stevensons book that in 32bit mode you had to declare 
the instance variables.

//
//  Tapes.h
//  Roboplasm
//
//  Created by Joseph Ayers on 10/11/10.
//  Copyright 2010 Northeastern University. All rights reserved.
//

#import CoreData/CoreData.h

#import VideoClip.h
//@class VideoClip;

@interface Tapes :  NSManagedObject  
{
NSString * TapeName;
NSDate   * TapeDate;
NSString * Notes;
NSSet* VideoClip;
}
//attributes
@property (nonatomic, retain) NSString * TapeName;
@property (nonatomic, retain) NSDate   * TapeDate;
@property (nonatomic, retain) NSString * Notes;
//relationships
@property (nonatomic, retain) NSSet* VideoClip;

@end


@interface Tapes (CoreDataGeneratedAccessors)
- (void)addTapesObject:(Tapes *)value;
- (void)removeTapesObject:(Tapes *)value;
- (void)addTapes:(NSSet *)value;
- (void)removeTapes:(NSSet *)value;

- (void)addVideoClipObject:(VideoClip *)value;
- (void)removeVideoClipObject:(VideoClip *)value;
- (void)addVideoClip:(NSSet *)value;
- (void)removeVideoClip:(NSSet *)value;

@end

On Feb 22, 2011, at 5:34 PM, Quincey Morris wrote:

 On Feb 22, 2011, at 13:30, Ayers, Joseph wrote:
 
 @interface Tapes :  NSManagedObject
 {
   NSString * TapeName;
   NSDate   * TapeDate;
   NSString * Notes;
   NSSet* VideoClip;
 }
 
 Incidentally, what are those instance variables doing in the managed object 
 subclass? They seem *extremely* unlikely.
 
 

___

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

Please do not post 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: iOS: Calling up numeric keypad

2011-02-22 Thread Jon Sigman
That's awesome. I never knew you could do that. Works great! Thanks Conrad and 
Laurent!





From: Conrad Shultz con...@synthetiqsolutions.com
To: Laurent Daudelin laur...@nemesys-soft.com
Cc: Jon Sigman rf_...@yahoo.com; cocoa-dev@lists.apple.com
Sent: Tue, February 22, 2011 1:06:40 PM
Subject: Re: iOS: Calling up numeric keypad

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2/22/11 12:56 PM, Laurent Daudelin wrote:
 I'm surprised nobody replied to this yet. Open the interface file in
 Interface Builder. Set the keyboard for that UITextField to use the
 numeric keyboard. Then, each time the user touches the textfield, the
 numeric keyboard will show up.

Beat me to it... I was waiting to get back to IB to verify what the
setting was called. :-)

Also, in the event that you need to do this in code, you can set the
keyboardType property appropriately.

This property (and others) are defined in the UITextInputTraits
protocol, found in the header of the same name.

- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFNZCVfaOlrz5+0JdURAoXBAJ9Fhl7fGpT8pIg14k8+SzZoVH5d5wCdEXrs
zhTG6HsjNloUSq9ybExKlPg=
=mSiR
-END PGP 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: Trouble retrieving selection from NSArrayController

2011-02-22 Thread Quincey Morris
On Feb 22, 2011, at 15:04, Ayers, Joseph wrote:

 I understood from Scott Stevensons book that in 32bit mode you had to declare 
 the instance variables.

Nope, not for Core Data (not unless you need instance variables *of your own* 
to implement custom properties or for some other reason). Core Data doesn't use 
instance variables internally at all (for your properties, I mean). See:


http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html%23//apple_ref/doc/uid/TP40002154-SW9

IMO, this documentation is slightly confusing. You can *EITHER* declare the 
properties for Core Data-supplied scalar accessor methods (TapeName, TapeDate, 
Notes, VideoClip) in a class extension -- Tapes () -- and use @dynamic for each 
one in your implementation *OR* declare them in a non-existent category -- 
Tapes (TapesAccessors), if you follow the documentation's pattern -- and avoid 
the need for @dynamic.

The documentation doesn't make it clear that there are 2 ways of doing it.

In the case of the add/remove accessors, you can't use @dynamic to tell the 
compiler about the Core Data-supplied methods, so you have to use the 
non-existent category technique.

With your current class definition, the instance variables will be ignored 
completely. They will be nil unless you put something in them manually, and if 
you do that they have no effect on the Core Data properties.


___

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

Please do not post 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


NSTextView truncating right side when printed...

2011-02-22 Thread Bruce Cresanta
Hello,

I'm trying to print an NSTextView of HTML code.The right side is truncated 
on the actual printout.Suggestions to correct this are appreciated.

Thanks,

Bruce
___

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

Please do not post 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: NSTextView truncating right side when printed...

2011-02-22 Thread Graham Cox

On 23/02/2011, at 11:24 AM, Bruce Cresanta wrote:

 I'm trying to print an NSTextView of HTML code.The right side is 
 truncated on the actual printout.Suggestions to correct this are 
 appreciated.


What do you want it to do to be 'correct'? What have you tried?

It's typical for HTML code to not be wrapped, so long lines run on until a 
newline is encountered. I believe text views arrange for there to be one column 
of n pages for a print layout by default, so what you're getting is exactly 
what I'd expect.

If you want it to word-wrap, set up the text view to word wrap.

If you want it to tile across a number columns to accommodate the text, change 
the print parameters to do that.

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


Re: NSTextView truncating right side when printed...

2011-02-22 Thread Bruce Cresanta
I've tried word wrap, but I haven't tried character wrap yet.I thought it 
might have to do with layout in IB, but that is false because of the underlying 
text system/pdf.I don't understand your comment about tiling.

Bruce
On Feb 22, 2011, at 4:44 PM, Graham Cox wrote:

 
 On 23/02/2011, at 11:24 AM, Bruce Cresanta wrote:
 
 I'm trying to print an NSTextView of HTML code.The right side is 
 truncated on the actual printout.Suggestions to correct this are 
 appreciated.
 
 
 What do you want it to do to be 'correct'? What have you tried?
 
 It's typical for HTML code to not be wrapped, so long lines run on until a 
 newline is encountered. I believe text views arrange for there to be one 
 column of n pages for a print layout by default, so what you're getting is 
 exactly what I'd expect.
 
 If you want it to word-wrap, set up the text view to word wrap.
 
 If you want it to tile across a number columns to accommodate the text, 
 change the print parameters to do that.
 
 --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


Re: Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Brad Stone
In my Note entity:
self = (Note *)0x20027bda0

In my .h file have this property defined: @property (nonatomic, retain) 
NSNumber * isFlagged; and this in .m @dynamic isFlagged; and no custom accessors

New code in my Note entity:
- (void)setIsEncrypted:(NSNumber *)value {
// see po #1 which I typed here

[self willChangeValueForKey:@isFlagged];  
[self setPrimitiveValue:value forKey:@isFlagged];
[self didChangeValueForKey:@isFlagged];

// see po #2 which I typed here

[self willChangeValueForKey:@isEncrypted];
[self setPrimitiveValue:value forKey:@isEncrypted];
[self didChangeValueForKey:@isEncrypted];

// see po #3 which I typed here

}

po #1
po self
Note uid:319649395851582
 category:None
 isFlagged:0
 isEncrypted:0

po #2
po self
Note uid:319649395851582
 category:None
 isFlagged:1
 isEncrypted:0

po #3
po self

Breakpoint 28, -[SRMainWindowController toggleLock:] (self=0x2000df5e0, 
_cmd=0x1000a9239, sender=0x2000df5e0) at SRMainWindowController.m:2897
2897[note setIsEncrypted:[NSNumber numberWithBool:YES]];
The program being debugged stopped while in a function called from GDB.
When the function (_NSPrintForDebugger) is done executing, GDB will silently
stop (instead of continuing to evaluate the expression containing
the function call).

Here's a backtrace right after po #3 before I'm out of setIsEncrypted
backtrace
#0  -[SRMainWindowController toggleLock:] (self=0x2000df5e0, _cmd=0x1000a9239, 
sender=0x2000df5e0) at SRMainWindowController.m:2897
#1  0x00010002dae9 in -[SRMainWindowController getEncryptionKey] 
(self=0x2000df5e0, _cmd=0x1000a7210) at SRMainWindowController.m:2948
#2  0x000198d2 in -[Note category] (self=0x20027bda0, 
_cmd=0x7fff85450184) at Note.m:257
#3  0x000189c8 in -[Note description] (self=0x20027bda0, 
_cmd=0x7fff83c821e8) at Note.m:56
#4  0x7fff868a386b in _NSPrintForDebugger ()
#5  function called from gdb
#6  -[Note setIsEncrypted:] (self=0x20027bda0, _cmd=0x1000a6eb8, 
value=0x7fff70886280) at Note.m:206
#7  0x00010002d5c9 in -[SRMainWindowController toggleLock:] 
(self=0x2000df5e0, _cmd=0x1000a9239, sender=0x2000867e0) at 
SRMainWindowController.m:2897
#8  0x7fff83b2afbf in -[NSToolbarButton sendAction:to:] ()
#9  0x7fff8379c135 in -[NSToolbarItemViewer mouseDown:] ()
#10 0x7fff8368934f in -[NSWindow sendEvent:] ()
#11 0x7fff835bea86 in -[NSApplication sendEvent:] ()
#12 0x7fff835554da in -[NSApplication run] ()
#13 0x7fff8354e1a8 in NSApplicationMain ()
#14 0x00016b60 in main (argc=1, argv=0x7fff5fbff628) at 
main.m:13___

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

Please do not post 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: Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Brad Stone
SCENARIO 1:

The thread is:
0 - [SRMainWindowController toggleLock:]  //self = (SRMainWindowController *) 
0x20009d440
1-[NSToolbarButton sendAction:to:]

- (IBAction)toggleLock:(id)sender {

NSError *fetchError = nil;
NSArray *fetchResults;
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];

NSEntityDescription *entity = [NSEntityDescription 
entityForName:@Note inManagedObjectContext:[self managedObjectContext]];
[fetchRequest setEntity:entity];
fetchResults = [[self managedObjectContext] 
executeFetchRequest:fetchRequest error:fetchError];

Note *note = nil;
if (fetchRequest != nil  [fetchResults count] == 1)  {
note = [fetchResults objectAtIndex:index];  //note = (Note 
*)0x20027bfe0
}


if (note) {
[note setIsEncrypted:[NSNumber numberWithBool:YES]];  // see below
}
}




When I jump into  note setIsEncrypted:[NSNumber numberWithBool:YES]]; in the 
Note managedObject

self = (Note *)0x20027bfe0  // same as above
value = (NSCFBoolean *) 0x7fff70886280

po self
Note uid:319649395851582
 category:None
 isEncrypted:0
 isFlagged:0
(gdb) 

- (void)setIsEncrypted:(NSNumber *)value {
[self willChangeValueForKey:@isEncrypted];
[self setPrimitiveValue:value forKey:@isEncrypted];
[self didChangeValueForKey:@isEncrypted];
// see backtrace
}

As soon as I po after the setPrimitive I get:

Breakpoint 26, -[SRMainWindowController toggleLock:] (self=0x20009d440, 
_cmd=0x1000a92b1, sender=0x20009d440) at SRMainWindowController.m:2891
2891if (fetchRequest != nil  [fetchResults count] == 1)  {
The program being debugged stopped while in a function called from GDB.
When the function (_NSPrintForDebugger) is done executing, GDB will silently
stop (instead of continuing to evaluate the expression containing
the function call).




#0  -[Note setIsEncrypted:] (self=0x2000b7600, _cmd=0x1000a6eb8, 
value=0x7fff70886280) at Note.m:206
#1  0x00010002d5c9 in -[SRMainWindowController toggleLock:] 
(self=0x200078f80, _cmd=0x1000a9239, sender=0x2000a0c20) at 
SRMainWindowController.m:2897
#2  0x7fff83b2afbf in -[NSToolbarButton sendAction:to:] ()
#3  0x7fff8379c135 in -[NSToolbarItemViewer mouseDown:] ()
#4  0x7fff8368934f in -[NSWindow sendEvent:] ()
#5  0x7fff835bea86 in -[NSApplication sendEvent:] ()
#6  0x7fff835554da in -[NSApplication run] ()
#7  0x7fff8354e1a8 in NSApplicationMain ()
#8  0x00016b60 in main (argc=1, argv=0x7fff5fbff628) at main.m:13




SCENARIO 2:
I created a second scenario as a test to try to shed more light.  Scenario 1 
and scenario 2 are **exactly** the same but I'm setting another NSNumber, 
isFlagged to YES in the setIsEncrypted accessor and it gets set correctly 
without an exception but isEncrypted still causes one.


In SRMainWindowController:
self = (SRMainWindowController *)0x2000df5e0
note = (Note *)0x20027bda0

 see earlier email for second 
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


CoreData migration opens ~ file by mistake

2011-02-22 Thread Jim Thomason
I'm finally trying to do my first CoreData migration using the new
style 10.5 built-in migration tools. I'd abandoned my ad-hoc Tiger one
a while back and finally needed to migrate.

I'm building on Snow Leopard, and bugs and glitches aside (such as the
workaround for migration for Leopard deployment built on Snow
Leopard), it's mostly working. But what it boils down to is when I
deploy it on Leopard, the migration is correctly performed, but then
the app insists upon re-opening the foo~.ext file (the backup with the
tilde) instead of the actual upgraded data file itself. The simple
solution is just to shut the doc w/o saving, then re-open it. All
problems solved when I do that, but I don't really want to ask my
users to do it.

It behaves just fine on Snow Leopard.

I found some old posts referencing the issue, such as:
http://lists.apple.com/archives/cocoa-dev/2009/Nov/msg01431.html

But no functional solutions. I tried implementing mmalc's custom
NSDocumentController subclass, but the issue persisted. So I dropped
it out and left just the standard modification to
configurePersistentStoreCoordinatorForURL: to turn on
forKey:NSMigratePersistentStoresAutomaticallyOption.

Sometimes the ~ pops up in the title bar, sometimes it doesn't. The
doc is never actually save-able.

Did anyone ever discover a viable solution?

-Jim
___

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

Please do not post 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: Accessing a managedObject property from within an accessor of another property

2011-02-22 Thread Quincey Morris
That's a lot of information you posted. :)

Unfortunately, *based on the posted information* there's nothing obviously 
wrong except that you've shot yourself in the foot using the debugger. Let's 
look, for example,  at what one of the backtraces is telling you. You triggered 
this by typing 'po self' in the debugger:

On Feb 22, 2011, at 19:34, Brad Stone wrote:

 Breakpoint 28, -[SRMainWindowController toggleLock:] (self=0x2000df5e0, 
 _cmd=0x1000a9239, sender=0x2000df5e0) at SRMainWindowController.m:2897
 2897  [note setIsEncrypted:[NSNumber numberWithBool:YES]];
 The program being debugged stopped while in a function called from GDB.
 When the function (_NSPrintForDebugger) is done executing, GDB will silently
 stop (instead of continuing to evaluate the expression containing
 the function call).

A function called from the debugger as a result of 'po self' failed. What 
function? It's not clear yet, but it *is* clear what failed -- that function 
directly or indirectly called 'toggleLock:' *again* -- the method you were in 
when you started all this debugging activity. Why did it stop? It hit the 
breakpoint that you put in that code.

This backtrace is enlightening, unlike the earlier ones, because it shows what 
the debugger was trying to do:

 Here's a backtrace right after po #3 before I'm out of setIsEncrypted
 backtrace
 #0  -[SRMainWindowController toggleLock:] (self=0x2000df5e0, 
 _cmd=0x1000a9239, sender=0x2000df5e0) at SRMainWindowController.m:2897
 #1  0x00010002dae9 in -[SRMainWindowController getEncryptionKey] 
 (self=0x2000df5e0, _cmd=0x1000a7210) at SRMainWindowController.m:2948
 #2  0x000198d2 in -[Note category] (self=0x20027bda0, 
 _cmd=0x7fff85450184) at Note.m:257
 #3  0x000189c8 in -[Note description] (self=0x20027bda0, 
 _cmd=0x7fff83c821e8) at Note.m:56

The debugger was trying to execute [note description], which is what it does to 
get a description to display as a result of 'po note'. Normally, the standard 
'description' in NSObject is called, which just prints the address of the 
object and its class. You, apparently have overridden 'description' in the Note 
class, and it apparently invokes 'category', which invokes 
'-[SRMainWindowController getEncryptionKey]', which invokes 'toggleLock:', 
which is why it hits the breakpoint again.

Note that (apparently) if isEncrypted is NO, then 'getEncryptionKey' isn't 
invoked, and so 'toggleLock' isn't invoked either. That's why setting 
isFlagged instead didn't crap out in the debugger.

Other than indicating an inappropriate design of your 'description' override, 
there's absolutely no indication of anything wrong here at all. It looks like 
you've been chasing a chimera. :)

Obviously I may be overlooking something, but step 1 is to fix your 
'description' method so that it doesn't cause Core Data fetches. 

 #4  0x7fff868a386b in _NSPrintForDebugger ()
 #5  function called from gdb
 #6  -[Note setIsEncrypted:] (self=0x20027bda0, _cmd=0x1000a6eb8, 
 value=0x7fff70886280) at Note.m:206
 #7  0x00010002d5c9 in -[SRMainWindowController toggleLock:] 
 (self=0x2000df5e0, _cmd=0x1000a9239, sender=0x2000867e0) at 
 SRMainWindowController.m:2897
 #8  0x7fff83b2afbf in -[NSToolbarButton sendAction:to:] ()
 #9  0x7fff8379c135 in -[NSToolbarItemViewer mouseDown:] ()
 #10 0x7fff8368934f in -[NSWindow sendEvent:] ()
 #11 0x7fff835bea86 in -[NSApplication sendEvent:] ()
 #12 0x7fff835554da in -[NSApplication run] ()
 #13 0x7fff8354e1a8 in NSApplicationMain ()
 #14 0x00016b60 in main (argc=1, argv=0x7fff5fbff628) at main.m:13

___

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

Please do not post 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


[Job Posting] Princeton Satellite Systems

2011-02-22 Thread Michael Paluszek
Princeton Satellite Systems is seeking a software engineer to help develop 
innovative applications on Mac OS X and on IOS. You'll work on a small team 
with experienced aerospace engineers to maintain and upgrade our existing 
applications and develop new software based on cutting-edge research and 
development. Our software development work centers on our VisualCommander

http://www.psatellite.com/vc/index.php 

product.

Our iPhone products include ChessNotePad and the soon to be released 
SpaceDefense game.

http://www.psatellite.com/iphone/iphone.php

Requirements:

- Strong working knowledge of Cocoa development and related technologies 
including Core Data
- Objective-C and C/C++ experience, especially in Mac OS X and UNIX environments
- OpenGL programming
- BS or equivalent in computer science
- Ability to self-motivate and work independently to accomplish tasks
- Excellent communication and interpersonal skills
- US citizen or permanent resident

Desirable:

- Strong mathematical background
- Java, WebLogic, Axis
- iPhone development experience
- Familiarity with MATLAB
- Experience managing small groups of software engineers

Princeton Satellite Systems has offices in Minneapolis, MN and Plainsboro, NJ. 
A remote location (working at home) is possible although not preferred. Please 
specify your location preference, or if you have none, when responding.

Princeton Satellite Systems, Inc. is an Equal Opportunity Employer, m/f/d/v. We 
offer a competitive compensation and benefits package including membership in a 
technical society, 401(k) and health/life/disability insurance. We pride 
ourselves on offering flexibility: employees are paid hourly and can work those 
hours at any time, although some should be during regular business hours. The 
nominal workweek is 40 hours and the minimum work week for health and 
disability benefits is 30 hours. Part-time may be an option for any job, please 
inquire if you are interested!

Email resumes to Michael Paluszek, m...@psatellite.com. 




Michael Paluszek
President
Princeton Satellite Systems
6 Market Street, Suite 926
Plainsboro, NJ 08536
Phone: 609 275-9606
Fax: 609 275-9609
m...@psatellite.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


A TableView Binding question

2011-02-22 Thread Motti Shneor
Hello everyone. 

I have a TableView, connected to an ArrayController, configured to work against 
a CoreData Entity -  the normal way, similar to what you find in the template 
bindings when you drag an Entity from the data-modelling tool into a View in 
Interface-Builder.

Let's say the Entity is the venerable Employees.

Now, I need one of the table-columns, to be bound NOT to a specific attribute 
of the entity (like firstName or salary) but rather to the entity (managed 
object) itself. 

Of course the Entity is not something presentable on the column --- but I 
specify (and write) a specific ValueTransformer object that should calculate 
the displayed content from the managed object.

For example -- Think of a ValueTransformer that given an Employee instance, 
applies some logic and presents either a full name (First name attached to last 
name) or a nickname if it exists, or ... whatever comes to mind. It needs 
access to the entity instance, and returns a simple NSString.

I can't get this to work --- because I don't know what to write in the binding 
of the TableColumn. It seems there is no way to say Just the entity within 
IB's window.

I select the table column.
I Bind to: ArrayController
I set the Controller key to: arrangedObjects
and now... I don't know what to write in the Model Key Path field.

I guessed and tried the following values, to no avail. I always get a binding 
error:

1. Leave the Model key path field blank 
2. self
3. @self
4. SELF
5. @SELF
6. @
7. @

I believe something is missing in the visual description in IB. when you bind 
against the arrangedObjects of the ArrayController, you actually indirectly 
specify that the array controller instantiates some Enumerator (Iterator) and 
the Model Key Path is applied to that enumerator. But what key-path do you ask 
from enumerator to bring back itself?.

I tried to google around, and to read the Bindings programing guide, and saw 
absolutely NOTHING about this. no specification or list of the available meta 
keys.

Here's a snapshot of similar situation:

I have tried to send this message to the list with a screenshot of my IB 
binding inspector window -- but it was rejected. So here it is again, without 
attachments this time.

Any hint will be greatly 
appreciated.___

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

Please do not post 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


System Configuration Framework Notifications

2011-02-22 Thread Roberto Mauro
I'm trying to receive notifications through System configuration framework when 
Location changes. 

I was able to get the current Set applied but I can't even grasp on 
notification subject even looking at some code posted by apple. Seems there are 
very few informations out there and the references are somewhat obscure (at 
least to me). System Configuration Programming Guide give an overlook on the 
framework without going too much in-depth.

Can someone please make me an example on how to set up notifications in 
SCPreferences?

Thank you

___

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

Please do not post 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


Spotcolors in Cocoa

2011-02-22 Thread Kristof Vanhaesebrouck
Hi all,

I'm working on an application which has to generate PDF's with spot colors.
I have been experimenting with Cocoa and NSColor but can't seem to find how to 
create a spot color in Cocoa.
Does anyone know how to do this?

Looking for Web-to-Print Solutions?
Visit our website :   http://www.vit2print.com


This e-mail, and any attachments thereto, is intended only for use by the 
addressee(s) named herein and may contain legally privileged and/or 
confidential information and/or information protected by intellectual property 
rights.
If you are not the intended recipient, please note that any review, 
dissemination, disclosure, alteration, printing, copying or transmission of 
this e-mail and/or any file transmitted with it, is strictly prohibited and may 
be unlawful.
If you have received this e-mail by mistake, please immediately notify the 
sender and permanently delete the original as well as any copy of any e-mail 
and any printout thereof.
We may monitor e-mail to and from our network.

NSS nv - Tieltstraat 167 -  8740 Pittem -  Belgium 

___

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

Please do not post 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: A TableView Binding question

2011-02-22 Thread Quincey Morris
On Feb 21, 2011, at 23:58, Motti Shneor wrote:

 I can't get this to work --- because I don't know what to write in the 
 binding of the TableColumn. It seems there is no way to say Just the entity 
 within IB's window.
 
 I select the table column.
 I Bind to: ArrayController
 I set the Controller key to: arrangedObjects
 and now... I don't know what to write in the Model Key Path field.
 
 I guessed and tried the following values, to no avail. I always get a binding 
 error:
 
 1. Leave the Model key path field blank 
 2. self
 3. @self
 4. SELF
 5. @SELF
 6. @
 7. @

The correct answer is #2: self. What's the binding error when you use that? 
Are you talking about an error in IB or a runtime error?

 I believe something is missing in the visual description in IB. when you bind 
 against the arrangedObjects of the ArrayController, you actually indirectly 
 specify that the array controller instantiates some Enumerator (Iterator) and 
 the Model Key Path is applied to that enumerator. But what key-path do you 
 ask from enumerator to bring back itself?.

It is a little funky, because IB shows the binding textually as 
ArrayController.arrangedObjects.x.y.x, but there's no actual key path like 
that. (An array property is illegal in the middle of a key path.) Instead, 
there are two key paths -- ArrayController.arrangedObjects and x.y.z -- and 
it's the internal implementation of the Table Column value binding that 
bridges between the array represented by the first path and the specific array 
element needed by the second.


___

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

Please do not post 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


Looking for help scanning entire drives

2011-02-22 Thread Laurent Daudelin
I need to write an application that will scan entire drives and compare files 
between the 2 drives. I have already something working but in situations where 
there are a lot of files (hundreds of thousands), the memory consumption 
becomes a problem, leading to slow performance when virtual memory is used and, 
ultimately, sometimes to crashes in malloc.

Of course, I could go with little chunks, comparing, but I need to present a 
window showing which copies of files are more recent on one drive and which 
ones are more recent on the other drive, so I need to keep a list of all the 
files on one drive that are more recent than their counterparts on the other 
drive, and vice versa. This preferably would have to be done in Cocoa, since I 
already have a working solution.

Knowing that I have to support 10.5 but run under 10.6, what would be the best 
way to have a crack at this problem?

All suggestions are welcome!

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

___

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

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

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

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


Re: A TableView Binding question

2011-02-22 Thread Kyle Sluder
On Mon, Feb 21, 2011 at 11:58 PM, Motti Shneor
mo...@spectrum-reflections.com wrote:
 Now, I need one of the table-columns, to be bound NOT to a specific attribute 
 of the entity (like firstName or salary) but rather to the entity (managed 
 object) itself.

 Of course the Entity is not something presentable on the column --- but I 
 specify (and write) a specific ValueTransformer object that should calculate 
 the displayed content from the managed object.

I must ask what circumstance requires you to bind a column directly to
the managed objects. Nobody should be querying the table view about
its objects; they should be asking the controller instead. You can use
a custom NSManagedObject subclass to provide a property whose value
can be rendered in the table view.

I'm not claiming you are taking the wrong approach, but I would like
to consider the possibility of doing it the other way.

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