objective-c

Does having large numbers of selectors slow down Objective-C programs?

Hi, when I register a large number (10000+) of additional selectors in an Objective-C program using the runtime function sel_registerName, does this slow down my program? Not taking into account the time it takes to register those selectors. Best regards, Jochen ...

How do I show what type of object is getting returned from an array or method?

I have an array that can store different types of objects. When I retrieve that object I'd like to print that object type to the log. I can't seem to find a method that does this. I don't want to print the contents of the object. I'd like the log to say something like "NSString" or "NSDictionary". ...

OpenFlow :: Howto Stream Images

I am trying to use OpenFlow (http://apparentlogic.com/openflow/) in an iPhone App to stream files off of my server. How can I do this? Should I be using NSOperationQueue? So far I have been able to: * Use local files * Use their demo from Flickr (which uses the Flickr API and library) Code to load local images: NSString *imageName; f...

Memory still increasing when use CFRelease for ABRecordCopyValue???

hi everyone, i have a problem make headache, i simply create method: -(void) main{ for (int i = 0; i< 100;i++) { [self getPhoneOfContact:i]; } } -(void)getPhoneOfContact:(NSInteger)id_contact { ABRecordRef record = ABAddressBookGetPersonWithRecordID(addressBook,id_contact); CFTypeRef ref1; ref1...

How can i remove umlauts from XML?

i have tried to remove umlaults from XML.i have also used some code like this but still it's not working so please help me in my task. NSString *something = [self base64StringFromData:CDATABlock length:[CDATABlock length]]; NSData *pageData=[something dataUsingEncoding:NSUTF8StringEncoding]; NSString *webpage = [NSString stringWith...

How to remove a particular view controller from uinavigationcontroller stack ?

I have a uinavigationcontroller. After logged in i want to remove viewcontrollers like RegisterViewController,LoginViewController etc from UInavigationcontroller stack.. I mean i have to remove a particular view controller from stack ? How its possible. ? I checked this post http://starterstep.wordpress.com/2009/03/05/changing-a-u...

Using Objective C/Cocoa to unescape unicode characters, ie \u1234

Some sites that I am fetching data from are returning UTF-8 strings, with the UTF-8 characters escaped, ie: \u5404\u500b\u90fd Is there a built in cocoa function that might assist with this or will I have to write my own decoding algorithm. ...

VCard Attachment in mail

how to attach the vcard in mail client programmatically, want to create a .vcf file and attach to the mail client ...

How to check a uiviewcontroller is present in uinavigationcontroller stack

I have a UINavigationController . I have to pop a view from a UINavigationController and replace it with another. How we can search for a UIviewcontroller object and replace it with another ? when i print NSMutableArray *allViewControllers = [NSMutableArray arrayWithArray: myDelegate.navigationController.viewControllers];...

How to read file contents

Hi. I have a text view on which i m droping a plist file. It's displaying the path of the file which i dropped there. Now i want to read the contents of that file without opening the file. How to do that? Can anybody help me? ...

Hide, show annotation on MkMapView

How to hide annotation when zooming out the map view. I have a big number of annotation i have to hide them because if the region displayed on the map is too big you can see only the annotations. ...

Objective-C #import a whole directory

Hey guys, sure hope you can help me. I've got around 50 Model-Classes stored in a seperate Folder (not only a group) and I really don't want to write an #import for each of these classes. Is there a way to import a whole directory? I know it's possible within other programming languaged and perhabs I simply used wrong syntax. Plz hel...

getting instance id for nsstring

I am trying to find out how to print instance id for known objects like NSString and NSNumber. When i try using it on any of those objects i just get content not the instance id. Help will be greatly appreciated Thanks ...

Change label property when cell selected

Hello, I am using a custom cell with multiple labels contained in it. I would like to change the text color of all labels to white, when the cell is selected. How would do this? Appreciate any help. ...

JavaScript alert() not working in embedded WebView

When embedding WebView in an application and loading html-pages in it, JavaScripts alert()/confirm()/etc. do not work. Looking around in the documentation, there are no related settings in WebPreferences - the only thing that looks related are WebUIDelegates -(void)webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame: etc ... but...

How do I get the current date?

How can I get the current date, and format it like "20/12/2010"? Thanks in advance..:) ...

iPhone : Getting a value back from views

Hello, From the view A I open the View B which contains categories in a uitableview, when I select a category I open the view C which contains subcategories for the category (using the CoreData persistence ) in a uitableview, when I select a subcategory I open the view D which contains all my product (using the CoreData persistence ), w...

Factory (design pattern) in Objective C

I'm trying to create a factory (design pattern) in Objective C So I'm doing something like: +(Car*) createCar:(int) color{ if (color==1){ return [CarFactory createBlueCar]; }else if(color==2){ return [CarFactory createRedCar]; }else{ return nil; } } +(Car*)createBlueCar{ } +(Car*)createRedCar{ } } However I don't want...

Am I crazy? Help with NSFileManager delegate method shouldProceedAfterError in 10.5+

So I'm kind of a Cocoa n00b, but I'm writing this simple little program and I can't get the NSFileManager delegate method "shouldProceedAfterError..." to fire. Here's the code I'm running in my AppDelegate -(BOOL)copyFile { [[NSFileManager defaultManager] setDelegate:self]; NSError *copyError = nil; NSString *filename = [[N...

How can I read out Joystick values in Objective-C under OS X Snow Leopard?

Hello, I'm trying to interface with Joysticks in Objective-C, basically I want to read out the analog position values. I'm new to objective-c, and even though I searched a lot, I didn't find a way to do this. There seems to be a way using GLUT, but the solution should work even without a window open, and I also wasn't able to understan...