Re: looks like my syntax is wrong. Does not compile

2009-07-04 Thread John C. Randolph
On Jul 3, 2009, at 9:29 PM, Agha Khan wrote: NSNumber* aNumber = [Aobject _Edge] numberWithInt:j; // looks like my syntax is wrong. Does not compile Objective-C isn't smalltalk. All message expressions have to be enclosed in square brackets: NSNumber* aNumber = [[Aobje

Re: Send files from iphone

2009-07-04 Thread Peter Mulholland
Hello Development, Saturday, July 4, 2009, 3:20:45 AM, you wrote: > I need to be able to upload the data from a UIImage to a server via > http POST however I simply cannot find a good example of how to > arrange the headers or how to make this post. > The only data I need to send to the serve

NSData. add 6 bytes to NSData

2009-07-04 Thread Carlo Gulliani
Hi, everybody, I need to add 6 bytes to my NSData steps: 1. write into NSData NSData *data = [NSData dataWithBytes:(const char*)&packet length:sizeof(packet)]; 2. read from NSData 3. In loop i need to add 6 bytes 4. And again wtite into NSData first step i did, and from 2 to 4 i dont know how

Re: NSData. add 6 bytes to NSData

2009-07-04 Thread Peter Mulholland
Hello Carlo, Saturday, July 4, 2009, 12:47:31 PM, you wrote: > Hi, everybody, I need to add 6 bytes to my NSData > steps: > 1. write into NSData > NSData *data = [NSData dataWithBytes:(const char*)&packet > length:sizeof(packet)]; > 2. read from NSData > 3. In loop i need to add 6 bytes > 4.

Re: Send files from iphone

2009-07-04 Thread Jesse Armand
I'm not quite sure about whether "Available in Mac OS X version 10.1 and later" means that it's not available in iPhone OS. But, I assume everything that exists on iPhone OS reference library, exists on iPhone OS, because that's also the case with NSURLConnection, which obviously exists on iPhone

NSLinkAttributeName: can I control the visual presentation?

2009-07-04 Thread Stuart Malin
I have a mutable attributed string that is displayed in an NSTextView. For a certain range, I set several attributes, including NSLinkAttributeName. However, the presentation shows as blue underlined text even though I have set other attributes for the font color and also have set the under

leaking UIColor objects

