Re: [Pyobjc-dev] Using C Datatypes
Brought to you by:
ronaldoussoren
From: Jan-Hendrik H. <j-h...@tu...> - 2009-10-09 23:42:54
|
Hi Ronald, Ronald Oussoren schrieb: > - how does it not work? > - and on which os-release? I am using the Iphone, this might be the problem. This is my code: self.stream=NSOutputStream.alloc().initToFileAtPath_append_(self.pathToFile,YES) self.stream.open() Works great so far. Empty file is created. stream.write_maxLength_("test",4) App crashes here > - which version of pyobjc are you using? 1946-3 Jan > Ronald > > > > On 9 okt 2009, at 20:04, Jan-Hendrik Hanne <j-h...@tu...> wrote: > >> Hi! >> >> Ronald Oussoren wrote: >>> On Friday, October 09, 2009, at 04:53PM, "Jan-Hendrik Hanne" >>> <j-h...@tu...> wrote: >>>> Hi! >>>> >>>> Maybe this question was answered before, but I couldn't find it in >>>> the archive. >>>> How can I use C data types in Python? >>>> Concrete: I want to use >>>> - (NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)length >>>> of the NSOutputStream class. >>>> How can I create the buffer? >>> The buffer should be a python string, or another type that implements >>> the buffer protocol (an array.array of bytes should therefore also >>> work). >>> That is: >>> aStream.write_maxLength_("hello world", 10) >> >> Thank you for your fast answer. Unfortunately, it doesn't work with a >> string. I decided to write the file in the python way. Hopefully it is >> fast enough. >> >> Jan >> >>> Ronald >>>> Thanks >>>> Jan >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >>>> is the only developer event you need to attend this year. Jumpstart >>>> your >>>> developing skills, take BlackBerry mobile applications to market and >>>> stay ahead of the curve. Join us from November 9 - 12, 2009. >>>> Register now! >>>> http://p.sf.net/sfu/devconference >>>> _______________________________________________ >>>> Pyobjc-dev mailing list >>>> Pyo...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >>>> >>>> >> > -- Jan-Hendrik Hanne Mittelweg 94 38106 Braunschweig Tel: 0531/2889855 |