objective-c

Iphone SDK Utility Application template has leak

Hi, i'm only create an project with a Utility Application template. This template has a native memory leak when i push "info button" to flip the view. Anyone know how can i fix this leak ??? I just make an new project from this template, i don't add new objects. ...

Why is my UIImageView blurred?

I have a really weird problem with UIImageView. I have an image (an RGB png) 45x45 pixels which I add to the view. I can see that image is blurred after added to the view. Here is the same image in the simulator (left) and in Xcode (right): I have custom UIImageView class with this initWithImage code: - (id) initWithImage:(UIImage*) ...

Adding badges to file icons in Finder

I'm working on a small project at home that would add a badge (aka icon overlay) to a specific file based on its state. Anyway, I've Googled the hell out of it and the only documentation I was able to find was on Apple's developers site (Obtaining and Using Icons With Icon Services). The documentation expects the developer to be familia...

Trouble converting a byte array on the iphone...

I'm having a little dilemma with an iphone project. I'm getting some JSON data from a webservice. I can deserialize it into a dictionary OK. One of the dictionary values is a binary (a picture), but my JSON library deserializes it as an NSArray of NSDecimalNumbers! How do I convert this NSArray of NSDecimalNumbers to an NSData object, ...

Partial Get request using NSURLMutableRequest

I am having trouble trying to do a partial get request using NSURLMutableRequest. I set up the header values as follows: NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:url]; NSString* range = [NSString stringWithFormat:@"bytes %d-%d/%d", receivedContentLength, expectedContentLength, expectedContentLength]; [request ...

How do I disable Preview Icon using objective-c

How do I disable the "Show icon preview" checkbox in Finder using objective-c (see screenshot). I want to disable it for specific folders, not system wide. ...

Reading a pointer from XML without being sure the relevant Obj-C instance exists

I have a "parent" Obj-C object containing (in a collection) a bunch of objects whose instance variables point to one another, possibly circularly (fear not, no retaining going on between these "siblings"). I write the parent object to XML, which of course involves (among other things) writing out its "children", in no particular order, a...

SHowing Actvity Indicator View Using Thread Shows This Error in gdb?

i m using this on uitableviewcell's didselectrow method [NSThread detachNewThreadSelector:@selector(showMyWaitView) toTarget:self withObject:nil]; it works fine but it shows error in gdb like this 2009-08-10 12:45:01.313 FlashCards[1209:6307] * _NSAutoreleaseNoPool(): Object 0x458200 of class UIView autoreleased with no pool in place...

Problem mixing Objective-C and C++ code

I have an Objective-C/C++ application which uses functionality that is provided by a C++ library. One of the C++ classes includes an enum like this: class TheClass { public: [...] enum TheEnum { YES, NO, }; [...] }; Including (using #import -if that matters-) a header file with the above class declaration in an Objective-C/...

Append NSData to a file in Objective C

Hiya, I'm attempting to download a large file on the iPhone and save it to disk as it is downloaded. Ideally, in: -(void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data { } I want to append 'data' to a file on disk. I've checked out the NSData documentation. There are functions to write to a file, but I can't ...

Overriding / Swizzling methods from an existing shared delegate

Is it possible to override ONLY CERTAIN functions from an exisiting delegate, without ourself being a delegate totally? I tried replacing the target IMP with mine, didn't work :'( More detail: +[SomeClass sharedDelegate] -[sharedDelegate targetMethodToBeOverridden:Arg:] //OUR method needs to be called, not this Method *targetMetho...

Is there memory leakage when reassigning a variable?

Suppose I have a variable that's already been initialized to a string via an alloc/init combination. Will I have memory leakage if I reassign it via processing, ie. NSString *s = [[NSString alloc] initWithString:someOtherStringVariable]; s = [s stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; Has th...

Cocoa automated WebView

Howdy, I looking into making a kind of robot testing browser. Like Selenium, but one that we can use to make full integration tests of our site. I'm wondering if it's possible to create a Cocoa app that loads up a web page in a WebView and they programmatically sends click events. I realize you could use: - (NSString *)stringByEvaluati...

NSTextView won't respond to setString

I'm new to Cocoa, and I've been having a problem that is absolutely maddening. I'm trying to write a simple NSString to an NSTextView, and for some reason it just won't respond. No compiler warnings, no runtime errors, just a blank textview. I'm able to use other methods of NSTextView like selectAll, delete, setSelectedRanges, etc. ...

How to create a a webservice proxy in an iPhone application

Hello all, I want to call a webservice from an iPhone application. How to create a proxy for a webservice, as visual studio does it for us. Also Is there any other way around to access the SOAP XML webservice. ...

Drawing an image in a NSView

I have a simple Obj C program that, at the moment, lets you load an image, draws it up, and theoretically should let you zoom and rotate. I'm using NSAffineTranslations. I want the image to be locked to the upper left (As opposed to the PS/PDF standard of lower left), so I'm using isFlipped, and calling [afTrans scaleXBy:1.0 yBy:-1.0]; ...

How do I make a Multidimensional Array for large data storage in Obj-c?

I am fairly new at object oriented programming (but am starting to pick up fairly quickly), and am working on an application for the iphone. I need to make a multidimensional array, (10,000 or more rows, 8 collums) ordered as such:3 collums should contain boolean values, one should contain an integer, two need to hold GPS coordinates (us...

Parameters hide instance variables in Objective-C

Is there a way to give a parameter to a method the same name as an instance variable in Objective-C without hiding that variable? For instance, - (void)doSomething:(id)object { self.object = object; } The code above gives the warning "local declaration of 'object' hides instance variable." The obvious solution is to name the para...

What's the difference between using obj-c accessors and using dot syntax?

Since I've started on iPhone development I've been kinda confused as to which is the best way to access data as a member in a Class. Let's say I have a class called MyClass, and in it I have: @interface MyClass : NSObject { int myInt; } @property (nonatomic, assign) int myInt; In the implementation, is it better to do this: myO...

Objective C : How to send Email w/ attachment with iPhone OS v2.2.1 ?

Objective C : How to send Email w/ attachment with iPhone OS v2.2.1 ? I don't really want to setup a web server for this purpose as described in http://www.drobnik.com/touch/2009/06/sending-e-mail-attachments/ Many thanks for reading ...