From Aya at animes.de Tue Jan 1 13:53:48 2008 From: Aya at animes.de (Aya Koshigaya) Date: Tue Jan 1 13:54:01 2008 Subject: How to check if an File/Directory Exists? Message-ID: <5DA2090E-7B62-4FBC-9E23-6FB5970595E7@animes.de> Hi, I need to check if an File or Directory exists, but without the use of Cocoa or ObjC.. I need it in plain C.. is there a way to do this? :) And, I need a way to create a directory.. also in plain C. Does anyone have an idea? Aya PS: I need it in plain C, cause I have to use GCC 3.3.. and it seems like GCC3.3 can't compile ObjC.. I got many errors in the Cocoa.h :/ From sherm.pendley at gmail.com Tue Jan 1 14:25:06 2008 From: sherm.pendley at gmail.com (Sherm Pendley) Date: Tue Jan 1 14:25:20 2008 Subject: How to check if an File/Directory Exists? In-Reply-To: <5DA2090E-7B62-4FBC-9E23-6FB5970595E7@animes.de> References: <5DA2090E-7B62-4FBC-9E23-6FB5970595E7@animes.de> Message-ID: On Jan 1, 2008 4:53 PM, Aya Koshigaya wrote: > > I need to check if an File or Directory exists, but without the use of > Cocoa or ObjC.. I need it in plain C.. is there a way to do this? :) stat(). See "man 2 stat" And, I need a way to create a directory.. also in plain C. mkdir(). See "man 2 mkdir" > PS: I need it in plain C, cause I have to use GCC 3.3.. and it seems > like GCC3.3 can't compile ObjC.. I got many errors in the Cocoa.h :/ That's just plain wrong - GCC 3.3 is perfectly happy with Objective-C. Post the errors you're seeing, and someone will probably be able to tell you what the problem *really* is. sherm-- From Aya at animes.de Tue Jan 1 14:49:06 2008 From: Aya at animes.de (Aya Koshigaya) Date: Tue Jan 1 14:49:14 2008 Subject: How to check if an File/Directory Exists? In-Reply-To: References: <5DA2090E-7B62-4FBC-9E23-6FB5970595E7@animes.de> Message-ID: <1451B6C5-314A-4866-95EE-3A0D4C2CBF82@animes.de> Thanks, here are the errors I get when compiling with GCC 3.3 (only the first three): /usr/include/objc/objc-auto.h:72: error: declaration of C function `objc_object* objc_assign_ivar(objc_object*, objc_object*, int)' conflicts with /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:62: error: parse error before `__attribute__' /System/Library/Frameworks/Foundation.framework/Headers/ NSPointerFunctions.h:59: error: parse error before `@' token On Jan 1, 2008, at 23:25, Sherm Pendley wrote: > On Jan 1, 2008 4:53 PM, Aya Koshigaya wrote: > > I need to check if an File or Directory exists, but without the use of > Cocoa or ObjC.. I need it in plain C.. is there a way to do this? :) > > stat(). See "man 2 stat" > > And, I need a way to create a directory.. also in plain C. > > mkdir(). See "man 2 mkdir" > > PS: I need it in plain C, cause I have to use GCC 3.3.. and it seems > like GCC3.3 can't compile ObjC.. I got many errors in the Cocoa.h :/ > > That's just plain wrong - GCC 3.3 is perfectly happy with Objective- > C. Post the errors you're seeing, and someone will probably be able > to tell you what the problem *really* is. > > sherm-- > From dunham at mac.com Tue Jan 1 15:00:40 2008 From: dunham at mac.com (David Dunham) Date: Tue Jan 1 15:00:45 2008 Subject: How to check if an File/Directory Exists? In-Reply-To: <1451B6C5-314A-4866-95EE-3A0D4C2CBF82@animes.de> References: <5DA2090E-7B62-4FBC-9E23-6FB5970595E7@animes.de> <1451B6C5-314A-4866-95EE-3A0D4C2CBF82@animes.de> Message-ID: On 1 Jan 2008, at 14:49, Aya Koshigaya wrote: > /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h: > 62: error: parse error before `__attribute__' > > /System/Library/Frameworks/Foundation.framework/Headers/ > NSPointerFunctions.h:59: error: parse error before `@' token I wonder if you're trying to include a Cocoa header file in a C or C++ source code file? I've been recently doing some with in Objective-C++, and you can't do that. But you can rename your source to end in .m or .mm and you should be fine. David Dunham A Sharp, LLC Voice/Fax: 206 783 7404 http://a-sharp.com Efficiency is intelligent laziness. From Aya at animes.de Tue Jan 1 15:02:52 2008 From: Aya at animes.de (Aya Koshigaya) Date: Tue Jan 1 15:03:02 2008 Subject: How to check if an File/Directory Exists? In-Reply-To: References: <5DA2090E-7B62-4FBC-9E23-6FB5970595E7@animes.de> <1451B6C5-314A-4866-95EE-3A0D4C2CBF82@animes.de> Message-ID: Hi, the file is allready an *.mm file.. :) Aya On Jan 2, 2008, at 00:00, David Dunham wrote: > On 1 Jan 2008, at 14:49, Aya Koshigaya wrote: > >> /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h: >> 62: error: parse error before `__attribute__' >> >> /System/Library/Frameworks/Foundation.framework/Headers/ >> NSPointerFunctions.h:59: error: parse error before `@' token > > > I wonder if you're trying to include a Cocoa header file in a C or C+ > + source code file? I've been recently doing some with in Objective-C > ++, and you can't do that. But you can rename your source to end > in .m or .mm and you should be fine. > > David Dunham A Sharp, LLC > Voice/Fax: 206 783 7404 http://a-sharp.com > Efficiency is intelligent laziness. > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From sherm.pendley at gmail.com Tue Jan 1 15:20:56 2008 From: sherm.pendley at gmail.com (Sherm Pendley) Date: Tue Jan 1 15:21:09 2008 Subject: How to check if an File/Directory Exists? In-Reply-To: <1451B6C5-314A-4866-95EE-3A0D4C2CBF82@animes.de> References: <5DA2090E-7B62-4FBC-9E23-6FB5970595E7@animes.de> <1451B6C5-314A-4866-95EE-3A0D4C2CBF82@animes.de> Message-ID: On Jan 1, 2008 5:49 PM, Aya Koshigaya wrote: > Thanks, > > here are the errors I get when compiling with GCC 3.3 (only the first > three): > > /usr/include/objc/objc-auto.h:72: error: declaration of C function > `objc_object* objc_assign_ivar(objc_object*, objc_object*, int)' > conflicts with > > /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:62: > error: parse error before `__attribute__' You're trying to use the old compiler with a recent (10.4u or 10.5) SDK. If you want to compile for 10.4 or 10.5, use GCC 4. If you want to use GCC 3.3, use the 10.3.9 SDK. sherm-- From sherm.pendley at gmail.com Tue Jan 1 15:28:51 2008 From: sherm.pendley at gmail.com (Sherm Pendley) Date: Tue Jan 1 15:29:00 2008 Subject: How to check if an File/Directory Exists? In-Reply-To: References: <5DA2090E-7B62-4FBC-9E23-6FB5970595E7@animes.de> <1451B6C5-314A-4866-95EE-3A0D4C2CBF82@animes.de> Message-ID: On Jan 1, 2008 6:02 PM, Aya Koshigaya wrote: > Hi, > > the file is allready an *.mm file.. :) GCC 3.3 is only required if your C++ or Objective-C++ app must run on 10.3.8or older OS releases. Apps built with GCC 4 will work with 10.3.9 or newer. How many people are still running Jaguar, or Panther without Software Update? I'm guessing we could count them without overflowing a signed char. sherm-- From Aya at animes.de Tue Jan 1 15:30:44 2008 From: Aya at animes.de (Aya Koshigaya) Date: Tue Jan 1 15:30:51 2008 Subject: How to check if an File/Directory Exists? In-Reply-To: References: <5DA2090E-7B62-4FBC-9E23-6FB5970595E7@animes.de> <1451B6C5-314A-4866-95EE-3A0D4C2CBF82@animes.de> Message-ID: <139DB646-3E28-4661-8156-5FF3CD796BE3@animes.de> Ahh, ok thanks :) I now encountered a new problem.. (hopefully the last one) I tried to compile a plugin on my Intel-Mac for an old PPC-Mac.. when I load the plugin, I get this error message: PID: 2502 Thread: Unknown Link (dyld) error: Symbol not found: _fcntl$UNIX2003 Referenced from: /Users/Shared/Alias/maya/plug-ins/test.lib Expected in: /usr/lib/libSystem.B.dylib What can I do here? :/ Aya On Jan 2, 2008, at 00:20, Sherm Pendley wrote: > On Jan 1, 2008 5:49 PM, Aya Koshigaya wrote: > Thanks, > > here are the errors I get when compiling with GCC 3.3 (only the first > three): > > /usr/include/objc/objc-auto.h:72: error: declaration of C function > `objc_object* objc_assign_ivar(objc_object*, objc_object*, int)' > conflicts with > > /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:62: > error: parse error before `__attribute__' > > You're trying to use the old compiler with a recent ( 10.4u or 10.5) > SDK. If you want to compile for 10.4 or 10.5, use GCC 4. If you want > to use GCC 3.3, use the 10.3.9 SDK. > > sherm-- > From sherm.pendley at gmail.com Tue Jan 1 22:00:06 2008 From: sherm.pendley at gmail.com (Sherm Pendley) Date: Tue Jan 1 22:00:14 2008 Subject: How to check if an File/Directory Exists? In-Reply-To: <139DB646-3E28-4661-8156-5FF3CD796BE3@animes.de> References: <5DA2090E-7B62-4FBC-9E23-6FB5970595E7@animes.de> <1451B6C5-314A-4866-95EE-3A0D4C2CBF82@animes.de> <139DB646-3E28-4661-8156-5FF3CD796BE3@animes.de> Message-ID: On Jan 1, 2008 6:30 PM, Aya Koshigaya wrote: > Ahh, ok thanks :) > > I now encountered a new problem.. (hopefully the last one) > I tried to compile a plugin on my Intel-Mac for an old PPC-Mac.. when > I load the plugin, I get this error message: > > PID: 2502 > Thread: Unknown > > Link (dyld) error: > > Symbol not found: _fcntl$UNIX2003 > Referenced from: /Users/Shared/Alias/maya/plug-ins/test.lib > Expected in: /usr/lib/libSystem.B.dylib > > What can I do here? :/ What version of Maya are you using? The Autodesk site says that the latest version - 2008 Complete - requires 10.4.8, and there's a plugin project template herethat uses Xcode 2.2 and GCC 4 to build plugins for 8.5. I don't have a copy of Maya to test - it's out of my price range - but what I would do is make sure to use GCC 4 and the 10.4u SDK. You might also want to download the template project above, see if it builds and runs a "hello world" plugin cleanly, and if it does check its compiler & SDK versions against those of your own project. sherm-- From fabianschuiki at bluewin.ch Thu Jan 3 15:23:49 2008 From: fabianschuiki at bluewin.ch (Fabian Schuiki) Date: Thu Jan 3 15:23:53 2008 Subject: malloc: *** error for object: incorrect checksum for freed object Message-ID: <87A52632-31A9-47E6-AA46-65B74806D03C@bluewin.ch> Hi everyone! I'm not that experienced with C++, but in most cases, my code works as intended. Now I've encountered the following error: "malloc: *** error for object 0x129d90: incorrect checksum for freed object - object was probably modified after being freed" This happens in this code segment (at least I tracked down the error to this segment): //Remove all whitespaces std::string str = input; std::string sub = " "; std::string rep = ""; std::string::size_type pos = str.find(sub, 0); int len = sub.length(); while (std::string::npos != pos) { str.replace(pos, len, rep); pos = str.find(sub, pos); } It seems to be the line str.replace(pos, len, rep); that causes the problem ? if I comment it out, the error message disappears. If I set a breakpoint in "malloc_error_break" as the error suggests, the debugger breaks somewhere in NSApplicationMain: #0 0x91280060 in malloc_error_break #1 0x9127acc8 in szone_error #2 0x91173078 in tiny_free_list_add_ptr #3 0x9116fc20 in szone_free #4 0x90046a5c in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::destroy_node #5 0x90046af4 in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_erase #6 0x90046ae4 in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_erase #7 0x90046bcc in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::~_Rb_tree #8 0x9117c2ac in __cxa_finalize #9 0x9117c188 in exit #10 0x936569d8 in NSApplicationMain #11 0x00002784 in main at main.mm:14 After this code segment which is supposed to remove all whitespaces in the string "input", there are several substrings taken from the string "str" and are then filled into a std::map. There are actually 4 key-value-pairs in the final std::map. The stack trace also lists 4 entries that seem to be related to std::pair ? maybe this is a clue. Does anyone know what the solution could be for this problem? Thanks in advance, Happy New Year, Fabian Fabian Schuiki fabianschuiki@bluewin.ch From fabianschuiki at bluewin.ch Thu Jan 3 16:04:01 2008 From: fabianschuiki at bluewin.ch (Fabian Schuiki) Date: Thu Jan 3 16:04:07 2008 Subject: malloc: *** error for object: incorrect checksum for freed object In-Reply-To: <87A52632-31A9-47E6-AA46-65B74806D03C@bluewin.ch> References: <87A52632-31A9-47E6-AA46-65B74806D03C@bluewin.ch> Message-ID: <4ABF9EAA-D62B-47CF-89A0-67D1DD889276@bluewin.ch> Solved the problem... Variable not initialized. Best, Fabian Fabian Schuiki fabianschuiki@bluewin.ch Am 04.01.2008 um 00:23 schrieb Fabian Schuiki: > Hi everyone! > > I'm not that experienced with C++, but in most cases, my code works > as intended. > Now I've encountered the following error: > > "malloc: *** error for object 0x129d90: incorrect checksum for freed > object - object was probably modified after being freed" > > This happens in this code segment (at least I tracked down the error > to this segment): > > //Remove all whitespaces > std::string str = input; > std::string sub = " "; > std::string rep = ""; > std::string::size_type pos = str.find(sub, 0); > int len = sub.length(); > while (std::string::npos != pos) > { > str.replace(pos, len, rep); > pos = str.find(sub, pos); > } > > It seems to be the line > > str.replace(pos, len, rep); > > that causes the problem ? if I comment it out, the error message > disappears. > If I set a breakpoint in "malloc_error_break" as the error suggests, > the debugger breaks somewhere in NSApplicationMain: > > #0 0x91280060 in malloc_error_break > #1 0x9127acc8 in szone_error > #2 0x91173078 in tiny_free_list_add_ptr > #3 0x9116fc20 in szone_free > > #4 0x90046a5c in std::_Rb_tree const, NotificationInformationStruct*>, > std::_Select1st NotificationInformationStruct*> >, std::less, > std::allocator NotificationInformationStruct*> > >::destroy_node > > #5 0x90046af4 in std::_Rb_tree const, NotificationInformationStruct*>, > std::_Select1st NotificationInformationStruct*> >, std::less, > std::allocator NotificationInformationStruct*> > >::_M_erase > > #6 0x90046ae4 in std::_Rb_tree const, NotificationInformationStruct*>, > std::_Select1st NotificationInformationStruct*> >, std::less, > std::allocator NotificationInformationStruct*> > >::_M_erase > > #7 0x90046bcc in std::_Rb_tree const, NotificationInformationStruct*>, > std::_Select1st NotificationInformationStruct*> >, std::less, > std::allocator NotificationInformationStruct*> > >::~_Rb_tree > > #8 0x9117c2ac in __cxa_finalize > #9 0x9117c188 in exit > #10 0x936569d8 in NSApplicationMain > #11 0x00002784 in main at main.mm:14 > > > After this code segment which is supposed to remove all whitespaces > in the string "input", there are several substrings taken from the > string "str" and are then filled into a std::map. > There are actually 4 key-value-pairs in the final std::map. The > stack trace also lists 4 entries that seem to be related to > std::pair ? maybe this is a clue. > > > Does anyone know what the solution could be for this problem? > > Thanks in advance, > Happy New Year, > Fabian > > > Fabian Schuiki > fabianschuiki@bluewin.ch > > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From peciva at pharos.co.nz Thu Jan 3 18:12:43 2008 From: peciva at pharos.co.nz (Tobias Peciva) Date: Thu Jan 3 18:19:55 2008 Subject: NSSocketPortNameServer Message-ID: Hey List, We're seeing some interesting NSSocketPortNameServer behavior in 10.5 - so wondering if anyone else has come across this. There are two issues... First, customers report that on some machines, the following call fails (i.e. returns NO): [[NSSocketPortNameServer sharedInstance] registerPort:port name:@"unique.name.goes.here"] According to the dox, this would only happen if another port is registered with the same name - but this does not appear to be the case, because calling portForName: yields nothing, and removePortForName: also fails. I have also confirmed that the port passed in is non-nil and valid. Interestingly enough, the problem only started appearing on Intel iMacs after one of the software updates in mid-December. Everything works fine on PowerPC Macs and non-iMac Intel machines. Second, I may have misunderstood how NSSocketPortNameServer works, but I created two test applications that create one socket port each (different port numbers, obviously), then attempt to register these ports with the same name. The NSPortNameServer dox suggest that the second app should fail to register its port, because another port has already been registered with the same name. But in actual fact, both ports are successfully registered with the same name. So, bugs or features? What am I missing? Any ideas? Thanks muchly! Peace, Tobias -- Tobias Peciva Team Leader / Software Architect Pharos Systems - http://www.pharos.com/ From edenwaith at mac.com Sat Jan 5 15:14:10 2008 From: edenwaith at mac.com (Chad Armstrong) Date: Sat Jan 5 15:14:13 2008 Subject: Localizing variants of English In-Reply-To: <20080104200005.8E757AB6F3@forums.omnigroup.com> References: <20080104200005.8E757AB6F3@forums.omnigroup.com> Message-ID: Hello: I've looked around, but haven't dug up anything regarding my question. I know how to localize a Cocoa application for various languages (English, Dutch, German, etc.). But is there a way to create different dialects of a language? Such as, is there a way to localize (or localise) an application so it is aware of say U.S. English versus British English? I imagine something similar might even pertain to other variants, such as Swiss German, versus High German, or Western Spanish versus European Spanish, etc. Regards, Chad From cmhofman at gmail.com Sat Jan 5 15:17:55 2008 From: cmhofman at gmail.com (Christiaan Hofman) Date: Sat Jan 5 15:18:03 2008 Subject: Localizing variants of English In-Reply-To: References: <20080104200005.8E757AB6F3@forums.omnigroup.com> Message-ID: <4B266F40-0A79-46A3-BDC6-00766961C8E7@gmail.com> Yes. There are language codes also for dialects, e.g. en-gb is British English. Christiaan On 6 Jan 2008, at 12:14 AM, Chad Armstrong wrote: > Hello: > > I've looked around, but haven't dug up anything regarding my question. > > I know how to localize a Cocoa application for various languages > (English, Dutch, German, etc.). But is there a way to create > different dialects of a language? Such as, is there a way to > localize (or localise) an application so it is aware of say U.S. > English versus British English? > > I imagine something similar might even pertain to other variants, > such as Swiss German, versus High German, or Western Spanish versus > European Spanish, etc. > > Regards, > > Chad > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From fabianschuiki at bluewin.ch Sat Jan 5 15:21:03 2008 From: fabianschuiki at bluewin.ch (Fabian Schuiki) Date: Sat Jan 5 15:21:10 2008 Subject: Localizing variants of English In-Reply-To: <4B266F40-0A79-46A3-BDC6-00766961C8E7@gmail.com> References: <20080104200005.8E757AB6F3@forums.omnigroup.com> <4B266F40-0A79-46A3-BDC6-00766961C8E7@gmail.com> Message-ID: Wouldn't make much sense for Swiss German since it's not a full language as such, many components of a "full language" like High German or English are missing (i.e. there are only 2 tenses for verbs, present and present perfect). But for other languages this actually would/could make sense? Best Fabian PS.: I am Swiss ;-) Fabian Schuiki fabianschuiki@bluewin.ch Am 06.01.2008 um 00:17 schrieb Christiaan Hofman: > Yes. There are language codes also for dialects, e.g. en-gb is > British English. > > Christiaan > > On 6 Jan 2008, at 12:14 AM, Chad Armstrong wrote: > >> Hello: >> >> I've looked around, but haven't dug up anything regarding my >> question. >> >> I know how to localize a Cocoa application for various languages >> (English, Dutch, German, etc.). But is there a way to create >> different dialects of a language? Such as, is there a way to >> localize (or localise) an application so it is aware of say U.S. >> English versus British English? >> >> I imagine something similar might even pertain to other variants, >> such as Swiss German, versus High German, or Western Spanish versus >> European Spanish, etc. >> >> Regards, >> >> Chad >> _______________________________________________ >> MacOSX-dev mailing list >> MacOSX-dev@omnigroup.com >> http://www.omnigroup.com/mailman/listinfo/macosx-dev > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From j.p.dann at gmail.com Sat Jan 5 17:41:11 2008 From: j.p.dann at gmail.com (Jonathan) Date: Sat Jan 5 17:41:32 2008 Subject: Leopard Properties and NSMutable Array Message-ID: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> Hi All, This is my first post so I hop I'm doing this right! I'm working on a Leopard app and have started to use properties. In one of my classes I have an NSMutableArray which I have declared in my @interface as: @property(copy) NSMutableArray *content; the ivar is then @synthesized in my @implentation. in my -init method I do: self. content = [[NSMutableArray alloc] init]; [self. content addObject:[NSString string]; But I get the an error that tells me that I'm trying to mutate an immutable collection. Why is this, is the setter calling a -copy method which returns an immutable copy? If so, why have this behaviour? Which argument to the @property directive would give the same as - (void)setContent:(NSArray *)newArray; { if(content != newArray) { [content release]; content = [[NSMutableArray alloc] initWithArray:newArray]; } } Thanks! From bbum at mac.com Sat Jan 5 17:53:59 2008 From: bbum at mac.com (Bill Bumgarner) Date: Sat Jan 5 17:54:16 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> Message-ID: On Jan 5, 2008, at 5:41 PM, Jonathan wrote: > self. content = [[NSMutableArray alloc] init]; > [self. content addObject:[NSString string]; > > But I get the an error that tells me that I'm trying to mutate an > immutable collection. Why is this, is the setter calling a -copy > method which returns an immutable copy? If so, why have this > behaviour? That is because the synthesized method sends -copy to the mutable array, yielding an immutable array. > Which argument to the @property directive would give the same as > > - (void)setContent:(NSArray *)newArray; > { > if(content != newArray) { > [content release]; > content = [[NSMutableArray alloc] initWithArray:newArray]; > } > } Which, unfortunately, is the alternative. There is an enhancement request already to offer a mutablecopy keyword. b.bum From j.p.dann at gmail.com Sat Jan 5 18:13:01 2008 From: j.p.dann at gmail.com (Jonathan Dann) Date: Sat Jan 5 18:13:38 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> Message-ID: Thanks alot! Thought my inexperience was rearing its ugly head. Much appreciated On 6 Jan 2008, at 01:53, Bill Bumgarner wrote: > On Jan 5, 2008, at 5:41 PM, Jonathan wrote: >> self. content = [[NSMutableArray alloc] init]; >> [self. content addObject:[NSString string]; >> >> But I get the an error that tells me that I'm trying to mutate an >> immutable collection. Why is this, is the setter calling a -copy >> method which returns an immutable copy? If so, why have this >> behaviour? > > That is because the synthesized method sends -copy to the mutable > array, yielding an immutable array. > >> Which argument to the @property directive would give the same as >> >> - (void)setContent:(NSArray *)newArray; >> { >> if(content != newArray) { >> [content release]; >> content = [[NSMutableArray alloc] initWithArray:newArray]; >> } >> } > > Which, unfortunately, is the alternative. There is an enhancement > request already to offer a mutablecopy keyword. > > b.bum From bbum at mac.com Sat Jan 5 18:16:50 2008 From: bbum at mac.com (Bill Bumgarner) Date: Sat Jan 5 18:17:07 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> Message-ID: On Jan 5, 2008, at 5:53 PM, Bill Bumgarner wrote: >> >> Which argument to the @property directive would give the same as >> >> - (void)setContent:(NSArray *)newArray; >> { >> if(content != newArray) { >> [content release]; >> content = [[NSMutableArray alloc] initWithArray:newArray]; >> } >> } > > Which, unfortunately, is the alternative. There is an enhancement > request already to offer a mutablecopy keyword. I should add, though, that the above is not really atomic (and, of course, "atomic" is not thread safe -- merely non-crashy in the face of the threads). (One of the advantages of GC is that simple setters like the above become atomic in that assignments are atomic for object types.) b.bum From ozone at algorithm.com.au Sat Jan 5 19:10:18 2008 From: ozone at algorithm.com.au (=?ISO-8859-1?Q?Andr=E9_Pang?=) Date: Sat Jan 5 19:29:27 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> Message-ID: <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> On 06/01/2008, at 12:53 PM, Bill Bumgarner wrote: > Which, unfortunately, is the alternative. There is an enhancement > request already to offer a mutablecopy keyword. Is there actually a use for a 'mutablecopy' keyword? I ran into the same problem as Jonathan, but then realised that retain semantics are typically what you want for a mutable object. I can't quite think of a case where a mutable copy of the array in the class would actually be useful. (Maybe that thought can be used as a possible warning: if you define a property for a type that obeys the NSMutableCopying protocol, perhaps a warning can be emitted if you use copy rather than retain...) -- % Andre Pang : trust.in.love.to.save From bbum at mac.com Sat Jan 5 19:43:58 2008 From: bbum at mac.com (Bill Bumgarner) Date: Sat Jan 5 19:44:18 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> Message-ID: On Jan 5, 2008, at 7:10 PM, Andr? Pang wrote: > On 06/01/2008, at 12:53 PM, Bill Bumgarner wrote: >> Which, unfortunately, is the alternative. There is an enhancement >> request already to offer a mutablecopy keyword. > Is there actually a use for a 'mutablecopy' keyword? I ran into the > same problem as Jonathan, but then realised that retain semantics > are typically what you want for a mutable object. I can't quite > think of a case where a mutable copy of the array in the class would > actually be useful. > > (Maybe that thought can be used as a possible warning: if you define > a property for a type that obeys the NSMutableCopying protocol, > perhaps a warning can be emitted if you use copy rather than > retain...) There are uses for mutablecopy in that there has been more than one person that has filed a request for it. :) Seriously, though, there are cases where mutablecopy makes a lot of sense. Specifically, if your object model is such that your object wants to take ownership of the contents of the array and changes therein. It is much easier to guarantee that a mutable array's contents haven't changed if you have isolated ownership of said mutable array; copying on set and returning a copy on get. Of course, that has efficiency / performance / memory implications and, thus, balance must be maintained between performance and bullet proof. b.bum From sstevenson at mac.com Sat Jan 5 19:49:26 2008 From: sstevenson at mac.com (Scott Stevenson) Date: Sat Jan 5 19:49:31 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> Message-ID: On Jan 5, 2008, at 7:10 PM, Andr? Pang wrote: > Is there actually a use for a 'mutablecopy' keyword? I ran into the > same problem as Jonathan, but then realised that retain semantics > are typically what you want for a mutable object. I can't quite > think of a case where a mutable copy of the array in the class would > actually be useful. Retaining a mutable object means you have no idea how its collection will change outside of your control. It doesn't matter as much with immutable objects, of course. NSMutableString is another good example of needing a mutable copy, rather than just a retain. Design-wise, you could decide to never have mutable objects as instance variables and just re-set the entire array each time -- but that seems a bit odd when you have thousands of items in a collection, since each of the members would likely need to get a retain when you duplicate it. It might also make it difficult to bind the array to an NSArrayController. - Scott From ozone at algorithm.com.au Sat Jan 5 20:07:15 2008 From: ozone at algorithm.com.au (=?ISO-8859-1?Q?Andr=E9_Pang?=) Date: Sat Jan 5 20:07:25 2008 Subject: Leopard Properties and 'non-nil' declaration In-Reply-To: References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> Message-ID: On 06/01/2008, at 2:43 PM, Bill Bumgarner wrote: > Seriously, though, there are cases where mutablecopy makes a lot of > sense. Specifically, if your object model is such that your object > wants to take ownership of the contents of the array and changes > therein. Right, agreed. I did think of that case, but thought that it was a little unusual in that you would have to access the ivar directly inside your class's code to update its contents, rather than using the property syntax (otherwise you'd be making a mutable copy of the object on every update). So mutable-copy properties requires some care in usage, but I suppose it's no more care needed than with retain semantics. While we're on the subject of properties, I wonder if I can subvert the topic a bit... I was pondering submitting an enhancement request to have a "non-nil" property declaration, e.g. @property (retain, nonnil) id foo; That declaration would only apply to Objective-C objects[1], and hint to the user that setting the property to a nil object is illegal. @synthesize would be expected to check if the object being passed in is nil; if it is, it can throw an exception or something else sensible. I think non-nil setters are a common-enough scenario that it'd justify being an additional property declaration. Right now I'm resorting to writing my own setters for properties that I want to be non-nil, which is OK, but hey, the less work I have to do, the better :). I'm happy to submit a formal radar request for this, but I thought I'd check with others first whether I'm on crack. 1. I realise that being only applicable to Objective-C objects restricts the generality of the property declaration, but hey, assign/ retain/copy(/mutablecopy) are all object-specific already anyway :). -- % Andre Pang : trust.in.love.to.save From sstevenson at mac.com Sat Jan 5 22:18:53 2008 From: sstevenson at mac.com (Scott Stevenson) Date: Sat Jan 5 22:18:57 2008 Subject: Leopard Properties and 'non-nil' declaration In-Reply-To: References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> Message-ID: <4B2D0704-9D08-4B2C-BAD1-C94845D4984B@mac.com> On Jan 5, 2008, at 8:07 PM, Andr? Pang wrote: > Right now I'm resorting to writing my own setters for properties > that I want to be non-nil, which is OK, but hey, the less work I > have to do, the better :) Key-Value Validation may help: - Scott From ozone at algorithm.com.au Sat Jan 5 22:28:37 2008 From: ozone at algorithm.com.au (=?ISO-8859-1?Q?Andr=E9_Pang?=) Date: Sat Jan 5 22:28:43 2008 Subject: Leopard Properties and 'non-nil' declaration In-Reply-To: <4B2D0704-9D08-4B2C-BAD1-C94845D4984B@mac.com> References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> <4B2D0704-9D08-4B2C-BAD1-C94845D4984B@mac.com> Message-ID: On 06/01/2008, at 5:18 PM, Scott Stevenson wrote: >> Right now I'm resorting to writing my own setters for properties >> that I want to be non-nil, which is OK, but hey, the less work I >> have to do, the better :) > > Key-Value Validation may help: > > I looked at that. However, that documentation says that Key-Value Validation methods are not called when a property is set: "Key-value coding does not perform validation automatically. It is, in general, your application?s responsibility to invoke the validation methods" and: "Warning: An implementation of -set: for a property should never call the validation methods." It feels like Key-Value Validation is designed for higher-level purposes than making sure an object is non-nil in a setter. From what I've read, it seems like the setter methods are the correct place to check for that. -- % Andre Pang : trust.in.love.to.save From scott at cocoadoc.com Sat Jan 5 23:33:42 2008 From: scott at cocoadoc.com (Scott Anguish) Date: Sat Jan 5 23:33:45 2008 Subject: Leopard Properties and 'non-nil' declaration In-Reply-To: References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> <4B2D0704-9D08-4B2C-BAD1-C94845D4984B@mac.com> Message-ID: that use of the term "property" I believe predates Objective-C 2.0 Properties I don't believe it is intended to imply Objective-C 2.0 Properties specifically. On Jan 6, 2008, at 1:28 AM, Andr? Pang wrote: > On 06/01/2008, at 5:18 PM, Scott Stevenson wrote: > >>> Right now I'm resorting to writing my own setters for properties >>> that I want to be non-nil, which is OK, but hey, the less work I >>> have to do, the better :) >> >> Key-Value Validation may help: >> > > > > I looked at that. However, that documentation says that Key-Value > Validation methods are not called when a property is set: > > "Key-value coding does not perform validation automatically. It is, > in general, your application?s responsibility to invoke the > validation methods" > > and: > > "Warning: An implementation of -set: for a property should > never call the validation methods." > > It feels like Key-Value Validation is designed for higher-level > purposes than making sure an object is non-nil in a setter. From > what I've read, it seems like the setter methods are the correct > place to check for that. > > > -- > % Andre Pang : trust.in.love.to.save > > > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From j.p.dann at gmail.com Sun Jan 6 03:51:52 2008 From: j.p.dann at gmail.com (Jonathan Dann) Date: Sun Jan 6 03:52:20 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> Message-ID: On 6 Jan 2008, at 03:43, Bill Bumgarner wrote: > On Jan 5, 2008, at 7:10 PM, Andr? Pang wrote: >> On 06/01/2008, at 12:53 PM, Bill Bumgarner wrote: >>> Which, unfortunately, is the alternative. There is an >>> enhancement request already to offer a mutablecopy keyword. >> Is there actually a use for a 'mutablecopy' keyword? I ran into >> the same problem as Jonathan, but then realised that retain >> semantics are typically what you want for a mutable object. I >> can't quite think of a case where a mutable copy of the array in >> the class would actually be useful. >> >> (Maybe that thought can be used as a possible warning: if you >> define a property for a type that obeys the NSMutableCopying >> protocol, perhaps a warning can be emitted if you use copy rather >> than retain...) > > There are uses for mutablecopy in that there has been more than one > person that has filed a request for it. :) > > Seriously, though, there are cases where mutablecopy makes a lot of > sense. Specifically, if your object model is such that your object > wants to take ownership of the contents of the array and changes > therein. It is much easier to guarantee that a mutable array's > contents haven't changed if you have isolated ownership of said > mutable array; copying on set and returning a copy on get. > > Of course, that has efficiency / performance / memory implications > and, thus, balance must be maintained between performance and bullet > proof. > > b.bum > And this is the thing. I don't want to merely retain it as I can see that I'd accidentally mutate it further down the line. Looks like some properties I'll write myself. Thanks again guys, the discussion is really useful for me. Jon From j.p.dann at gmail.com Sun Jan 6 06:55:39 2008 From: j.p.dann at gmail.com (Jonathan Dann) Date: Sun Jan 6 09:52:36 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> Message-ID: <97CB688A-F346-44AA-9BCE-3BCA94062A3A@gmail.com> On 6 Jan 2008, at 03:43, Bill Bumgarner wrote: > On Jan 5, 2008, at 7:10 PM, Andr? Pang wrote: >> On 06/01/2008, at 12:53 PM, Bill Bumgarner wrote: >>> Which, unfortunately, is the alternative. There is an >>> enhancement request already to offer a mutablecopy keyword. >> Is there actually a use for a 'mutablecopy' keyword? I ran into >> the same problem as Jonathan, but then realised that retain >> semantics are typically what you want for a mutable object. I >> can't quite think of a case where a mutable copy of the array in >> the class would actually be useful. >> >> (Maybe that thought can be used as a possible warning: if you >> define a property for a type that obeys the NSMutableCopying >> protocol, perhaps a warning can be emitted if you use copy rather >> than retain...) > > There are uses for mutablecopy in that there has been more than one > person that has filed a request for it. :) > > Seriously, though, there are cases where mutablecopy makes a lot of > sense. Specifically, if your object model is such that your object > wants to take ownership of the contents of the array and changes > therein. It is much easier to guarantee that a mutable array's > contents haven't changed if you have isolated ownership of said > mutable array; copying on set and returning a copy on get. > > Of course, that has efficiency / performance / memory implications > and, thus, balance must be maintained between performance and bullet > proof. > > b.bum > What I really wanted was the ability to declare the mutable array as a property as a I've really grown to like the 'dot syntax'. So here is the solution that seems to have worked: @interface Foo : NSObject { NSMutableArray *array; } @property(copy) NSMutableArray *array; - (void)setArray:(NSMutableArray *)a; - (NSMutableArray *)array; @end @implementation @dynamic array; - (void)setArray:(NSMutableArray *)a; { if (array != a) { [array release]; array = [a mutableCopy]; } } - (NSMutableArray *)array; { [return array]; } @end In my main.m I can then call [array addObject:[NSString string]]; without an error or compiler warnings. I think I could pass the setter an NSArray too as NSArray conforms to NSMutableCopying. Is there anything that I missed, could this go horribly wrong somewhere? Jon From j.p.dann at gmail.com Sun Jan 6 09:57:17 2008 From: j.p.dann at gmail.com (Jonathan Dann) Date: Sun Jan 6 09:57:40 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> Message-ID: <167615D2-EAC3-436C-8DF8-047AE93372BD@gmail.com> On 6 Jan 2008, at 03:43, Bill Bumgarner wrote: > On Jan 5, 2008, at 7:10 PM, Andr? Pang wrote: >> On 06/01/2008, at 12:53 PM, Bill Bumgarner wrote: >>> Which, unfortunately, is the alternative. There is an >>> enhancement request already to offer a mutablecopy keyword. >> Is there actually a use for a 'mutablecopy' keyword? I ran into >> the same problem as Jonathan, but then realised that retain >> semantics are typically what you want for a mutable object. I >> can't quite think of a case where a mutable copy of the array in >> the class would actually be useful. >> >> (Maybe that thought can be used as a possible warning: if you >> define a property for a type that obeys the NSMutableCopying >> protocol, perhaps a warning can be emitted if you use copy rather >> than retain...) > > There are uses for mutablecopy in that there has been more than one > person that has filed a request for it. :) > > Seriously, though, there are cases where mutablecopy makes a lot of > sense. Specifically, if your object model is such that your object > wants to take ownership of the contents of the array and changes > therein. It is much easier to guarantee that a mutable array's > contents haven't changed if you have isolated ownership of said > mutable array; copying on set and returning a copy on get. > > Of course, that has efficiency / performance / memory implications > and, thus, balance must be maintained between performance and bullet > proof. > > b.bum > What I really wanted was the ability to declare the mutable array as a property as a I've really grown to like the 'dot syntax'. So here is the solution that seems to have worked: @interface Foo : NSObject { NSMutableArray *array; } @property(copy) NSMutableArray *array; - (void)setArray:(NSMutableArray *)a; - (NSMutableArray *)array; @end @implementation @dynamic array; - (void)setArray:(NSMutableArray *)a; { if (array != a) { [array release]; array = [a mutableCopy]; } } - (NSMutableArray *)array; { [return array]; } @end In my main.m I can then call [array addObject:[NSString string]]; without an error or compiler warnings. I think I could pass the setter an NSArray too as NSArray conforms to NSMutableCopying. Is there anything that I missed, could this go horribly wrong somewhere? Jon From bbum at mac.com Sun Jan 6 11:05:34 2008 From: bbum at mac.com (Bill Bumgarner) Date: Sun Jan 6 11:05:51 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: <97CB688A-F346-44AA-9BCE-3BCA94062A3A@gmail.com> References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> <97CB688A-F346-44AA-9BCE-3BCA94062A3A@gmail.com> Message-ID: <8234739E-517E-4AB1-99F5-6DECD086ABE8@mac.com> On Jan 6, 2008, at 6:55 AM, Jonathan Dann wrote: > What I really wanted was the ability to declare the mutable array as > a property as a I've really grown to like the 'dot syntax'. So here > is the solution that seems to have worked: The dot syntax works fine for non-property based attributes. I.e. you could drop the @property declaration below and all your code -- dot or no dot -- would continue to work the same. What would change, though, is that the additional metadata provided by the @property declaration would no longer be available at runtime for introspection purposes. At this time, there are few, if any, bits of code that use that metadata. I expect that'll change in the future. > - (NSMutableArray *)array; > { > return array; > } At the least, that should be... return [array autorelease]; ... unless you have GC turned on (which the use of retain/release in the rest of your code indicates that you likely do not). Given the overall defensiveness of your code, you might consider returning a copy of your array, mutable or otherwise. As it stands, any client can grab a reference to the internal storage of your class and change it. return [[array copy] autorelease]; > In my main.m I can then call [array addObject:[NSString string]]; > without an error or compiler warnings. > > I think I could pass the setter an NSArray too as NSArray conforms > to NSMutableCopying. Is there anything that I missed, could this go > horribly wrong somewhere? Nope -- that will work fine. b.bum From mmalc_lists at mac.com Sun Jan 6 11:15:45 2008 From: mmalc_lists at mac.com (mmalc crawford) Date: Sun Jan 6 11:15:49 2008 Subject: Localizing variants of English In-Reply-To: References: <20080104200005.8E757AB6F3@forums.omnigroup.com> Message-ID: <9E387FAA-EF48-481F-8EB6-4314565AA187@mac.com> On Jan 5, 2008, at 3:14 PM, Chad Armstrong wrote: > I've looked around, but haven't dug up anything regarding my question. > I know how to localize a Cocoa application for various languages > (English, Dutch, German, etc.). But is there a way to create > different dialects of a language? Such as, is there a way to > localize (or localise) an application so it is aware of say U.S. > English versus British English? > mmalc From mmalc_lists at mac.com Sun Jan 6 11:19:10 2008 From: mmalc_lists at mac.com (mmalc crawford) Date: Sun Jan 6 11:19:14 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: <167615D2-EAC3-436C-8DF8-047AE93372BD@gmail.com> References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> <167615D2-EAC3-436C-8DF8-047AE93372BD@gmail.com> Message-ID: <1A21AF85-CA15-49DF-AAE2-82BC0559E382@mac.com> On Jan 6, 2008, at 9:57 AM, Jonathan Dann wrote: > What I really wanted was the ability to declare the mutable array as > a property as a I've really grown to like the 'dot syntax' "Accessing a property property calls the get method associated with the property (by default, property) and setting it calls the set method associated with the property (by default, setProperty:). In fact, as long as there is an appropriate getter and setter available, you can use the dot-syntax invoke those methods even if you haven?t declared a property (if you haven?t declared a property, the getter and setter must be named property and setProperty: respectively)." mmalc From bbum at mac.com Sun Jan 6 11:20:34 2008 From: bbum at mac.com (Bill Bumgarner) Date: Sun Jan 6 11:20:50 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: <8234739E-517E-4AB1-99F5-6DECD086ABE8@mac.com> References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> <97CB688A-F346-44AA-9BCE-3BCA94062A3A@gmail.com> <8234739E-517E-4AB1-99F5-6DECD086ABE8@mac.com> Message-ID: On Jan 6, 2008, at 11:05 AM, Bill Bumgarner wrote: > At the least, that should be... > > return [array autorelease]; Geez. I have been doing so much GC that even one cup of coffee no longer prevents such stupidity. That should, of course, be: return [[array retain] autorelease]; Doh! b.bum From mmalc_lists at mac.com Sun Jan 6 11:25:14 2008 From: mmalc_lists at mac.com (mmalc crawford) Date: Sun Jan 6 11:25:19 2008 Subject: Localizing variants of English In-Reply-To: <4B266F40-0A79-46A3-BDC6-00766961C8E7@gmail.com> References: <20080104200005.8E757AB6F3@forums.omnigroup.com> <4B266F40-0A79-46A3-BDC6-00766961C8E7@gmail.com> Message-ID: On Jan 5, 2008, at 3:17 PM, Christiaan Hofman wrote: > Yes. There are language codes also for dialects, e.g. en-gb is > British English. > Typically you should specify a locale, not a language ID. For a project locale, it would be en_GB. On Jan 5, 2008, at 3:21 PM, Fabian Schuiki wrote: > Wouldn't make much sense for Swiss German since it's not a full > language as such, many components of a "full language" like High > German or English are missing (i.e. there are only 2 tenses for > verbs, present and present perfect). But for other languages this > actually would/could make sense? > As the above reference describes, there's more to a locale than just language... mmalc From j.p.dann at gmail.com Sun Jan 6 11:32:12 2008 From: j.p.dann at gmail.com (Jonathan Dann) Date: Sun Jan 6 11:32:19 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> <46CC6808-45D4-45D8-8949-E9441F6DADC7@algorithm.com.au> Message-ID: <79541A45-564F-408F-8174-3351B7219CD5@gmail.com> > At the least, that should be... > > return [array autorelease]; > > ... unless you have GC turned on (which the use of retain/release in > the rest of your code indicates that you likely do not). > > Given the overall defensiveness of your code, you might consider > returning a copy of your array, mutable or otherwise. As it stands, > any client can grab a reference to the internal storage of your class > and change it. > > return [[array copy] autorelease]; Thanks Bill, that does seem better, I'm quite new to all of this, and I'm being quite cautious with my memory managment, trying to get it *really* right. Your explanation makes perfect sense. Jon From jim.correia at pobox.com Sun Jan 6 11:32:14 2008 From: jim.correia at pobox.com (Jim Correia) Date: Sun Jan 6 11:32:22 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> Message-ID: On Jan 5, 2008, at 9:16 PM, Bill Bumgarner wrote: > I should add, though, that the above is not really atomic (and, of > course, "atomic" is not thread safe -- merely non-crashy in the > face of the threads). > > (One of the advantages of GC is that simple setters like the above > become atomic in that assignments are atomic for object types.) Can you offer any advice for the times when I must write my own accessor, but want it to have similar behaviors to the autogenerated accessor? In particular, I'm thinking about the default atomic behavior. Is this simply wrapping the work in a @synchronized(self) block? Something else? I'd look in the objc-2 sources, but they aren't available yet :-) Jim From bob at apple.com Mon Jan 7 22:24:59 2008 From: bob at apple.com (Bob Frank) Date: Mon Jan 7 22:25:12 2008 Subject: MEETING: Chicago CocoaHeads / CAWUG - DTrace - Tuesday Jan 8th References: <67344C17-68F5-4F8C-962C-40791659E740@apple.com> Message-ID: <9510B9CE-440A-4FE7-A6DF-2983F1D254F3@apple.com> IMPORTANT NOTES: Our meetings will be permanently starting at ** 7:00 ** instead of 6:00 We have a new mailing list URL: http://groups.google.com/group/cawug Email Address: cawug@googlegroups.com You can email here to subscribe immediately: cawug-subscribe@googlegroups.com ---------------- Hi all, Just a quick reminder. The Chicago CocoaHeads / Chicago Cocoa and WebObjects User Group (CAWUG) is holding our next meeting tomorrow, Tuesday, January 8th, at 7:00 PM at the Apple Store on Michigan Ave. Agenda: - Introductions & Announcements - Bob on DTrace in Leopard - adjournment to O'Toole's When: Tuesday, January 8th, 6:00 PM Where: Apple Store Michigan Avenue 679 North Michigan Ave. (at the corner of Huron & Michigan Ave.) Chicago, IL 60611 http://maps.yahoo.com/maps_result? ed=gYbE5Op_0Tokf_p7h61dwjbWtjC2r1YehzWw&csz=60611 http://tinyurl.com/26z5nb (in case long URL gets cut) - Bob on DTrace in Leopard I will talk about the D lanugage, how to use DTrace from the bottom up. I plan to tie into Dave's discussion of tools last month and will show some of Instruments use of DTrace too. - O'Tooles We will continue the discussion at our local watering hold Timothy O'Toole's at 622 Fairbanks (2 blocks east of the store). We also wish to thank the folks who run the theater space at the Apple store for letting us have our meetings there, and Jonathan 'Wolf' Rentzsch for hosting the new and revived CAWUG web site. Thanks all. Also, if you are working on a project and would like to talk about it briefly / promote it, I think it would be fun for people to hear about other people's projects. Please email me off line and you can talk at a future meeting or would like a book to review we would welcome that too. Future meetings dates and tentative topics: 2/12/08, 3/11/08, 4/8/08 February - TBD on developing for WebObjects in Leopard with Eclipse and the other new tools March - TBD if the iPhone SDK is out, we hope to talk about it., if not topic TBD April - TBD CAWUG Resources Mail list: http://groups.google.com/group/cawug Google Site: http://groups.google.com/group/cawug Web Site: http://www.cawug.org/ RSS feed: http://www.cawug.org/rss.xml iCal: http://ical.mac.com/chicagobob/ Chicago-CocoaHeads-CAWUG (view on the web) iCal: webcal://ical.mac.com/chicagobob/Chicago-CocoaHeads-CAWUG.ics (subscribe to in iCal) Cocoa Heads web site: http://cocoaheads.org/us/ChicagoIllinois/index.html Hope to see you at the meeting. From amaxwell at mac.com Mon Jan 7 22:25:00 2008 From: amaxwell at mac.com (Adam R. Maxwell) Date: Mon Jan 7 22:25:15 2008 Subject: GetIconRefFromFileInfo retain count Message-ID: <21D9B496-3607-4261-9B3E-E578CE95BB71@mac.com> Does anyone know if GetIconRefFromFileInfo increments the reference count of the IconRef it returns? Ordinarily I'd guess not, based on the name, but the other Get... functions in Icon Services are documented as incrementing the refcount. I tried calling GetIconRefOwners but it always returns zero for the number of owners, even after explicitly calling AcquireIconRef. This makes me slightly nervous... thanks, adam From kusterer at gmail.com Wed Jan 9 02:35:44 2008 From: kusterer at gmail.com (Uli Kusterer) Date: Wed Jan 9 02:35:50 2008 Subject: How to load a text-resource from a bundle (Plugin) In-Reply-To: <4A20920E-30F9-4B4B-ABBF-325D1A16AD93@animes.de> References: <4A20920E-30F9-4B4B-ABBF-325D1A16AD93@animes.de> Message-ID: <6F794770-5812-4328-8E4B-C6D30C69727F@gmail.com> On 29.12.2007, at 2:46 , Aya Koshigaya wrote: > But the resource wasn't found, I found out, the problem is > "mainBundle" is the Maya-Bundle, not my plugin... That's to be expected. > After this I tried to find my bundle, but with no result.. :( > When I use this: > [NSBundle bundleForClass:[self class]]; > > I get a compile-error that says "self is undeclared", because my > plugin is still written in C, not ObjC... and I'm using the ObjC > functions inside my normal C-functions = no self. So, declare a class. Just any dummy class will do. Then you can pass [AYKDummyClass class] to +bundleWithClass: and get a bundle. > Next try was: > [NSBundle bundleWithIdentifier:@"de.koshigaya.test"]; > > the result was NULL.. no bundle with this identifier was found :( Double-click the "Target" for the plugin you're compiling. Go to the "Properties" tab and make sure you've specified de.koshigaya.test as the bundle ID. Is it in there? > As last thing I tried to list ALL bundles and see if my own one is > found with this: > > NSArray *bundles = [NSBundle allBundles]; > for (int i = 0; i < [bundles count]; i++) { > NSBundle *b = [bundles objectAtIndex:i]; > NSString *vident = [b bundleIdentifier]; > printOut([vident UTF8String]); > } > > and... It only listed ONE bundle.. the same as "mainBundle".. -> > com.alias.Maya.2008 > > So... no I have no idea what to do more.. I'm totally helpless.. > Maybe Maya isn't realy "loading" my Bundle..? I mean, maybe Maya > uses a way to load the bundle so it's not registered or something.. > don't know.. :/ Well, IIRC Maya is a Unix app. It could be that it is really using dyld directly, or maybe libdl or something like that. If that's the case, then there may not be a bundle for your plugin. Have you looked at the CFBundle functions, dyld and libdl docs to see if any of these provides a way to e.g. get the file for a loaded function? Cheers, -- M. Uli Kusterer "The Witnesses of TeachText are everywhere..." http://www.zathras.de From stevenhatfield at mac.com Wed Jan 9 05:05:37 2008 From: stevenhatfield at mac.com (Steven Hatfield) Date: Wed Jan 9 05:05:43 2008 Subject: Core Data Problem Message-ID: <36335AF5-3C0D-442B-ADC4-7744AC233D5E@mac.com> Hi All, I am a newbie ObjC/Cocoa programmer, and I have a small core data application that I am writing. Everything works fine when the user enters data - save/open, display, etc. Where I am running into a problem is when the NSManagedObject needs to set some data; I simply can't get the methods to be called. I used Xcode to generate the Managed Object Class, which includes the code: @interface Listing (CoreDataGeneratedAccessors) - (void)addListItemsObject:(ListItem *)value; - (void)removeListItemsObject:(ListItem *)value; @end in the interface file, and I called the method in the implementation file: - (void)addListItemsObject:(ListItem *)value { NSLog(@"Here"); } I have verified that the "awakeFromInsert:" method is called on that class, and the code compiles fine, but I never see "Here" in the console and when I put a breakpoint on the NSLog() line, it is never hit. In the code listings in the NSPersistentDocumentTutorial, it appears that this should work fine... what am I doing wrong? I appreciate any help. TIA, Steven From cmhofman at gmail.com Wed Jan 9 05:16:12 2008 From: cmhofman at gmail.com (Christiaan Hofman) Date: Wed Jan 9 05:16:19 2008 Subject: Core Data Problem In-Reply-To: <36335AF5-3C0D-442B-ADC4-7744AC233D5E@mac.com> References: <36335AF5-3C0D-442B-ADC4-7744AC233D5E@mac.com> Message-ID: You've detailed the code part, but you didn't tell us what you did to test it. So we still do not know what actually failed. It may well be that your expectations are wrong. In fact, that seems to be the case from your explanation. You say that you have problems when the "NSManagedObject needs to set some data". That usually means changing a property. Than you go on describing methods to modify a relationship. So what are you actually modifying? Christiaan On 9 Jan 2008, at 2:05 PM, Steven Hatfield wrote: > Hi All, > > I am a newbie ObjC/Cocoa programmer, and I have a small core data > application that I am writing. Everything works fine when the user > enters data - save/open, display, etc. > Where I am running into a problem is when the NSManagedObject needs > to set some data; I simply can't get the methods to be called. > > I used Xcode to generate the Managed Object Class, which includes > the code: > > @interface Listing (CoreDataGeneratedAccessors) > - (void)addListItemsObject:(ListItem *)value; > - (void)removeListItemsObject:(ListItem *)value; > @end > > in the interface file, and I called the method in the > implementation file: > > - (void)addListItemsObject:(ListItem *)value > { > NSLog(@"Here"); > } > > > I have verified that the "awakeFromInsert:" method is called on > that class, and the code compiles fine, but I never see "Here" in > the console and when I put a breakpoint on the NSLog() line, it is > never hit. > > In the code listings in the NSPersistentDocumentTutorial, it > appears that this should work fine... what am I doing wrong? > > I appreciate any help. > > TIA, > Steven > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From stevenhatfield at mac.com Wed Jan 9 06:17:01 2008 From: stevenhatfield at mac.com (Steven Hatfield) Date: Wed Jan 9 06:17:08 2008 Subject: Core Data Problem In-Reply-To: References: <36335AF5-3C0D-442B-ADC4-7744AC233D5E@mac.com> Message-ID: Christiaan, Thanks for your quick reply. You are absolutely correct, that's what I get for posting before my morning intake of caffeine... ;-) To test it I am compiling in Debug mode, I placed a breakpoint on the NSLog() line and pressed "Debug". I brought up the console and the NSLog() call never fires, and the breakpoint is never hit, even though I can see in the GUI that the object is being used. The awakeFromInsert: *is* being called, I see NSLog() output in the console from that method. My intention is to get the ListItem object that is being inserted into the "Listing" object's ListItems (collection? What would it be called? Like I said... I'm a newbie...), and modify one of its properties, "itemNumber" to contain the count of the # of listItems that are in the Listing to which it belongs. I thought it best to do this from the Listing object itself, since from the wording of the method it receives some hint that a new listItem is being inserted into it. It's really just a simple app to get familiar with Core Data, after working through Hillegass' awesome intro to Mac OS X Programming book. He doesn't cover Core Data, so it's very new to me... There are likely other, better ways to do this, but hopefully with your help, I can figure it out. Thanks, Steven On Jan 9, 2008, at 8:16 AM, Christiaan Hofman wrote: > You've detailed the code part, but you didn't tell us what you did > to test it. So we still do not know what actually failed. It may > well be that your expectations are wrong. In fact, that seems to be > the case from your explanation. You say that you have problems when > the "NSManagedObject needs to set some data". That usually means > changing a property. Than you go on describing methods to modify a > relationship. So what are you actually modifying? > > Christiaan > > On 9 Jan 2008, at 2:05 PM, Steven Hatfield wrote: > >> Hi All, >> >> I am a newbie ObjC/Cocoa programmer, and I have a small core data >> application that I am writing. Everything works fine when the user >> enters data - save/open, display, etc. >> Where I am running into a problem is when the NSManagedObject needs >> to set some data; I simply can't get the methods to be called. >> >> I used Xcode to generate the Managed Object Class, which includes >> the code: >> >> @interface Listing (CoreDataGeneratedAccessors) >> - (void)addListItemsObject:(ListItem *)value; >> - (void)removeListItemsObject:(ListItem *)value; >> @end >> >> in the interface file, and I called the method in the >> implementation file: >> >> - (void)addListItemsObject:(ListItem *)value >> { >> NSLog(@"Here"); >> } >> >> >> I have verified that the "awakeFromInsert:" method is called on >> that class, and the code compiles fine, but I never see "Here" in >> the console and when I put a breakpoint on the NSLog() line, it is >> never hit. >> >> In the code listings in the NSPersistentDocumentTutorial, it >> appears that this should work fine... what am I doing wrong? >> >> I appreciate any help. >> >> TIA, >> Steven >> _______________________________________________ >> MacOSX-dev mailing list >> MacOSX-dev@omnigroup.com >> http://www.omnigroup.com/mailman/listinfo/macosx-dev > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From cmhofman at gmail.com Wed Jan 9 09:57:06 2008 From: cmhofman at gmail.com (Christiaan Hofman) Date: Wed Jan 9 09:57:14 2008 Subject: Core Data Problem In-Reply-To: References: <36335AF5-3C0D-442B-ADC4-7744AC233D5E@mac.com> Message-ID: <219EAE80-C245-405E-B765-F87E6136DEF9@gmail.com> That's all not relevant info. The question is what you're doing to the data model. Are you inserting an ListItem object, and how? Changing a property of any object is not at all relevant to the add/ remove methods. Christiaan On 9 Jan 2008, at 3:17 PM, Steven Hatfield wrote: > Christiaan, > > Thanks for your quick reply. You are absolutely correct, that's > what I get for posting before my morning intake of caffeine... ;-) > > To test it I am compiling in Debug mode, I placed a breakpoint on > the NSLog() line and pressed "Debug". I brought up the console and > the NSLog() call never fires, and the breakpoint is never hit, even > though I can see in the GUI that the object is being used. The > awakeFromInsert: *is* being called, I see NSLog() output in the > console from that method. > > My intention is to get the ListItem object that is being inserted > into the "Listing" object's ListItems (collection? What would it be > called? Like I said... I'm a newbie...), and modify one of its > properties, "itemNumber" to contain the count of the # of listItems > that are in the Listing to which it belongs. I thought it best to > do this from the Listing object itself, since from the wording of > the method it receives some hint that a new listItem is being > inserted into it. > > It's really just a simple app to get familiar with Core Data, after > working through Hillegass' awesome intro to Mac OS X Programming > book. He doesn't cover Core Data, so it's very new to me... > > There are likely other, better ways to do this, but hopefully with > your help, I can figure it out. > > Thanks, > Steven > > On Jan 9, 2008, at 8:16 AM, Christiaan Hofman wrote: > >> You've detailed the code part, but you didn't tell us what you did >> to test it. So we still do not know what actually failed. It may >> well be that your expectations are wrong. In fact, that seems to >> be the case from your explanation. You say that you have problems >> when the "NSManagedObject needs to set some data". That usually >> means changing a property. Than you go on describing methods to >> modify a relationship. So what are you actually modifying? >> >> Christiaan >> >> On 9 Jan 2008, at 2:05 PM, Steven Hatfield wrote: >> >>> Hi All, >>> >>> I am a newbie ObjC/Cocoa programmer, and I have a small core data >>> application that I am writing. Everything works fine when the >>> user enters data - save/open, display, etc. >>> Where I am running into a problem is when the NSManagedObject >>> needs to set some data; I simply can't get the methods to be called. >>> >>> I used Xcode to generate the Managed Object Class, which includes >>> the code: >>> >>> @interface Listing (CoreDataGeneratedAccessors) >>> - (void)addListItemsObject:(ListItem *)value; >>> - (void)removeListItemsObject:(ListItem *)value; >>> @end >>> >>> in the interface file, and I called the method in the >>> implementation file: >>> >>> - (void)addListItemsObject:(ListItem *)value >>> { >>> NSLog(@"Here"); >>> } >>> >>> >>> I have verified that the "awakeFromInsert:" method is called on >>> that class, and the code compiles fine, but I never see "Here" in >>> the console and when I put a breakpoint on the NSLog() line, it >>> is never hit. >>> >>> In the code listings in the NSPersistentDocumentTutorial, it >>> appears that this should work fine... what am I doing wrong? >>> >>> I appreciate any help. >>> >>> TIA, >>> Steven >>> _______________________________________________ >>> MacOSX-dev mailing list >>> MacOSX-dev@omnigroup.com >>> http://www.omnigroup.com/mailman/listinfo/macosx-dev >> >> _______________________________________________ >> MacOSX-dev mailing list >> MacOSX-dev@omnigroup.com >> http://www.omnigroup.com/mailman/listinfo/macosx-dev > From stevenhatfield at mac.com Wed Jan 9 17:17:16 2008 From: stevenhatfield at mac.com (Steven Hatfield) Date: Wed Jan 9 17:17:22 2008 Subject: Core Data Problem In-Reply-To: <219EAE80-C245-405E-B765-F87E6136DEF9@gmail.com> References: <36335AF5-3C0D-442B-ADC4-7744AC233D5E@mac.com> <219EAE80-C245-405E-B765-F87E6136DEF9@gmail.com> Message-ID: <20D84372-6BE4-48D1-AB83-65987F16AA18@mac.com> I was thinking that when the addListItems: method is called, and the listItem is passed into the method, that I would be able to set the itemNumer property to a number other than "null" of the new object and let addListItems: go about its business of adding that object to the Listing. Is this not how I could do this? What would be a better way? Thanks, Steven On Jan 9, 2008, at 12:57 PM, Christiaan Hofman wrote: > That's all not relevant info. The question is what you're doing to > the data model. Are you inserting an ListItem object, and how? > Changing a property of any object is not at all relevant to the add/ > remove methods. > > Christiaan > > On 9 Jan 2008, at 3:17 PM, Steven Hatfield wrote: > >> Christiaan, >> >> Thanks for your quick reply. You are absolutely correct, that's >> what I get for posting before my morning intake of caffeine... ;-) >> >> To test it I am compiling in Debug mode, I placed a breakpoint on >> the NSLog() line and pressed "Debug". I brought up the console and >> the NSLog() call never fires, and the breakpoint is never hit, even >> though I can see in the GUI that the object is being used. The >> awakeFromInsert: *is* being called, I see NSLog() output in the >> console from that method. >> >> My intention is to get the ListItem object that is being inserted >> into the "Listing" object's ListItems (collection? What would it be >> called? Like I said... I'm a newbie...), and modify one of its >> properties, "itemNumber" to contain the count of the # of listItems >> that are in the Listing to which it belongs. I thought it best to >> do this from the Listing object itself, since from the wording of >> the method it receives some hint that a new listItem is being >> inserted into it. >> >> It's really just a simple app to get familiar with Core Data, after >> working through Hillegass' awesome intro to Mac OS X Programming >> book. He doesn't cover Core Data, so it's very new to me... >> >> There are likely other, better ways to do this, but hopefully with >> your help, I can figure it out. >> >> Thanks, >> Steven >> >> On Jan 9, 2008, at 8:16 AM, Christiaan Hofman wrote: >> >>> You've detailed the code part, but you didn't tell us what you did >>> to test it. So we still do not know what actually failed. It may >>> well be that your expectations are wrong. In fact, that seems to >>> be the case from your explanation. You say that you have problems >>> when the "NSManagedObject needs to set some data". That usually >>> means changing a property. Than you go on describing methods to >>> modify a relationship. So what are you actually modifying? >>> >>> Christiaan >>> >>> On 9 Jan 2008, at 2:05 PM, Steven Hatfield wrote: >>> >>>> Hi All, >>>> >>>> I am a newbie ObjC/Cocoa programmer, and I have a small core data >>>> application that I am writing. Everything works fine when the >>>> user enters data - save/open, display, etc. >>>> Where I am running into a problem is when the NSManagedObject >>>> needs to set some data; I simply can't get the methods to be >>>> called. >>>> >>>> I used Xcode to generate the Managed Object Class, which includes >>>> the code: >>>> >>>> @interface Listing (CoreDataGeneratedAccessors) >>>> - (void)addListItemsObject:(ListItem *)value; >>>> - (void)removeListItemsObject:(ListItem *)value; >>>> @end >>>> >>>> in the interface file, and I called the method in the >>>> implementation file: >>>> >>>> - (void)addListItemsObject:(ListItem *)value >>>> { >>>> NSLog(@"Here"); >>>> } >>>> >>>> >>>> I have verified that the "awakeFromInsert:" method is called on >>>> that class, and the code compiles fine, but I never see "Here" in >>>> the console and when I put a breakpoint on the NSLog() line, it >>>> is never hit. >>>> >>>> In the code listings in the NSPersistentDocumentTutorial, it >>>> appears that this should work fine... what am I doing wrong? >>>> >>>> I appreciate any help. >>>> >>>> TIA, >>>> Steven >>>> _______________________________________________ >>>> MacOSX-dev mailing list >>>> MacOSX-dev@omnigroup.com >>>> http://www.omnigroup.com/mailman/listinfo/macosx-dev >>> >>> _______________________________________________ >>> MacOSX-dev mailing list >>> MacOSX-dev@omnigroup.com >>> http://www.omnigroup.com/mailman/listinfo/macosx-dev >> > From sstevenson at mac.com Wed Jan 9 17:27:55 2008 From: sstevenson at mac.com (Scott Stevenson) Date: Wed Jan 9 17:27:59 2008 Subject: Core Data Problem In-Reply-To: <20D84372-6BE4-48D1-AB83-65987F16AA18@mac.com> References: <36335AF5-3C0D-442B-ADC4-7744AC233D5E@mac.com> <219EAE80-C245-405E-B765-F87E6136DEF9@gmail.com> <20D84372-6BE4-48D1-AB83-65987F16AA18@mac.com> Message-ID: On Jan 9, 2008, at 5:17 PM, Steven Hatfield wrote: > I was thinking that when the addListItems: method is called, and the > listItem is passed into the method, that I would be able to set the > itemNumer property to a number other than "null" of the new object > and let addListItems: go about its business of adding that object to > the Listing. > > Is this not how I could do this? What would be a better way? It sounds like there are two separate questions here: 1. Why is -addListItemsObject: not being called? 2. How do you populate the itemNumber? It's hard to answer #1 without knowing exactly what you're doing. Above, you actually say -addListItems:, which is maybe a typo? In any case, you should describe what you're doing that you believe should cause -addListItemsObject: to be called. For question #2, yes, it's completely reasonable to set the itemNumber inside the -addListItemsObject:. Whether that's the best thing for your application is hard to say without looking at the entire application. - Scott From sstevenson at mac.com Wed Jan 9 23:35:48 2008 From: sstevenson at mac.com (Scott Stevenson) Date: Wed Jan 9 23:35:59 2008 Subject: NSSocketPortNameServer In-Reply-To: References: Message-ID: <6A800F80-EDEC-4F74-9A7D-065B5A0F1B9D@mac.com> On Jan 3, 2008, at 6:12 PM, Tobias Peciva wrote: > Interestingly enough, the problem only started appearing on Intel > iMacs after one of the software updates in mid-December. Everything > works fine on PowerPC Macs and non-iMac Intel machines. I think it would be a good idea to file a bug on this. - Scott From peakrecruit at gmail.com Thu Jan 10 07:18:10 2008 From: peakrecruit at gmail.com (Armand Daniels) Date: Thu Jan 10 07:18:15 2008 Subject: MAC Application Developer- iPhone Message-ID: <95b348b00801100718v47107964x28745c8c0dd04d68@mail.gmail.com> MAC Application Developer- iPhone Position Description: Small startup is looking for an exceptional engineer to work on state-of-the art communication technology for Mac OS X for iPhone. Working on a suite of elegant, powerful applications, you will have the opportunity to have a major impact on the design and implementation of Apple's embedded device experience. Responsibilities - Work with a highly skilled team in the design and development of native mobile applications - Drive product features and functional/industry specifications - Utilize existing connection technologies on iPhone, Mac OS X and Windows Skill Set: - BS or MS in Computer Science or equivalent. - Leadership qualities- team lead. - Macintosh product development experience. - Extensive experience programming in C/C++/Objective C - In-depth knowledge of Carbon and Cocoa preferred. - Previous experience shipping Macintosh products is required. - Knowledge of scripting languages such as Perl, Python, or Ruby on Rails desired - A passion for making great Mac software and apps a must. Salary range $80,000 to $120,000 Flexible schedule Full-time permanent position Employee benefits package and stock optionis Relocatino Allowance Locatiion: San Diego, LA, or Bay Area Armand Daniels Peak Recruit adaniels@peakrecruit.com 512-292-1477 From bbum at mac.com Sun Jan 13 11:13:49 2008 From: bbum at mac.com (Bill Bumgarner) Date: Sun Jan 13 11:14:09 2008 Subject: Leopard Properties and NSMutable Array In-Reply-To: References: <144AED40-A930-4E45-AE7D-C7A9CA973E15@gmail.com> Message-ID: On Jan 6, 2008, at 11:32 AM, Jim Correia wrote: > Can you offer any advice for the times when I must write my own > accessor, but want it to have similar behaviors to the autogenerated > accessor? In particular, I'm thinking about the default atomic > behavior. Is this simply wrapping the work in a @synchronized(self) > block? Something else? Sure. http://www.friday.com/bbum/2008/01/13/objectivce-c-atomic-properties-threading-andor-custom-settergetter/ Long and short of it, you can use @synchronized(self) to make an accessor pair atomic. But does that actually solve a problem you have? Probably not. b.bum From ahoesch at smartsoft.de Wed Jan 16 16:16:07 2008 From: ahoesch at smartsoft.de (=?ISO-8859-1?Q?Andreas_H=F6schler?=) Date: Wed Jan 16 16:48:36 2008 Subject: Mail.app problem Message-ID: <65D09EBC-C491-11DC-B830-000393CA0072@smartsoft.de> Hi all, we have a bunch of 10.2 Macs and one 10.4 Mac in our infrastructure. All are accessing a postfix mailserver running on Solaris. One user - the one that is working with the 10.4 machine - now discovered something weird. The to header of all his incoming emails in Mail.app is no longer @.de but admin@viagra.com I checked his emails with Mail.app from the other Macs (10.2). No problem, the to name is correct there. I checked his mails with thunderbird under Solaris. All fine! But on his 10.4 machine it looks like the mails had been addressed to admin@viagra.com. We are accessing our mail server via imap. I first thaught of a problem with postfix but since everything is fine on other machines it must be something specific to his machine or account. I am totally clueless! Any idea? Thanks a lot! Regards, Andreas From edenwaith at mac.com Wed Jan 16 20:57:28 2008 From: edenwaith at mac.com (Chad Armstrong) Date: Wed Jan 16 20:57:17 2008 Subject: NSRunAlertPanel is not responding to Enter In-Reply-To: <20080110200006.459CDAF740@forums.omnigroup.com> References: <20080110200006.459CDAF740@forums.omnigroup.com> Message-ID: Hello: I have an NSRunAlertPanel which pops up a simple dialog box with an OK button. Normally, just pressing the Enter/Return button will tell the window to disappear. However, I've hit a snag where I'm finding this isn't working now. But I believe I've discovered the source of the problems. I'm overriding the keyDown for NSWindow so I can catch when certain keys are getting pressed. I'm also finding that when I'm hitting Enter, my keyDown method is grabbing this event. I've tried telling the program to send to the next registered handler, but it doesn't seem to change anything. Is there a way that I can set my NSRunAlertPanel so when I hit Enter it will go away? (If I just click on the OK button, it goes away with no problems.) Regards, Chad Armstrong From sstevenson at mac.com Wed Jan 16 22:51:42 2008 From: sstevenson at mac.com (Scott Stevenson) Date: Wed Jan 16 22:51:46 2008 Subject: NSRunAlertPanel is not responding to Enter In-Reply-To: References: <20080110200006.459CDAF740@forums.omnigroup.com> Message-ID: <19DDC411-1C87-4A9E-822F-53E3C723C890@mac.com> On Jan 16, 2008, at 8:57 PM, Chad Armstrong wrote: > However, I've hit a snag where I'm finding this isn't working now. > But I believe I've discovered the source of the problems. I'm > overriding the keyDown for NSWindow so I can catch when certain keys > are getting pressed. I'm also finding that when I'm hitting Enter, > my keyDown method is grabbing this event. I've tried telling the > program to send to the next registered handler, but it doesn't seem > to change anything. I think if you respond to the key event, the responder search will stop. You should be able to forward it on, though. What does your forwarding code look like? - Scott From cmhofman at gmail.com Thu Jan 17 01:37:19 2008 From: cmhofman at gmail.com (Christiaan Hofman) Date: Thu Jan 17 01:37:26 2008 Subject: NSRunAlertPanel is not responding to Enter In-Reply-To: References: <20080110200006.459CDAF740@forums.omnigroup.com> Message-ID: <7455061B-A313-4B02-8E33-C0C53306B18A@gmail.com> Sounds like really bad practice to override a key feature in a generic superclass. You should do your override in a subclass. And otherwise use [super keyDown:]. Christiaan On 17 Jan 2008, at 5:57 AM, Chad Armstrong wrote: > Hello: > > I have an NSRunAlertPanel which pops up a simple dialog box with an > OK button. Normally, just pressing the Enter/Return button will > tell the window to disappear. > > However, I've hit a snag where I'm finding this isn't working now. > But I believe I've discovered the source of the problems. I'm > overriding the keyDown for NSWindow so I can catch when certain > keys are getting pressed. I'm also finding that when I'm hitting > Enter, my keyDown method is grabbing this event. I've tried > telling the program to send to the next registered handler, but it > doesn't seem to change anything. > > Is there a way that I can set my NSRunAlertPanel so when I hit > Enter it will go away? (If I just click on the OK button, it goes > away with no problems.) > > Regards, > > Chad Armstrong From nicktoumpelis at gmail.com Fri Jan 18 15:22:09 2008 From: nicktoumpelis at gmail.com (Nick Toumpelis) Date: Fri Jan 18 15:22:17 2008 Subject: [Q]: Core Data & Bindings, [_NSStateMarker intValue] error Message-ID: Hi all, I would appreciate any help you can give me on this - I spent ages trying to solve it and looked everywhere for anything that might help. I have an NSTableView which is bound to an NSArrayController, which manages a set of Core Data entities. I also have Add and Remove buttons, which are connected to the add: and remove: actions of the controller - a typical use of Core Data and Bindings. When I add the first entity by clicking the Add button or when saveAction: is called (and in other circumstances), I often get this error: 2008-01-18 12:25:33.304 blogosphere[10865:10b] *** -[_NSStateMarker intValue]: unrecognized selector sent to instance 0x10ba60 This error, in some cases, is not apparent to the user. In other cases, it stops the execution of the running method. I would be grateful if you could help me with this or point me to the right direction. Kind regards, Nick ____________________________________________________________ Nick Toumpelis email: nick@toumpelis.me.uk BEng (Wales), MSc (Manchester) Software Developer Thessaloniki, Greece ____________________________________________________________ Nick Toumpelis email: nick@toumpelis.me.uk BEng (Wales), MSc (Manchester) Software Developer Thessaloniki, Greece From cmhofman at gmail.com Fri Jan 18 15:34:06 2008 From: cmhofman at gmail.com (Christiaan Hofman) Date: Fri Jan 18 15:34:14 2008 Subject: [Q]: Core Data & Bindings, [_NSStateMarker intValue] error In-Reply-To: References: Message-ID: <18E9EEEB-01D1-4686-9917-9CADE08D2256@gmail.com> You probably bind something else, probably to the selection or something. See the NSIsControllerMarker function. You get a state marker when a bound value is invalid, like nil or a multiple value. You should take care that your app handles this correctly when using a bound value. Christiaan On 19 Jan 2008, at 12:22 AM, Nick Toumpelis wrote: > Hi all, > > I would appreciate any help you can give me on this - I spent ages > trying to solve it and looked everywhere for anything that might help. > > I have an NSTableView which is bound to an NSArrayController, which > manages a set of Core Data entities. I also have Add and Remove > buttons, which are connected to the add: and remove: actions of the > controller - a typical use of Core Data and Bindings. > > When I add the first entity by clicking the Add button or when > saveAction: is called (and in other circumstances), I often get > this error: > > 2008-01-18 12:25:33.304 blogosphere[10865:10b] *** -[_NSStateMarker > intValue]: unrecognized selector sent to instance 0x10ba60 > > This error, in some cases, is not apparent to the user. In other > cases, it stops the execution of the running method. > > I would be grateful if you could help me with this or point me to > the right direction. > > > Kind regards, > > Nick > > > > ____________________________________________________________ > Nick Toumpelis email: nick@toumpelis.me.uk > BEng (Wales), MSc (Manchester) > Software Developer > Thessaloniki, Greece > > > > > > > ____________________________________________________________ > Nick Toumpelis email: nick@toumpelis.me.uk > BEng (Wales), MSc (Manchester) > Software Developer > Thessaloniki, Greece > > > > > > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From nicktoumpelis at gmail.com Sat Jan 19 06:12:18 2008 From: nicktoumpelis at gmail.com (Nick Toumpelis) Date: Sat Jan 19 06:12:25 2008 Subject: [Q]: Core Data & Bindings, [_NSStateMarker intValue] error [SOLVED] In-Reply-To: <18E9EEEB-01D1-4686-9917-9CADE08D2256@gmail.com> References: <18E9EEEB-01D1-4686-9917-9CADE08D2256@gmail.com> Message-ID: Thanks for your suggestion, Christiaan. After searching for hours , I found the little bug(ger) somewhere I did not expect. Initially, I thought that it had something to do with the Bindings in the NIB file. It was actually in the code, at a point where I was observing a key path of a nil object - like you said. Again, thank you very much for your help, Nick On 19 ??? 2008, at 1:34 ??, Christiaan Hofman wrote: > You probably bind something else, probably to the selection or > something. See the NSIsControllerMarker function. You get a state > marker when a bound value is invalid, like nil or a multiple value. > You should take care that your app handles this correctly when using > a bound value. > > Christiaan > > On 19 Jan 2008, at 12:22 AM, Nick Toumpelis wrote: > >> Hi all, >> >> I would appreciate any help you can give me on this - I spent ages >> trying to solve it and looked everywhere for anything that might >> help. >> >> I have an NSTableView which is bound to an NSArrayController, which >> manages a set of Core Data entities. I also have Add and Remove >> buttons, which are connected to the add: and remove: actions of the >> controller - a typical use of Core Data and Bindings. >> >> When I add the first entity by clicking the Add button or when >> saveAction: is called (and in other circumstances), I often get >> this error: >> >> 2008-01-18 12:25:33.304 blogosphere[10865:10b] *** -[_NSStateMarker >> intValue]: unrecognized selector sent to instance 0x10ba60 >> >> This error, in some cases, is not apparent to the user. In other >> cases, it stops the execution of the running method. >> >> I would be grateful if you could help me with this or point me to >> the right direction. >> >> >> Kind regards, >> >> Nick From georg.seifert at gmx.de Sun Jan 20 09:13:49 2008 From: georg.seifert at gmx.de (Georg Seifert) Date: Sun Jan 20 09:13:55 2008 Subject: Framwork in NSBundle Message-ID: <81D5DC13-4F5B-47AF-87F1-C4AE77052290@gmx.de> hello, I have a problem with a framework, loaded in a plugin. The framework does work in the main app. I get, amongst others, this errors: ...fer.framework/Headers/GSGlyph.h:14: warning: duplicate interface declaration for class 'GSClass1' ...fer.framework/Headers/GSGlyph.h:22: error: redefinition of 'struct GSClass1' the GSClass1.h starts with: #import @class GSClass2; @class GSClass3; @class GSClass4; @interface GSClass1 : NSObject { NSMutableArray * masters; NSString * name; GSClass4 * parent; NSImage * icon; ... } @property(retain) GSClass4 * parent; @property(retain) NSImage * icon; ... the other classes look similar. I made the framework like this: http://rentzsch.com/cocoa/embeddedFrameworks can anyone explain me what I did wrong. Thanks Georg From cmhofman at gmail.com Sun Jan 20 09:22:55 2008 From: cmhofman at gmail.com (Christiaan Hofman) Date: Sun Jan 20 09:23:04 2008 Subject: Framwork in NSBundle In-Reply-To: <81D5DC13-4F5B-47AF-87F1-C4AE77052290@gmx.de> References: <81D5DC13-4F5B-47AF-87F1-C4AE77052290@gmx.de> Message-ID: <66ADE9AD-43AA-4DD7-BA89-1AC6381ECCA2@gmail.com> And what about GSGlyph.h? From the warning & error it seems something's going wrong there. Did you use #import to get the GSClass1 header? Christiaan On 20 Jan 2008, at 6:13 PM, Georg Seifert wrote: > hello, > > I have a problem with a framework, loaded in a plugin. The > framework does work in the main app. I get, amongst others, this > errors: > > ...fer.framework/Headers/GSGlyph.h:14: warning: duplicate interface > declaration for class 'GSClass1' > ...fer.framework/Headers/GSGlyph.h:22: error: redefinition of > 'struct GSClass1' > > the GSClass1.h starts with: > > #import > @class GSClass2; > @class GSClass3; > @class GSClass4; > > @interface GSClass1 : NSObject { > NSMutableArray * masters; > NSString * name; > GSClass4 * parent; > NSImage * icon; > ... > } > @property(retain) GSClass4 * parent; > @property(retain) NSImage * icon; > ... > > the other classes look similar. > > I made the framework like this: > http://rentzsch.com/cocoa/embeddedFrameworks > > > can anyone explain me what I did wrong. > Thanks > Georg > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From ejstembler at ejse.com Wed Jan 23 12:38:39 2008 From: ejstembler at ejse.com (Edward J. Stembler) Date: Wed Jan 23 12:38:44 2008 Subject: Image resource question Message-ID: <153FD73F-BF89-4C1D-9215-DFA5B775E944@ejse.com> Hello, Which image format is the best to use for my Cocoa apps? What is the generally preferred format, and are there any limitations I should know about? For example, when perusing the resources of various apps, I noticed that some developers use TIFFs, some use PNGs, and some even use PDFs for images. Personally I'm a big fan of PNG since it supports alpha- transparencies. I'm just wondering why anyone would use TIFF if you could use PNG instead? I'm guessing that some use PDFs if they have their artwork in vector format originally (EPS or AI) and want to eventually support resolution independence. From joar at joar.com Wed Jan 23 13:22:55 2008 From: joar at joar.com (j o a r) Date: Wed Jan 23 13:23:04 2008 Subject: Image resource question In-Reply-To: <153FD73F-BF89-4C1D-9215-DFA5B775E944@ejse.com> References: <153FD73F-BF89-4C1D-9215-DFA5B775E944@ejse.com> Message-ID: On Jan 23, 2008, at 12:38 PM, Edward J. Stembler wrote: > For example, when perusing the resources of various apps, I noticed > that some developers use TIFFs, some use PNGs, and some even use > PDFs for images. Personally I'm a big fan of PNG since it supports > alpha-transparencies. I'm just wondering why anyone would use TIFF > if you could use PNG instead? TIFF also support alpha, so that can't be used as an argument for choosing one format over the other. j o a r From alastair at alastairs-place.net Wed Jan 23 13:35:37 2008 From: alastair at alastairs-place.net (Alastair Houghton) Date: Wed Jan 23 13:35:41 2008 Subject: Image resource question In-Reply-To: <153FD73F-BF89-4C1D-9215-DFA5B775E944@ejse.com> References: <153FD73F-BF89-4C1D-9215-DFA5B775E944@ejse.com> Message-ID: <886A1D11-232D-4825-B8A3-BF8280065BAB@alastairs-place.net> On 23 Jan 2008, at 20:38, Edward J. Stembler wrote: > For example, when perusing the resources of various apps, I noticed > that some developers use TIFFs, some use PNGs, and some even use > PDFs for images. Personally I'm a big fan of PNG since it supports > alpha-transparencies. I'm just wondering why anyone would use TIFF > if you could use PNG instead? I'm guessing that some use PDFs if > they have their artwork in vector format originally (EPS or AI) and > want to eventually support resolution independence. TIFF has a number of features that PNG doesn't; perhaps the most useful, in this context, is the ability to hold multiple versions of an image with different resolutions (i.e. TIFF can help support resolution independence). If you were using PNG, you'd need to provide multiple files. PDF is pretty much the standard format on Mac OS X for vector graphics. (AI, by the way, in its current form is actually PDF with an extra embedded data stream that lets Illustrator edit the files.) You have to be a little careful using PDF for vector graphics, of course, because some vector programs (Illustrator included) support things that can't be represented in vector form by PDF. As a result, they may rasterise things when they save files as PDF, which can make your PDFs (a) not resolution independent and (b) rather large. Kind regards, Alastair. -- http://alastairs-place.net From ejstembler at ejse.com Wed Jan 23 14:12:55 2008 From: ejstembler at ejse.com (Edward J. Stembler) Date: Wed Jan 23 14:13:06 2008 Subject: Image resource question In-Reply-To: <886A1D11-232D-4825-B8A3-BF8280065BAB@alastairs-place.net> References: <153FD73F-BF89-4C1D-9215-DFA5B775E944@ejse.com> <886A1D11-232D-4825-B8A3-BF8280065BAB@alastairs-place.net> Message-ID: <235EFEB8-8F42-466F-B549-4EFCD8E6B20F@ejse.com> Okay, I see. I've been doing web programming for so long now that I had forgotten that TIFFs (which I never really use) support alpha transparencies and multiple versions. Thanks for the information! On Jan 23, 2008, at 4:35 PM, Alastair Houghton wrote: > On 23 Jan 2008, at 20:38, Edward J. Stembler wrote: > >> For example, when perusing the resources of various apps, I noticed >> that some developers use TIFFs, some use PNGs, and some even use >> PDFs for images. Personally I'm a big fan of PNG since it supports >> alpha-transparencies. I'm just wondering why anyone would use TIFF >> if you could use PNG instead? I'm guessing that some use PDFs if >> they have their artwork in vector format originally (EPS or AI) and >> want to eventually support resolution independence. > > TIFF has a number of features that PNG doesn't; perhaps the most > useful, in this context, is the ability to hold multiple versions of > an image with different resolutions (i.e. TIFF can help support > resolution independence). If you were using PNG, you'd need to > provide multiple files. > > PDF is pretty much the standard format on Mac OS X for vector > graphics. (AI, by the way, in its current form is actually PDF with > an extra embedded data stream that lets Illustrator edit the files.) > > You have to be a little careful using PDF for vector graphics, of > course, because some vector programs (Illustrator included) support > things that can't be represented in vector form by PDF. As a > result, they may rasterise things when they save files as PDF, which > can make your PDFs (a) not resolution independent and (b) rather > large. > > Kind regards, > > Alastair. > > -- > http://alastairs-place.net From shawnce at gmail.com Wed Jan 23 15:18:37 2008 From: shawnce at gmail.com (Shawn Erickson) Date: Wed Jan 23 15:18:41 2008 Subject: Image resource question In-Reply-To: <235EFEB8-8F42-466F-B549-4EFCD8E6B20F@ejse.com> References: <153FD73F-BF89-4C1D-9215-DFA5B775E944@ejse.com> <886A1D11-232D-4825-B8A3-BF8280065BAB@alastairs-place.net> <235EFEB8-8F42-466F-B549-4EFCD8E6B20F@ejse.com> Message-ID: On Jan 23, 2008 2:12 PM, Edward J. Stembler wrote: > Okay, I see. I've been doing web programming for so long now that I > had forgotten that TIFFs (which I never really use) support alpha > transparencies and multiple versions. > > Thanks for the information! man tiffutil -Shawn From dunham at mac.com Wed Jan 23 23:25:24 2008 From: dunham at mac.com (David Dunham) Date: Wed Jan 23 23:25:31 2008 Subject: App delegate in library isn't noticed Message-ID: I had a simple application working, with an application delegate set up in its MainMenu.nib. I'm going to be using this in a number of applications, so I created a Cocoa library (.a file) and put AppDelegate.m there (instead of the simple application project). Now when I launch, I get Unknown class `AppDelegate' in nib file, using `NSObject' instead. I also have main() in the library, and this does work (and successfully calls NSApplicationMain). How come it can find main() but not AppDelegate? David Dunham Voice/Fax: 206 783 7404 http://www.pensee.com/dunham/ Imagination is more important than knowledge. -- Albert Einstein From sstevenson at mac.com Thu Jan 24 03:53:25 2008 From: sstevenson at mac.com (Scott Stevenson) Date: Thu Jan 24 03:53:31 2008 Subject: Image resource question In-Reply-To: <153FD73F-BF89-4C1D-9215-DFA5B775E944@ejse.com> References: <153FD73F-BF89-4C1D-9215-DFA5B775E944@ejse.com> Message-ID: On Jan 23, 2008, at 12:38 PM, Edward J. Stembler wrote: > Which image format is the best to use for my Cocoa apps? What is > the generally preferred format, and are there any limitations I > should know about? There's a good chance PNGs can end up smaller than TIFFs without any loss in quality. It depends a lot on how you save them, of course, but TIFFs are often uncompressed. - Scott From nicktoumpelis at gmail.com Thu Jan 24 05:21:06 2008 From: nicktoumpelis at gmail.com (Nick Toumpelis) Date: Thu Jan 24 05:21:15 2008 Subject: String encoding problem (WSMethodInvocation) Message-ID: <2F024F9D-2A37-44CE-8FF5-F6A89DEA5BC0@gmail.com> Hi all, I'm stuck with a curious string encoding problem. I start with a string in Greek, which is stored using Core Data (an entity with a String property). Later in the execution, I get this string, add it to an NSMutableDictionary which is sent as a callParams argument in WSMethodInvocationSetParameters - as part of a method invocation sent to an XML-RPC web service. As far as I can tell, nothing changes in the string encoding prior to the method invocation. When I print out the string with NSLog, the result is in Greek. Using the print-object command in gdb, I get this: "\U039b\U03b1\U03bb\U03b1". Remotely, the string is not stored properly. The stored value is ???? and that's what I get, when I ask the web service for the same string. However, using another Mac application, the web service gets the string properly. I assume that the method invocation dispatches something that is not a properly formatted UTF-8 string. I might be wrong. Have you ever encountered this? I am doing something wrong? I appreciate any help you can give me. Thanks, Nick Nick Toumpelis :: Software Developer :: BEng (Wales), MSc (Manchester) Thessaloniki, Greece :: email:nick@toumpelis.me.uk :: AIM:nick@toumpelis.me.uk From newsletters at vonBelow.Com Thu Jan 24 06:52:28 2008 From: newsletters at vonBelow.Com (Alex v. Below) Date: Thu Jan 24 07:25:36 2008 Subject: String encoding problem (WSMethodInvocation) In-Reply-To: <2F024F9D-2A37-44CE-8FF5-F6A89DEA5BC0@gmail.com> References: <2F024F9D-2A37-44CE-8FF5-F6A89DEA5BC0@gmail.com> Message-ID: <5D9DC55F-25E3-4D71-BB73-40B1D44BBC5F@vonBelow.Com> Am 24.01.2008 um 14:21 schrieb Nick Toumpelis: > As far as I can tell, nothing changes in the string encoding prior > to the method invocation. When I print out the string with NSLog, > the result is in Greek. Using the print-object command in gdb, I > get this: "\U039b\U03b1\U03bb\U03b1". The display in gdb is correct depending on your terminal settings, but I assume that is what you tried to say. You should be able to get a debug dump of your WSMethod, and look at it there. Also, make sure that the encoding is set correctly in your request. And most importantly: Make sure that the receiving end is honoring the encoding! Alex From ahoesch at smartsoft.de Thu Jan 24 09:19:00 2008 From: ahoesch at smartsoft.de (=?ISO-8859-1?Q?Andreas_H=F6schler?=) Date: Thu Jan 24 09:19:48 2008 Subject: Development on ZFS Message-ID: <740ACBB9-CAA0-11DC-BBF1-000393CA0072@smartsoft.de> Hi all, we have successfully used Apples dev tools (actually ProjectBuilderWO.app but the same problem probably would occur with xCode) on an NFS mounted home dir from a Solaris box. We recently moved our home dirs to ZFS volume on this Solaris host and NFS exported /home with ZFS (it can do that directly). Whenever we try to build a project now we get == Making ApplicationBuilder for ppc == Pre-build setup... /bin/rm -f /home/ahoesch/Development/MacOSX/SmartObjectsPro/ApplicationBuilder/ ApplicationBuilder.build/derived_src/TrustedPrecomps.txt Building... /usr/lib/mergeInfo PB.project CustomInfo.plist /home/ahoesch/Development/MacOSX/SmartObjectsPro/ApplicationBuilder/ ApplicationBuilder.build/derived_src/Java.plist -o /home/ahoesch/Development/MacOSX/SmartObjectsPro/ApplicationBuilder/ ApplicationBuilder.app/Resources/Info-macos.plist Copying English resources... Copying German resources... gnumake: *** [copy-global-resources] Segmentation fault If I copy the complete project directory to a a folder on the local disk (of the Mac) then the build works fine. What could be the problem? Any idea? Thanks a lot! Regards, Andreas From dunham at mac.com Thu Jan 24 09:29:25 2008 From: dunham at mac.com (David Dunham) Date: Thu Jan 24 09:28:54 2008 Subject: App delegate in library isn't noticed In-Reply-To: References: Message-ID: <9A628DC5-C0A6-48F0-90C6-43115ACB8233@mac.com> On 23 Jan 2008, at 23:25, David Dunham wrote: > I had a simple application working, with an application delegate > set up in its MainMenu.nib. > > I'm going to be using this in a number of applications, so I > created a Cocoa library (.a file) and put AppDelegate.m there > (instead of the simple application project). Now when I launch, I get > > Unknown class `AppDelegate' in nib file, using `NSObject' instead. > > I also have main() in the library, and this does work (and > successfully calls NSApplicationMain). > > How come it can find main() but not AppDelegate? I added AppDelegate* a = [AppDelegate alloc]; [a release]; right before the call to NSApplicationMain, and it worked. Are the Cocoa classes from the library getting stripped from the build? (The app is primarily C++.) I didn't see any settings that would do that. David Dunham Voice/Fax: 206 783 7404 http://www.pensee.com/dunham/ Imagination is more important than knowledge. -- Albert Einstein From stephane at sente.ch Fri Jan 25 00:06:42 2008 From: stephane at sente.ch (=?ISO-8859-1?Q?St=E9phane_Corth=E9sy?=) Date: Fri Jan 25 00:06:49 2008 Subject: String encoding problem (WSMethodInvocation) In-Reply-To: <5D9DC55F-25E3-4D71-BB73-40B1D44BBC5F@vonBelow.Com> References: <2F024F9D-2A37-44CE-8FF5-F6A89DEA5BC0@gmail.com> <5D9DC55F-25E3-4D71-BB73-40B1D44BBC5F@vonBelow.Com> Message-ID: <52085344-B915-4750-AD86-C141C35A9171@sente.ch> rdar://problems/4792516 Sent on 19-Oct-2006 WebServicesCore: SOAP messages miss charset information in HTTP header Summary: HTTP header in HTTP requests generated by WebServicesCore, for kWSSOAPBodyEncodingStyle, miss a 'charset=utf-8' key-value in the content-type header. Steps to Reproduce: 1) Using WebServicesCore, create a web invocation, with debug information on. 2) Send the invocation, and wait for result. 3) When receiving results, look at the outgoing headers, in the result dictionary. Expected Results: The header value for 'content-type' should contain the charset used to encode the body, because body is encoded in UTF-8, and without any information in the header, all receivers will decode body using ISOLatin1 charset. Actual Results: If sent body contains non-ASCII characters, body is wrongly decoded using ISOLatin1. Apple never replied to that bug report. Status is still set to open, though it's 15 months old. St?phane On Jan 24, 2008, at 3:52 PM, Alex v. Below wrote: > > Am 24.01.2008 um 14:21 schrieb Nick Toumpelis: > >> As far as I can tell, nothing changes in the string encoding prior >> to the method invocation. When I print out the string with NSLog, >> the result is in Greek. Using the print-object command in gdb, I >> get this: "\U039b\U03b1\U03bb\U03b1". > > The display in gdb is correct depending on your terminal settings, > but I assume that is what you tried to say. > > You should be able to get a debug dump of your WSMethod, and look > at it there. > > Also, make sure that the encoding is set correctly in your request. > > And most importantly: Make sure that the receiving end is honoring > the encoding! > > Alex > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From nicktoumpelis at gmail.com Fri Jan 25 01:22:40 2008 From: nicktoumpelis at gmail.com (Nick Toumpelis) Date: Fri Jan 25 01:22:50 2008 Subject: String encoding problem (WSMethodInvocation) In-Reply-To: <52085344-B915-4750-AD86-C141C35A9171@sente.ch> References: <2F024F9D-2A37-44CE-8FF5-F6A89DEA5BC0@gmail.com> <5D9DC55F-25E3-4D71-BB73-40B1D44BBC5F@vonBelow.Com> <52085344-B915-4750-AD86-C141C35A9171@sente.ch> Message-ID: <0E2261AB-B632-4298-9676-F12C423EF6B0@gmail.com> I assumed that something like this might be the problem, so I overode the serialization procedure with WSMethodInvocationAddSerializationOverride. And it works (more or less). It appears that there is an additional bug with the actual encoding itself. Nick On 25 ??? 2008, at 10:06 ??, St?phane Corth?sy wrote: > rdar://problems/4792516 > > Sent on 19-Oct-2006 > > WebServicesCore: SOAP messages miss charset information in HTTP header > > Summary: > HTTP header in HTTP requests generated by WebServicesCore, for > kWSSOAPBodyEncodingStyle, miss a 'charset=utf-8' key-value in the > content-type header. > > Steps to Reproduce: > 1) Using WebServicesCore, create a web invocation, with debug > information on. > 2) Send the invocation, and wait for result. > 3) When receiving results, look at the outgoing headers, in the > result dictionary. > > Expected Results: > The header value for 'content-type' should contain the charset used > to encode the body, because body is encoded in UTF-8, and without > any information in the header, all receivers will decode body using > ISOLatin1 charset. > > Actual Results: > If sent body contains non-ASCII characters, body is wrongly decoded > using ISOLatin1. > > > Apple never replied to that bug report. Status is still set to open, > though it's 15 months old. Nick Toumpelis :: Software Developer :: BEng (Wales), MSc (Manchester) Thessaloniki, Greece :: email:nick@toumpelis.me.uk :: AIM:nick@toumpelis.me.uk From me at infinite-labs.net Fri Jan 25 07:55:59 2008 From: me at infinite-labs.net (=?UTF-8?B?4oie?=) Date: Fri Jan 25 07:56:09 2008 Subject: App delegate in library isn't noticed In-Reply-To: <9A628DC5-C0A6-48F0-90C6-43115ACB8233@mac.com> References: <9A628DC5-C0A6-48F0-90C6-43115ACB8233@mac.com> Message-ID: <69E9B9AD-B7F8-420B-ACB9-EC1F9304FAF3@infinite-labs.net> Il giorno 24/gen/08, alle ore 18:29, David Dunham ha scritto: > Are the Cocoa classes from the library getting stripped from the > build? (The app is primarily C++.) I didn't see any settings that > would do that. If you have dead code stripping turned on, then it's possible that a thing like this could happen -- just a dummy reference, like [AppDelegate class], should do the trick. - ? From dunham at mac.com Fri Jan 25 10:04:23 2008 From: dunham at mac.com (David Dunham) Date: Fri Jan 25 10:03:10 2008 Subject: App delegate in library isn't noticed In-Reply-To: <69E9B9AD-B7F8-420B-ACB9-EC1F9304FAF3@infinite-labs.net> References: <9A628DC5-C0A6-48F0-90C6-43115ACB8233@mac.com> <69E9B9AD-B7F8-420B-ACB9-EC1F9304FAF3@infinite-labs.net> Message-ID: <25BE044B-0451-4DA9-9F45-81E711075679@mac.com> On 25 Jan 2008, at 07:55, =B0 wrote: >> Are the Cocoa classes from the library getting stripped from the =20 >> build? (The app is primarily C++.) I didn't see any settings that =20 >> would do that. > > If you have dead code stripping turned on, then it's possible that =20 > a thing like this could happen -- just a dummy reference, like =20 > [AppDelegate class], should do the trick. No, it's off everywhere I could see (project and target settings of =20 both application and library). Nor does it make any sense to strip Objective-C classes, does it? You =20= could require them at runtime. David Dunham Voice/Fax: 206 783 7404 http://www.pensee.com/dunham/ Imagination is more important than knowledge. -- Albert Einstein From newsletters at vonBelow.Com Fri Jan 25 10:27:24 2008 From: newsletters at vonBelow.Com (Alex v. Below) Date: Fri Jan 25 10:27:30 2008 Subject: String encoding problem (WSMethodInvocation) In-Reply-To: <0E2261AB-B632-4298-9676-F12C423EF6B0@gmail.com> References: <2F024F9D-2A37-44CE-8FF5-F6A89DEA5BC0@gmail.com> <5D9DC55F-25E3-4D71-BB73-40B1D44BBC5F@vonBelow.Com> <52085344-B915-4750-AD86-C141C35A9171@sente.ch> <0E2261AB-B632-4298-9676-F12C423EF6B0@gmail.com> Message-ID: It does help to file a duplicate of the bug to get it fixed. To make things easy for the screeners, add St?phane's bug ID Alex Am 25.01.2008 um 10:22 schrieb Nick Toumpelis: > I assumed that something like this might be the problem, so I > overode the serialization procedure with > WSMethodInvocationAddSerializationOverride. And it works (more or > less). > > It appears that there is an additional bug with the actual encoding > itself. > > Nick > > On 25 ??? 2008, at 10:06 ??, St?phane Corth?sy wrote: > >> rdar://problems/4792516 >> >> Sent on 19-Oct-2006 >> >> WebServicesCore: SOAP messages miss charset information in HTTP >> header >> >> Summary: >> HTTP header in HTTP requests generated by WebServicesCore, for >> kWSSOAPBodyEncodingStyle, miss a 'charset=utf-8' key-value in the >> content-type header. >> >> Steps to Reproduce: >> 1) Using WebServicesCore, create a web invocation, with debug >> information on. >> 2) Send the invocation, and wait for result. >> 3) When receiving results, look at the outgoing headers, in the >> result dictionary. >> >> Expected Results: >> The header value for 'content-type' should contain the charset >> used to encode the body, because body is encoded in UTF-8, and >> without any information in the header, all receivers will decode >> body using ISOLatin1 charset. >> >> Actual Results: >> If sent body contains non-ASCII characters, body is wrongly >> decoded using ISOLatin1. >> >> >> Apple never replied to that bug report. Status is still set to >> open, though it's 15 months old. > > Nick Toumpelis :: Software Developer :: BEng (Wales), MSc (Manchester) > Thessaloniki, Greece :: email:nick@toumpelis.me.uk :: > AIM:nick@toumpelis.me.uk > > > > > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From nicktoumpelis at gmail.com Fri Jan 25 11:22:08 2008 From: nicktoumpelis at gmail.com (Nick Toumpelis) Date: Fri Jan 25 11:22:19 2008 Subject: String encoding problem (WSMethodInvocation) In-Reply-To: References: <2F024F9D-2A37-44CE-8FF5-F6A89DEA5BC0@gmail.com> <5D9DC55F-25E3-4D71-BB73-40B1D44BBC5F@vonBelow.Com> <52085344-B915-4750-AD86-C141C35A9171@sente.ch> <0E2261AB-B632-4298-9676-F12C423EF6B0@gmail.com> Message-ID: I did file a bug report but I'm not entirely sure that it is duplicate. It can be alleviated using WSMethodInvocationAddSerializationOverride, which deals with the encoding of the string and not the header value for "content-type". Nick On 25 ??? 2008, at 8:27 ??, Alex v. Below wrote: > It does help to file a duplicate of the bug to get it fixed. > > To make things easy for the screeners, add St?phane's bug ID > > Alex > > Am 25.01.2008 um 10:22 schrieb Nick Toumpelis: > >> I assumed that something like this might be the problem, so I >> overode the serialization procedure with >> WSMethodInvocationAddSerializationOverride. And it works (more or >> less). >> >> It appears that there is an additional bug with the actual encoding >> itself. >> >> Nick >> >> On 25 ??? 2008, at 10:06 ??, St?phane Corth?sy wrote: >> >>> rdar://problems/4792516 >>> >>> Sent on 19-Oct-2006 >>> >>> WebServicesCore: SOAP messages miss charset information in HTTP >>> header >>> >>> Summary: >>> HTTP header in HTTP requests generated by WebServicesCore, for >>> kWSSOAPBodyEncodingStyle, miss a 'charset=utf-8' key-value in the >>> content-type header. >>> >>> Steps to Reproduce: >>> 1) Using WebServicesCore, create a web invocation, with debug >>> information on. >>> 2) Send the invocation, and wait for result. >>> 3) When receiving results, look at the outgoing headers, in the >>> result dictionary. >>> >>> Expected Results: >>> The header value for 'content-type' should contain the charset >>> used to encode the body, because body is encoded in UTF-8, and >>> without any information in the header, all receivers will decode >>> body using ISOLatin1 charset. >>> >>> Actual Results: >>> If sent body contains non-ASCII characters, body is wrongly >>> decoded using ISOLatin1. >>> >>> >>> Apple never replied to that bug report. Status is still set to >>> open, though it's 15 months old. Nick Toumpelis :: Software Developer :: BEng (Wales), MSc (Manchester) Thessaloniki, Greece :: email:nick@toumpelis.me.uk :: AIM:nick@toumpelis.me.uk From robertlaferla at comcast.net Fri Jan 25 14:15:03 2008 From: robertlaferla at comcast.net (Robert La Ferla) Date: Fri Jan 25 14:15:08 2008 Subject: NSRunAlertPanel is not responding to Enter In-Reply-To: <7455061B-A313-4B02-8E33-C0C53306B18A@gmail.com> References: <20080110200006.459CDAF740@forums.omnigroup.com> <7455061B-A313-4B02-8E33-C0C53306B18A@gmail.com> Message-ID: On Jan 17, 2008, at 4:37 AM, Christiaan Hofman wrote: > Sounds like really bad practice to override a key feature in a > generic superclass. You should do your override in a subclass. And > otherwise use [super keyDown:]. Yes. He should create a custom subclass of NSWindow and override keyDown: there. He can set the window subclass in InterfaceBuilder for any windows that need it so it won't affect the alert panel. From oplusplus at cox.net Fri Jan 25 15:50:19 2008 From: oplusplus at cox.net (oplusplus) Date: Fri Jan 25 16:00:06 2008 Subject: Development on ZFS In-Reply-To: <740ACBB9-CAA0-11DC-BBF1-000393CA0072@smartsoft.de> References: <740ACBB9-CAA0-11DC-BBF1-000393CA0072@smartsoft.de> Message-ID: You should post this on apples ZFS list. zfs-discuss@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/zfs-discuss On Jan 24, 2008, at 12:19 PM, Andreas H?schler wrote: > Hi all, > > we have successfully used Apples dev tools (actually > ProjectBuilderWO.app but the same problem probably would occur with > xCode) on an NFS mounted home dir from a Solaris box. > > We recently moved our home dirs to ZFS volume on this Solaris host > and NFS exported /home with ZFS (it can do that directly). Whenever > we try to build a project now we get > > == Making ApplicationBuilder for ppc == > Pre-build setup... > /bin/rm -f /home/ahoesch/Development/MacOSX/SmartObjectsPro/ > ApplicationBuilder/ApplicationBuilder.build/derived_src/ > TrustedPrecomps.txt > Building... > /usr/lib/mergeInfo PB.project CustomInfo.plist /home/ahoesch/ > Development/MacOSX/SmartObjectsPro/ApplicationBuilder/ > ApplicationBuilder.build/derived_src/Java.plist -o /home/ahoesch/ > Development/MacOSX/SmartObjectsPro/ApplicationBuilder/ > ApplicationBuilder.app/Resources/Info-macos.plist > Copying English resources... > Copying German resources... > gnumake: *** [copy-global-resources] Segmentation fault > > If I copy the complete project directory to a a folder on the local > disk (of the Mac) then the build works fine. What could be the > problem? Any idea? > > Thanks a lot! > > Regards, > > Andreas > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From ssen at apple.com Fri Jan 25 16:57:44 2008 From: ssen at apple.com (Shantonu Sen) Date: Fri Jan 25 16:58:27 2008 Subject: Development on ZFS In-Reply-To: References: <740ACBB9-CAA0-11DC-BBF1-000393CA0072@smartsoft.de> Message-ID: Why? I don't see how an NFS server running Solaris (with some filesystem backing it) is at all related to Apple's desktop ZFS implementation. If anything this is an NFS issue, or a Solaris issue, or a Solaris ZFS issue. It's not an Apple ZFS issue, because Apple doesn't know what the local filesystem on the server is. Shantonu Sen ssen@apple.com Sent from my Mac Pro On Jan 25, 2008, at 3:50 PM, oplusplus wrote: > You should post this on apples ZFS list. > zfs-discuss@lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo/zfs-discuss > > On Jan 24, 2008, at 12:19 PM, Andreas H?schler wrote: > >> Hi all, >> >> we have successfully used Apples dev tools (actually >> ProjectBuilderWO.app but the same problem probably would occur with >> xCode) on an NFS mounted home dir from a Solaris box. >> >> We recently moved our home dirs to ZFS volume on this Solaris host >> and NFS exported /home with ZFS (it can do that directly). Whenever >> we try to build a project now we get >> >> == Making ApplicationBuilder for ppc == >> Pre-build setup... >> /bin/rm -f /home/ahoesch/Development/MacOSX/SmartObjectsPro/ >> ApplicationBuilder/ApplicationBuilder.build/derived_src/ >> TrustedPrecomps.txt >> Building... >> /usr/lib/mergeInfo PB.project CustomInfo.plist /home/ahoesch/ >> Development/MacOSX/SmartObjectsPro/ApplicationBuilder/ >> ApplicationBuilder.build/derived_src/Java.plist -o /home/ahoesch/ >> Development/MacOSX/SmartObjectsPro/ApplicationBuilder/ >> ApplicationBuilder.app/Resources/Info-macos.plist >> Copying English resources... >> Copying German resources... >> gnumake: *** [copy-global-resources] Segmentation fault >> >> If I copy the complete project directory to a a folder on the local >> disk (of the Mac) then the build works fine. What could be the >> problem? Any idea? >> >> Thanks a lot! >> >> Regards, >> >> Andreas >> _______________________________________________ >> MacOSX-dev mailing list >> MacOSX-dev@omnigroup.com >> http://www.omnigroup.com/mailman/listinfo/macosx-dev > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From oplusplus at cox.net Fri Jan 25 17:43:04 2008 From: oplusplus at cox.net (oplusplus) Date: Fri Jan 25 17:52:50 2008 Subject: Development on ZFS In-Reply-To: References: <740ACBB9-CAA0-11DC-BBF1-000393CA0072@smartsoft.de> Message-ID: Only people I know that know ZFS maybe. Jesus. On Jan 25, 2008, at 7:57 PM, Shantonu Sen wrote: > Why? > > I don't see how an NFS server running Solaris (with some filesystem > backing it) is at all related to Apple's desktop ZFS implementation. > > If anything this is an NFS issue, or a Solaris issue, or a Solaris > ZFS issue. It's not an Apple ZFS issue, because Apple doesn't know > what the local filesystem on the server is. > > Shantonu Sen > ssen@apple.com > > Sent from my Mac Pro > > On Jan 25, 2008, at 3:50 PM, oplusplus wrote: > >> You should post this on apples ZFS list. >> zfs-discuss@lists.macosforge.org >> http://lists.macosforge.org/mailman/listinfo/zfs-discuss >> >> On Jan 24, 2008, at 12:19 PM, Andreas H?schler wrote: >> >>> Hi all, >>> >>> we have successfully used Apples dev tools (actually >>> ProjectBuilderWO.app but the same problem probably would occur >>> with xCode) on an NFS mounted home dir from a Solaris box. >>> >>> We recently moved our home dirs to ZFS volume on this Solaris host >>> and NFS exported /home with ZFS (it can do that directly). >>> Whenever we try to build a project now we get >>> >>> == Making ApplicationBuilder for ppc == >>> Pre-build setup... >>> /bin/rm -f /home/ahoesch/Development/MacOSX/SmartObjectsPro/ >>> ApplicationBuilder/ApplicationBuilder.build/derived_src/ >>> TrustedPrecomps.txt >>> Building... >>> /usr/lib/mergeInfo PB.project CustomInfo.plist /home/ahoesch/ >