objective-c

Problem making UITableViewCell text white when selected

When my user clicks on a cell I want the text to turn white: - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; lblName.textColor = [UIColor whiteColor]; lblTime.textColor = [UIColor whiteColor]; } This works fine, but when the user selects another cell, the previ...

What's the modern equivalent of GetNextEvent in Cocoa?

I'm porting an archaic C++/Carbon program to Obj-C and Cocoa. The current version uses asynchronous usb reads and GetNextEvent to read the data. When I try to compile this in Objective C, GetNextEvent isn't found because it's in the Carbon framework. Searching Apple support yields nothing of use. EDIT TO ADD: Ok, so what I'm trying ...

XCode: Two targets, two main files?

I'm working up a game in XCode, and I want to add a helper application that uses the main application's various classes to build the main application's data files. Specifically: The main application is a card game. I want a helper app that uses the classes such as card.m while it creates the deck.xml files for the deck of custom cards t...

simple NSMutable array question....

umm So simple question here: I have an instance of NSMutableArray declared in my header NSMutableArray *day19; @property (nonatomic, retain) NSMutableArray *day19 implementation: @synthesize day19; In my viewDidLoad self.day19 = [[NSMutableArray alloc] init]; In the myMethod where I want to add objects to the array I: NSObjec...

Monkey Patch an Instance in Objective-C

I'm trying to follow the (brilliant) instructions from here, but I have an instance of a class that I cannot modify by subclassing. Is there any way to override methods to an instance of the class only? ...

How to make image Disappear on touching it ?

hi, I am working on apllication for iphone in xcode 3.1. I want similar two images to disappear when touched one after other. I have succeed in displaying two images on iphone simulator on touching 'PlAY' button. Now i want that when two same images are 'touched' one after another,they should disappear. Expect code in Objective C. ...

posting comments to facebook results in "user not visible" error

I am writing a facebook app for iphone, however when I send a request to post a comment I get the following error: failed with error: Error Domain=api.facebook.com Code=210 "User not visible" UserInfo=0x5a986b0 {request_args=( { key = text; value = "Test comment"; }, { key = format; value = XML; }, { key ...

UIWebView and an Encoded HTML String?

I'm working on an iPhone project. I am getting an HTML fragment from an RSS feed and am attempting to load it into a UIWebView using the loadHTMLString method. The string I am receiving from the feed is HTML encoded. When I pass it to the webview, it displays the decoded HTML, meaning it shows the tags along with the content of the pag...

What is the best way to repeat a UIView animation (with blocks) X times?

I have an animation that I'd like to repeat 5 times and then stop. Is there a way to set the repeat count with the Blocks API? My current approach is to kick off a NSTimer to trigger the animation X times. Is there a better way along the lines of setAnimationRepeatCount: ...

Learning Objective-C with a Java background

Thinking about learning Objective-C I've a background in Java and haven't thought about learning another language yet. The main goal is to eventually get into iPhone and iPad software development, but it's still early days. My main question is: should I start with C or just jump straight into Objective-C since I'm already familiar with ...

What Are Linear PCM Values

Hello All, I am working with audio in the iPhone OS and am a bit confused. I am currently getting input from my audio buffer in the form of pcm values ranging from -32767 to 32768. I am hoping to perform a dbSPL conversion using the formula 20LOG10(p/pref). I am aware that pRef is .00002 pascals, and would like to convert the pcm va...

ObjectiveC/iphone: convert an array of dicts to an array composed of a certain attribute of each dict

Looking for the most succinct way to convert an array of dicts to an array composed of a certain attribute of each dict. eg. [ { name => 'Visa', value => 'VI' }, { name => 'Mastercard', value => 'MC' }] => ['Visa', 'Mastercard'] ...

submitting binary to apple and geting CFBundleVersion error

We are trying to submit a new binary version with in-app purchase into the Apple iphone app store. However, we are getting the following error when trying to do so: "The key CFBundleVersion in the Info.plist file must be a period-separated list of positive integers." We believe that the problem is that svn is appending an 'r' for the r...

How do I seed the random generator and create a random int in Objective-C

I have seen some examples of the random int in Objective-C, but all people are complaining about the same number sequence every time the application runs. I have read about seeding the random number, but I am not sure what that even means. How can a random number be generated differently every time, even after application has relaunche...

UITabBarController in the middle of an app causing some difficulties

Hi - I have an an iPhone app I'm building. The first two screens are navigation controllers but starting from the third screen on, I want a UITabBarController with three navigation controllers inside. I'm able to code the UITabBarController by hand (not using interface builder) and all works fine except that when I transition to the U...

UITableViewcell UIColor

I'm trying to find out how to set UITableViewCell background color to the "grey" used for example in the official clock application for alarm cells. I'm unable to find that out in system colors nor elsewhere. How do I set this color? ...

What does the '&' symbol in front of a variable do?

I've been going through some open-source code for a Twitter app, and came across this: (in the OADataFetcher.h) file: OAMutableURLRequest *request; NSURLResponse *response; NSError *error; NSData *responseData; (inside the 'fetchDataWithRequest:delegate:didFinishSelector:didFailSelector:' method) in OADataFetcher.m: responseData = ...

Double parentheses in sample code

I see a lot of code like this in samples and in stubs that XCode generates: if ((self = [super init])) { } I am not clear on the intention of double parenthesis in the conditional. ...

objective c popen

im looking to execute to execute command line commands from objective c. I know that popen can do this however I am have trouble trying to read and display what the data as an NSString. can anyone tell me how to do this or give me a native objective c function that is equivalent? I probably should have mentioned im trying to write an ap...

How to unselect a UITableViewCell when UITableView has scrolled?

How can I unselect a UITableViewCell when UITableView has scrolled? ...