objective-c

NSString is empty

How do you test if an NSString is empty? or all whitespace or nil? with a single method call? ...

Adding yourself as an observer to an array than an NSArrayController is bound to?

I have class called AppController which contains a mutable array of Person objects called people. Each person simply has an NSString and a float. I also have an NSArrayController whose contentArray is bound to the people array in AppController. Then I have the usual setup of a table view bound to the array controller to show a list of ...

Objective-C Runtime: best way to check if class conforms to protocol?

I have a Class (but no instance) and need to know if it conforms to a certain protocol. However, Class can be subclassed several times and class_conformsToProtocol() ignores protocols declared on superclasses. I could just use class_getSuperclass() and recursively check all the classes in the hierarchy upwards until the superclass is ni...

Why is my retain count for the variable inputString eleven here?

I'm trying to get my head around memory management in Objective - C. I've used the garbage collector up until this point but before I go forward I'd like to get a better understanding of manually managing memory. I'm aware that I don't have an implementation of a dealloc method in this code. My question is why does my inputString variab...

Saving an integer value for later on an iPhone.

How do you save a value from a text feild so that can be saved and displayed later, on a differnt opening. ...

How can I determine if a view has been loaded for the first time?

I want to detect the very first time my view is displayed. After that, I wan't to forget about it. Where can I set a BOOL to do this? ...

Remove chars upto specific one in NSString

Hi, if i have an NSString eg-> string(102)"?xml etc How to remove all chars upto and including the double quote. I want to remove the string(102)" Doing this NSString* newString = [str substringFromIndex:13] works but is not ideal ...

Why does a UITableView data source get loaded after rows are created?

I have an interesting problem. I am loading a UITableView asynchronously. I am trying to get the count: prefs = [NSUserDefaults standardUserDefaults]; NSInteger dmCount = [prefs integerForKey:@"dmCount"]; NSLog(@"items count %d", [self.items count]); if (abs([self.items count] - dmCount) > 0) { [prefs setInteger:abs([self.items...

iphone memory over release

if I release a variable more than it should be, would that be a problem? I cannot determine the retain count ahead of time. ...

AppleScript text delimiters in objective c

Is there an objective c version of text delimiters?? Here's the applescript code: set oldDelim to AppleScript's text item delimiters set AppleScript's text item delimiters to "Jarvis>" set charliePlainOutput to (what ever needs to be parsed) set charlieUnmoddedOutput to last text item of charliePlainOutput set charlieOutputFiltered to...

converting data back into a string

So I have this: NSData *charlieSendData = [[charlieImputText stringValue] dataUsingEncoding:NSUTF8StringEncoding]; I know how to convert NSStrings to data but how I convert data back to an NSString? Elijah ...

iPhone SDK: is it possible to make standard movie player working in portrait orientation?

I tried to use - (BOOL) shouldAutoRotateToInterfaceOrientation(UIInterfaceOrientation)interfaceOrientation { if(interfaceOrientation == UIInterfaceOrientationPortrait) { return YES; } } but it doesn't change anything in a standard movie player. Screen rotates to landscape mode automatically and movie player does not re...

How to convert the NSMutableArray to CSV file on iPhone?

Hi, everyone, I am writing an iPhone application, which contains a function. It can convert the NSMutableArray to a CSV file. However, I don't know how to do. Can anyone help me to do this? Thank you very much. // ------ Update ----- Thank you for everyone reply. Actually, the array contains the objects of the elements, but I can co...

Bignum, Linear Algebra and Digital Signal Processing on iPhone OS (iOS 4)

I think I've found some gems in the iPhone OS (iOS 4). I found that there're 128-bit, 256-bit, 512-bit and 1024-bit integer data types, provided by the Accelerate Framework. There're also Apple's implementation of Basic Linear Algebra Subprograms (BLAS), Apple's implementation of LAPACK (Linear Algebra PACKage), and Digital Signal Proce...

Can we upload applications developed by VMWARE server to App Store?

Hi Guys I am having one doubt using VMWare Server. I have developed applications using VMWare Server. Can i upload these applications to App Store? Is there any chance to apple that it can find the application is developed in VMWare Server and apple will reject this applications? Can any one please tell me? ...

iPhone Objective-C: Keyboard won't hide with resignFirstResponder, sometimes.

I have a UITextView which I call resignFirstResponder on when the return key is hit. The text view does resign first responder (the flashing cursor thing in the text box goes away), but the keyboard sometimes won't go away. What could be causing this problem? Thank you! ...

What is an effective way to display a lot of NSManagedObjects in a table view without too much resource overhead?

I'm working on a table view that will display all of a certain type of managed object, and I'm wondering if I should be doing something to prevent faults from firing all the time when the user scrolls and I set up a new cell in the data source? I don't know too much detail about large amounts of managed objects, (several hundred) but I ...

Simple Objective-C (applies to C) console program to convert fahrenheit to celsius and visa versa

Hey everyone, I am writing a simple console application in Objective-C but I have heard that this coding may be loosely applied to some C as well, so I wanted to make that clear. I am having a slight problem however, when I run from the Debugger in Xcode, for some reason, my program does not wait for user input, it just rolls right on t...

iPhone app rating popup code

Hi. Does anyone know of open source code available to implement a popup to the user after so many days or so many instances of the app to prompt the user to rate and review the app on the app store? I've seen this already with a few apps I own. Thanks in advance for your help. ...

MGTwitterEngine and Authentication Delegation

Hi. I've been racking my brain for a bit trying figure out what's the cleanest way to handled failed authenication using delegation with the MGTwitterEngine. Is this the correct usage of the connectionIdentifier or just hacked? - (void)initiateCredentialCheckWithUsername:(NSString *)username password:(NSString *)password { self.au...