objective-c

What are some unique uses of NSLog you have used?

Do you have any unique or special uses of NSLog you use for debugging? ...

UIPickerview customisation

I would like to do some customization of the UIPickerView. End Goal: have a picker view rotating a few icon sized images. firstly i would like to change the black/grey boarder surrounding the spindle to a transparent colour. i.e. [UIColor clearColor]; Then shrink the picker view down so it is relatively small, (probably around 40 x 40...

How do I override NSError presentation when bindings is involved?

One thing I've always had trouble with in Cocoa Bindings has been error presentation, for example when the user types the wrong value into a text field with a formatter attached. Normally I would override willPresentError: somewhere in the responder chain, but my problem is the NSError objects created by the Bindings system doesn't conta...

What are the advantages of objective c over c++?

Hi, Can you please tell me what are the advantages of objective c over c++? After reading objective c programming guide? i think c++ have the same if not similar features. And why project like Webkit needs to use both c++ and objective c? My understanding is the Webkit common code is in c++ whereas the MacOS specified part is in object...

iphone cocoa "error:request for member ____ in something not a structure or union"

this way works: type1ViewController *viewController = [[type1ViewController alloc] initWithNibName:@"Type1View" bundle:nil]; viewController.parentViewController = self; self.type1ViewController = viewController; [self.view insertSubview:viewController.view atIndex:0]; [viewController release]; but this way gives me the error, "request...

iPhone: Convert date string to a relative time stamp

I've got a timestamp as a string like: Thu, 21 May 09 19:10:09 -0700 and I'd like to convert it to a relative time stamp like '20 minutes ago' or '3 days ago'. What's the best way to do this using Objective-C for the iPhone? ...

Why does NSError need double indirection? (pointer to a pointer)

This concept seems to trouble me. Why does an NSError object need its pointer passed to a method that is modifying the object? For instance, wouldn't just passing a reference to the error do the same thing? NSError *anError; [myObjc doStuff:withAnotherObj error:error]; and then in doStuff: - (void)doStuff:(id)withAnotherObjc error:(...

How do you make a Outline View Re-Orderable like a Table View?

How would you make a Outline view able to be re-ordered (dragging to move the position of a row) like a Table View. At the moment when I try and Drag a row it just selects other rows. How can I make It re-orderable? ...

Cocoa: I need help with some code?

Hello, I was going through some code that I downloaded off the internet (Got it here) I am confused with this line of code... What exactly is it doing? #define N_RANDOM_WORDS (sizeof(randomWords)/sizeof(NSString *)) Here is the array of "randomWords": static NSString *randomWords[] = { @"Hello", @"World", @"Some", @"Random", @"Word...

How to do string manipulation in an NSValueTransformer?

I have a table column that I'm binding to a value in an NSArrayController. What I'm trying to do is display only a substring of the actual value in the array controller. The way I've been trying to do that so far is by creating an NSValueTransformer subclass, and then doing the string manipulation in the transformedValue method. Howev...

Analyze SSL certificate programatically or via commandline

Hey there, I'ld like to analyze the certificate of a given url and get some details of it. Do you know any ways to do this? A command-line tool can be something like downloadSSLCert https://my.funny.url/ > certFile and then analyzing it for e.g. the fingerprint of the cert. It can be a command line utility, a c/c++/objective-c or java c...

How to use performSelector:withObject:afterDelay: with primitive types in Cocoa?

Hi, The NSObject method performSelector:withObject:afterDelay: allows me to invoke a method on the object with an object argument after a certain time. It cannot be used for methods with a non-object argument (e.g. ints, floats, structs, non-object pointers, etc.). What is the simplest way to achieve the same thing with a method with a ...

how can i add a right click menu to finder

how can i add a custom view to the right click menu of every file in os x finder? e.g. i want to display the image if it is an image type and do some custom action etc. is this possible with c or objective-c? if yes how? (without using any available tool) ...

Detecting iPhone camera orientation

I'm getting inconsistent results depending on whether I get the image directly from the camera in the callback or choosing it from the camera roll. In the UIImagePickerControllerDelegate callback method, the UIImage.imageOrientation comes up as UIImageOrientationRight no matter how the photo is taken. When reading it off the Camera Ro...

Unable to Compile Objective C using Gnustep on windows

Hi i am a beginner learning objective c. i am finding an error "hello.m:1:34: Foundation/Foundation.h: No such file or directory" i came to know that i need to make a make file may i know how to make the make file please ...

Using UINavigationController with UIViewControllers instances of the same class, and no NIB

While trying out an experimental UINavigationController-based iPhone application, I ran into a problem when the user navigates back to the previous view. The simple application uses a UINavigationController, onto which new instances of UIViewControllers are pushed. These instances are all of the same class (in this example, class MyView...

Blank field showing up on iPhone AddressBook, how to debug?

The following code creates me an array of all my contacts in my address book by first name and last name. The problem is, I have one contact that keeps showing up with an empty first name and last name. I can't find that contact in my actual address book. Can anyone suggest how to debug this to figure out the source of the mystery ghost ...

The final word on NSStrings: Mutable and Immutable

I've read in several books... and online... about immutable and mutable strings. They claim "immutable strings" can't be changed. (But they never define "change".) Which of these NSStrings could be changed without using NSMutableString? The string contains "catfish"... and I later try to change it to "cat". (Same letters, just shorter....

unable to make the make file

Hi Sir first of all i would like to thank you for answering me . still i am stuck up with an error when i type include $(GNUSTEP_MAKEFILES)/common.make in the MINGW32 shell i am getting the error as follows sh: GNUSTEP_MAKEFILES: command not found sh: include: command not found please tell me whether i should make a make.txtfile an...

How to round a number to end in 50 in obj c / cocoa

How to round a number to end in 50 in obj c or c++ / cocoa? I am writing a tax program, for the final lookup i have to round the income to end in 50 before i apply the tax rate. The only alternative i can think of is string modification, but im shaky in that area,]. ...