objective-c

GUI wrapper for Perl command line app on OSX

I wrote a Perl application which I run on the terminal using command lines. I created aliases for the various command options in the shell to reduce the typing. Even so, having a GUI to to select the various commands and other arguments would make it easier to run the app. What's a good approach to developing the GUI wrapper on OSX?...

Kill process after launching with AuthorizationExecuteWithPrivileges

If I launched a shell script using AuthorizationExecuteWithPrivileges what would be the easiest way to kill the script and any other processes that it spawned. Thanks ...

NSMutableArray from filterUsingPredicate error

I am trying to return a subset of my NSMutableArray (MessageArray) with the following code. MessageArray contains an NSDictionary, one of the keys being FriendStatus. I get a strange error which I know is a DUH syntax issue. "error. void value not ignored as it ought to be". -(NSMutableArray*)FriendMessageArray { NSPredicate *pred...

Positioning MKMapView to show multiple annotations at once

I've got several annotations I want to add to my MKMapView (it could 0-n items, where n is generally around 5). I can add the annotations fine, but I want to resize the map to fit all annotations onscreen at once, and I'm not sure how to do this. I've been looking at -regionThatFits: but I'm not quite sure what to do with it. I'll post ...

Table view not updating according to bindings

This is a very newbie question, and this is something I have done many times before, but there's something I'm missing this time. In my AppDelegate.h file I declare an NSArray and set it as a property: @interface AppDelegate : NSObject { NSArray *lines; } @property(readwrite, retain) NSArray *lines; @end And then in the AppDelegate...

Accessing Apple SDK Documentation

I'm trying to write a command line script to access Apple SDK docsets (like perldoc for perl or ri for ruby). Apple has a tool called docsetutil which will let you search a docset, but it is very limited (for example, you can't do a partial search). Is there a more powerful way to access the docs without having to manually parse the HTML...

pass variable to segmented control's action

I have a segment control that when one of the segments is clicked I want to pass variables (two integers to be specific) to the segmented control's action. How do I modify the below code to do so? I know how to go to the segment action but I don't know how to pass variables to it. I know this is probably obj-C 101 but I'm stumped. Tha...

Undocumented iPhone APIs - Discovery and Use

There are a handful of iPhone apps out there doing some behind-the-scenes trickery with undocumented APIs, with effective results. 1) How would I go about getting a listing of undocumented iPhone APIs? 2) Are there third-party off-the-cuff documentation for some of these APIs? ...

How to avoid a NSCachedImageRep

I'm working with an NSImage which comes from a PDF. When I initially create the image, it has only one NSImageRep and that is NSPDFImageRep. This is good. I can work with it. I can find out how many pages it has, and go to a specified page, and draw it, etc. The problem is that as soon as I turn my back, it gets turned into a NSCachedIm...

iPhone UIButton Multiple Clicks Problem

Hi...I have an UIButton, which logs the content that is present in a couple of UITextField's.But when I click on this UIButton thrice, the simulator hangs and the debugger is opened. Can someone tell me why is this happening. It happens only when there is content in UITextFields. ...

NSURLConnection Never finish.

Hi, i have the next code: NSURL *url = [NSURL URLWithString:@"http:...."]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; NSString *msgLength = [NSString stringWithFormat:@"%d", [""soapMessage"" length]]; [theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"]; [theRequest addVa...

Cross-user and cross-process shared settings

I have two processes - a user process and a root-level LaunchDaemon. I'd like both processes to have shared settings. I've tried getting this to work via a sqlite database, but have run into corruption issues. I've thought about using NSUserDefaults, but the NSGlobalDomain seems to only be global for the user, and I need a cross-user ...

Best method of secure Objective-C iPhone login

I wanted to know, the best methodology (with code sample please) of having a login feature on an iPhone application, that would connect to a server. I am assuming web service sending via SOAP isn't the safest. Thanks guys ...

How to take these parameters the same way this function does?

For example: - (BOOL)compare:(NSDecimal)leftOperand greaterThan:(NSDecimal)rightOperand { NSComparisonResult result = NSDecimalCompare(&leftOperand, &rightOperand); // rest not important } like you can see, the method just receives these two types of NSDecimal, leftOperand and rightOperand. Then it passes them on to a C API fu...

[Objective c] create a directory in the iPhone

What's wrong with that? #define AUDIO_NOTES_FOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/myApp/Pictures"] NSFileManager *NSFm= [NSFileManager defaultManager]; BOOL isDir=YES; if(![NSFm fileExistsAtPath:FILEPATH isDirectory:&isDir]) if(![NSFm createDirectoryAtPath:FILEPATH attributes:nil]) NSLog(@"E...

error: property 'myBoolVariableName' with 'retain' attribute must be of object type

I have a BOOL value inside my @interface definition in my .h file. Here it is below. It has the same problem whether it's a pointer or not. @interface myCustomViewController : UIViewController <UIWebViewDelegate> { { //...more iboutlets defined above BOOL *myBoolVariableName; } When I compile, I get "error: property 'myBoolVariabl...

What is the Objective-C equivalent of a public get/protected set property in C#

Is there any way to create a property like this C# property in Objective-C? public int prop { get; protected set;} Essentially, I want to make it possible to get the value from outside the class, but to only be able to set the value from within the class. ...

How to call the method that would have been called if the delegate weren't there

I am implementing an optional delegate method on the Cocoa Touch API. What I would like to do is, first call the method that would have been called if I didn't implement the delegate ... then make changes to the result ... then return my modified version. Here's an example: - (UIView *)tableView:(UITableView *)tableView viewForHeaderIn...

NSThread, NSTimer and AutoreleasePools in an iPhone SDK application

Hello every one, I want to create an appilication in iPhone in which I want to use NSThread. I have created one thread using [NSThread detachNewThreadSelector:@selector(doThread:) toTarget:self withObject:nil]; I want that my one thread will handle all the touches and other user interaction and the second thre...

Table crashes when sorting the data multiple times

I have a tableview with a navigationBar with a segmentedControl on the top of the view. I have set up the segmentedControl with buttons that sort the table by either "FirstName" or "LastName". It works perfectly the first 2-4 of times you press the sorting buttons, but then the app crashes. The debugger and console seem to be of no hel...