2009-07-04 Thread WT
Hello all, my iPhone OS 3.0 app uses UIColor objects to set the colors of various objects (text colors of labels, cell view backgrounds, and segmented control tint colors), but I *never* store any of these colors as ivars. In other words, I *only* do things like label.textColor = [UIColor

leaking UIColor objects (correction)

2009-07-04 Thread WT
Actually, Leaks reports that my app is leaking UICGColor objects, not UIColor objects. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-adm

Re: leaking UIColor objects

2009-07-04 Thread Fritz Anderson
On 4 Jul 2009, at 8:27 AM, WT wrote: And, yes, I realize that discussing beta releases is a no-no. I'm not asking for a discussion; I'm merely asking for a "I'm having that problem too and I've already filed a radar" or "Yes, this looks like a bug and you should report it" or a "No, it must

Re: NSLinkAttributeName: can I control the visual presentation?

2009-07-04 Thread Jim Correia
On Jul 4, 2009, at 9:18 AM, Stuart Malin wrote: I have a mutable attributed string that is displayed in an NSTextView. For a certain range, I set several attributes, including NSLinkAttributeName. However, the presentation shows as blue underlined text even though I have set other attribute

Re: Send files from iphone

2009-07-04 Thread Alex Kac
CoreFoundation exists on the iPhone. And you can look at cocoadev.org for a decent HTTP Post example there or look on Google code for a class that does Flickr uploads through HTTP Post and that works on the iPhone. HTTP Post is not hard, but it does expect a very specific way of doing it.

Re: NSData. add 6 bytes to NSData

2009-07-04 Thread Carlo Gulliani
thanks for your reply, could you show me simple example how to add binary data to existing data and also to add header of 2 bytes i've been trying to use buffer but i have a troubles with result my code: #define PROTO_VERSION_MAJOR 1 #define PROTO_VERSION_MINOR 7 #define PROTO_VERSION

Re: leaking UIColor objects

2009-07-04 Thread WT
On Jul 4, 2009, at 4:37 PM, Fritz Anderson wrote: On 4 Jul 2009, at 8:27 AM, WT wrote: And, yes, I realize that discussing beta releases is a no-no. I'm not asking for a discussion; I'm merely asking for a "I'm having that problem too and I've already filed a radar" or "Yes, this looks li

Re: NSData. add 6 bytes to NSData

2009-07-04 Thread Scott Andrew
In all honesty the easiest way is to do it in C. Add a 4 byte variable to the top of your packet header.. When building the packet set it to 0.. That solves your problem of getting data into the packet. But if you want to add something to the beginning, using NSMutableData, you have to firs

Re: [Moderator] Re: Securely limit the running an application by serial number

2009-07-04 Thread Ammar Ibrahim
I don't see how this is a "business" question, it's very technical. On Sat, Jul 4, 2009 at 7:23 AM, Scott Anguish wrote: > the discussion of software protection is off-limits for this list. take to > to the mac small business list. > > [moderator] > > > On 2009-07-03, at 6:48 PM, Peter Mulhollan

Re: NSData. add 6 bytes to NSData

2009-07-04 Thread Adam R. Maxwell
On Jul 4, 2009, at 10:56 AM, Scott Andrew wrote: In all honesty the easiest way is to do it in C. Add a 4 byte variable to the top of your packet header.. When building the packet set it to 0.. That solves your problem of getting data into the packet. But if you want to add something to

Re: NSData. add 6 bytes to NSData

2009-07-04 Thread Greg Guerin
Carlo Gulliani wrote: typedef struct mrim_packet_header_t { u_long magic; Your use of u_long as a 32-bit value will likely fail if your code is ever compiled for 64-bit. You should use the typedef'ed names that have an explicit size-number in them, like uint32_t, uint64_t. NSM

Re: [Moderator] Re: Securely limit the running an application by serial number

2009-07-04 Thread Scott Anguish
It's something that has been over and over on this list in the past. The discussion of software protection and licensing schemes simply belongs there. There is a Yahoo Group for discussion of business-related issues at: [moderator] On 2009-07

Unit Testing and Run Loops

2009-07-04 Thread Jamie Hardt
Hello all, I've looked around for writing about this, but I can't really find anybody who has declared the absolutely right solution to this problem. I'm using the SenTesting kit and writing a class that initiates a web download, async using the run loop. How can I write a unit test that

Fwd: Unit Testing and Run Loops

2009-07-04 Thread Jamie Hardt
Thanks, I dimly recall seeing something like this before... On Jul 4, 2009, at 12:19 PM, A.M. wrote: On Jul 4, 2009, at 3:10 PM, Jamie Hardt wrote: [...] But does anyone know how to setup something like a stream read or URL download, and make sure run loop completely services the download

Re: Animation Did Stop - Works For OS3 but not OS2.2

2009-07-04 Thread Conrad Taylor
Hi, I would highly recommend that you move this thread to the iPhone Developer Forums. This is the Cocoa Dev mailing list. -Conrad On Fri, Jul 3, 2009 at 3:37 PM, Dave DeLong wrote: > Hi Chunk, > > You're missing the third parameter of the selector (the context parameter). > Also, I believe t

Re: NSString stringWithFormat: and strings

2009-07-04 Thread Mac First
On Jul 3, 2009, at 8:27 PM, Andy Lee wrote: On Jul 3, 2009, at 11:20 PM, KK wrote: Hello, I have a NSString (from a property list file) that has the %@ formats in it... So.. I do something like this: NSString *stringFromPlistFile; NSString *newString = [NSString stringWithFormat:stringFrom

Can we pass pointer of a class to a function?

2009-07-04 Thread Agha Khan
I am passing a valid data pointer to a function and I am getting exception. Before I go further I just like to know if it is possible? -Agha ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comm

Re: Movable Document Modal Dialogs

2009-07-04 Thread Matt Neuburg
On Fri, 3 Jul 2009 14:23:04 -0400, Development said: > For our application (think of it as a >drawing program), the user sometimes NEEDS to be able to view the >document under the modal dialog. We can not use sheets, because they >cover up the document window itself. Not necessarily. It is a del

Re: Can we pass pointer of a class to a function?

2009-07-04 Thread Kyle Sluder
On Jul 4, 2009, at 2:53 PM, Agha Khan wrote: I am passing a valid data pointer to a function and I am getting exception. Before I go further I just like to know if it is possible? Short answer, yes. Classes are objects too. But classes aren't always appropriate arguments to a method. You nee

Re: Sorting an editable tableView of managed object

2009-07-04 Thread Matt Neuburg
On Fri, 03 Jul 2009 17:00:59 -0500, Steve Cronin said: >Folks; > >I have a simple one column tableView of a managed object. >The text field in the table view is editable. >I want to keep the table sorted when the user manually changes a value, > //there is NO binding to a sortDesctiptor Why not?

Re: Sorting an editable tableView of managed object

2009-07-04 Thread Steve Cronin
Matt; Thanks that did the trick! I didn't add the binding because I only want to add bindings when I understand the value of doing so. In this case the table column headers all performed their various sorts as expected without the bindings - hence no bound sortDescriptors. Adding the bindi

Yet another memory management question

2009-07-04 Thread DKJ
Is this the right way to do it? - (void)viewDidLoad { id myObject = [[NSObject alloc] init]; } - (void)viewDidUnload { [myObject release]; myObject = nil; } - (void)dealloc { [myObject release]; } ___ Cocoa-dev mailing list (Cocoa-dev@lis

Re: Optimizing writes of big files for specific hardware?

2009-07-04 Thread Michael Ash
On Fri, Jul 3, 2009 at 5:07 PM, Jay Reynolds Freeman wrote: > On Jul 3, 2009, at 1:20 PM, Greg Guerin wrote: > >> [useful comments excised, thank you very much] > > I will try lseek and write at the end. > >> Exactly what problem is solved by initially writing multiple >> gigabytes of zeros to disk

Re: Yet another memory management question

2009-07-04 Thread WT
On Jul 5, 2009, at 4:39 AM, DKJ wrote: Is this the right way to do it? Not quite... - (void)viewDidLoad { id myObject = [[NSObject alloc] init]; } Your myObject is a local variable, so it will go out of scope when viewDidLoad returns. That means you won't be able to refer to the obj

Re: Yet another memory management question

2009-07-04 Thread DKJ
In fact I'm now going through my code line-by-line, checking all the alloc, retain, copy etc. statements. While doing so I've come across another thing that puzzles me. Xcode very kindly provides template code when I create new files for classes like UIViewController. (But this is still a C

Re: Yet another memory management question

2009-07-04 Thread WT
On Jul 5, 2009, at 5:34 AM, DKJ wrote: In fact I'm now going through my code line-by-line, checking all the alloc, retain, copy etc. statements. While doing so I've come across another thing that puzzles me. Xcode very kindly provides template code when I create new files for classes like

Re: Yet another memory management question

2009-07-04 Thread mmalc Crawford
On Jul 4, 2009, at 8:11 PM, WT wrote: The following is ok, though, assuming that you have appropriately declared myObject in your class (for example, as an instance variable): - (void)viewDidLoad { myObject = [[NSObject alloc] init]; } In general, this is not recommended. If you manipu

Re: Yet another memory management question

2009-07-04 Thread DKJ
On 4-Jul-09, at 21:10 , mmalc Crawford wrote: you should use accessor methods rather than direct variable manipulation Would declaring all the variables as properties, and then synthesising them, take care of this? If so, what should I do in dealloc for those variables? For example, suppo

Re: Yet another memory management question

2009-07-04 Thread mmalc Crawford
On Jul 4, 2009, at 9:31 PM, DKJ wrote: On 4-Jul-09, at 21:10 , mmalc Crawford wrote: you should use accessor methods rather than direct variable manipulation Would declaring all the variables as properties, and then synthesising them, take care of this? Strictly, this is an orthogonal is

Re: Yet another memory management question

2009-07-04 Thread WT
On Jul 5, 2009, at 6:10 AM, mmalc Crawford wrote: On Jul 4, 2009, at 8:11 PM, WT wrote: The following is ok, though, assuming that you have appropriately declared myObject in your class (for example, as an instance variable): - (void)viewDidLoad { myObject = [[NSObject alloc] init]; }

Re: Yet another memory management question

2009-07-04 Thread mmalc Crawford
On Jul 4, 2009, at 9:40 PM, WT wrote: In general, this is not recommended. If you manipulate an instance variable anywhere other than in an initialiser or a dealloc method, you should use a suitable accessor method. - (void)viewDidLoad { id anObject = [[NSObject alloc] init]; [self set

Re: Yet another memory management question

2009-07-04 Thread WT
On Jul 5, 2009, at 6:53 AM, mmalc Crawford wrote: Indeed. That's the problem with copy/paste and doing things in Mail, rather than from real code, ie, sometimes we all make silly mistakes. Not an earth-shattering mistake to make in this list, though, since you get a warning when trying to c

EXC_BAD_ACCESS on returning an int?

2009-07-04 Thread Ian Havelock
Hi All, I've just started to learn my way around Cocoa but I've come across an error message that I don't understand and googling hasn't really shed any light on the subject. I have defined a simple polygon class with 3 int's, called PolygonShape. When debugging I can see that I am setti

[modeator] Re: leaking UIColor objects

2009-07-04 Thread Scott Anguish
discussion of beta releases does violate your NDA. Further issues will be handled by WWDR Hello all, my iPhone OS 3.0 app uses UIColor objects to set the colors of various objects (text colors of labels, cell view backgrounds, and segmented control tint colors), but I *never* store any of

Re: EXC_BAD_ACCESS on returning an int?

2009-07-04 Thread Andrew Merenbach
Hi, Ian, From a cursory glance, the issue would likely be that you're using %@ in your NSLog statements, rather than %i or %d. %@ is used for NSObjects, generally NSStrings. You'll want to replace that with %i or %d since your -numberOfSides and other methods are returning int values.

Re: EXC_BAD_ACCESS on returning an int?

2009-07-04 Thread mmalc Crawford
On Jul 4, 2009, at 5:39 PM, Ian Havelock wrote: For future reference, in many cases EXC_BAD_ACCESS can be indicative of a memory management problem. Here, however, you are asking NSLog to print int values as objects ('%@' is the format specifier for an object): NSLog(@"Number of Sides:

Re: EXC_BAD_ACCESS on returning an int?

2009-07-04 Thread Andrew Farmer
On 4 Jul 2009, at 17:39, Ian Havelock wrote: @synthesize numberOfSides; @synthesize minimumNumberOfSides; @synthesize maximumNumberOfSides; - (int)numberOfSides { return numberOfSides; } - (void)setNumberOfSides:(int)value { numberOfSides = value; } Let me guess: does

Re: EXC_BAD_ACCESS on returning an int?

2009-07-04 Thread mmalc Crawford
On Jul 4, 2009, at 11:43 PM, Andrew Farmer wrote: - (int)numberOfSides { return numberOfSides; } - (void)setNumberOfSides:(int)value { numberOfSides = value; } Let me guess: does your stack trace (type "tb" in the gdb console) indicate infinite recursion? Either synthe